Extension of common Elixir modules.
The package can be installed by adding common_x
to your list of dependencies in mix.exs
:
def deps do
[
{:common_x, "~> 0.5"}
]
end
The docs can be found at https://hexdocs.pm/common_x.
The following modules have extension:
ApplicationX
(Application
extension)CodeX
(Code
extension)EnumX
(Enum
extension)MapX
(Map
extension)Macro
(Macro
extension)
- Support Elixir 1.14 changes.
- Recompile when mix.exs changes.
- Fix project detection when installed inside a Elixir script with
Mix.install/2
.
- Small fix detecting compile environment in custom commands and Elixir >= 1.11.
- Small fix detecting compile environment.
- Compile warning fix.
- Improve
ApplicationX.mix_env/0
for newer OTP/Elixir versions.
- Add
ApplicationX.mix_env/0
, which returns the current Mix environment.
- Add
CodeX.ensure_compiled?/1
, which returnstrue
if the module is already compiled or was successfully compiled. - Add
CodeX.ensure_loaded?/1
, which returnstrue
if the module is already loaded or was successfully loaded.
- Add
ApplicationX.main_project/0
, which returns the mix project config of the main application, even when called from dependencies.
- Add
ApplicationX.main/0
, which returns the atom of the main application, even when called from dependencies.
- Add
MapX.update_if_exists/3
to update map values, only if the key exists.
- Fix
MapX.new/2
spec.
- Add
ApplicationX
extension with the following methods:applications/0
list all applications, without starting.applications/1
list all dependencies, without starting.modules/0
list all modules, without starting applications.modules/1
list all modules in given applications, without starting them.
- Add
MacroX
extension with the following methods:camalize/1
proper camelCase forstring
andatom
.pascalize/1
proper PascalCase forstring
andatom
.snakize/1
proper snake_case forstring
andatom
.underscore/1
alias forsnakize
.