Skip to content

Commit eb62c3b

Browse files
author
José Valim
committed
IEx now loads the .iex.exs file instead of the .iex one
1 parent 05cd7f1 commit eb62c3b

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
* Backwards incompatible changes
2525
* [Dict] Implementations of `equal?/2` and `merge/2` in `HashDict` and `ListDict` are no longer polymorphic. To get polymorphism, use the functions in `Dict` instead
26+
* [IEx] IEx now loads the `.iex.exs` file instead of `.iex`
2627
* [Kernel] Remove `**` from the list of allowed operators
2728
* [Kernel] Limit sigils delimiters to one of the following: `<>`, `{}`, `[]`, `()`, `||`, `//`, `"` and `'`
2829
* [Range] `Range` is no longer a record, instead use `first .. last` if you need pattern matching

bin/iex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if [ $# -gt 0 ] && ([ "$1" = "--help" ] || [ "$1" = "-h" ]); then
1717
--hidden Makes a hidden node
1818
--detached Starts the Erlang VM detached from console
1919
--remsh \"name\" Connects to a node using a remote shell
20-
--dot-iex \"path\" Overrides default .iex file and uses path instead;
20+
--dot-iex \"path\" Overrides default .iex.exs file and uses path instead;
2121
path can be empty, then no file will be loaded
2222
2323
** Options marked with (*) can be given more than once

lib/elixir/lib/kernel.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ defmodule Kernel do
377377
378378
* `:decimals` — number of decimal points to show
379379
* `:scientific` — number of decimal points to show, in scientific format
380-
* `:compact` — If true, use the most compact representation (ignored with the `scientific` option)
380+
* `:compact` — when true, use the most compact representation (ignored with the `scientific` option)
381381
382382
## Examples
383383
@@ -397,7 +397,7 @@ defmodule Kernel do
397397
398398
* `:decimals` — number of decimal points to show
399399
* `:scientific` — number of decimal points to show, in scientific format
400-
* `:compact` — If true, use the most compact representation (ignored with the `scientific` option)
400+
* `:compact` — when true, use the most compact representation (ignored with the `scientific` option)
401401
402402
## Examples
403403

lib/elixir/test/elixir/string_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ defmodule StringTest do
408408
assert String.contains? "elixir of life", "of"
409409
assert String.contains? "エリクシア", "シ"
410410
assert String.contains? "elixir of life", ["mercury", "life"]
411-
refute String.contains? "exlixir of life", "death"
411+
refute String.contains? "elixir of life", "death"
412412
refute String.contains? "エリクシア", "仙"
413413
refute String.contains? "elixir of life", ["death", "mercury", "eternal life"]
414414

lib/iex/lib/iex.ex

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,19 @@ defmodule IEx do
120120
Connecting an Elixir shell to a remote node without Elixir is
121121
**not** supported.
122122
123-
## The .iex file
123+
## The .iex.exs file
124124
125-
When starting IEx, it will look for a local .iex file (located in the current
126-
working directory), then a global one (located at ~/.iex) and will load the
125+
When starting IEx, it will look for a local `.iex.exs` file (located in the current
126+
working directory), then a global one (located at `~/.iex.exs`) and will load the
127127
first one it finds (if any). The code in the chosen .iex file will be
128128
evaluated in the shell's context. So, for instance, any modules that are
129129
loaded or variables that are bound in the .iex file will be available in the
130130
shell after it has booted.
131131
132132
Sample contents of a local .iex file:
133133
134-
# source another .iex file
135-
import_file "~/.iex"
134+
# source another `.iex` file
135+
import_file "~/.iex.exs"
136136
137137
# print something before the shell starts
138138
IO.puts "hello world"
@@ -151,7 +151,7 @@ defmodule IEx do
151151
iex(1)> value
152152
13
153153
154-
It is possible to override the default loading sequence for .iex file by
154+
It is possible to override the default loading sequence for `.iex.exs` file by
155155
supplying the `--dot-iex` option to iex. See `iex --help`.
156156
157157
## Configuring the shell
@@ -164,7 +164,7 @@ defmodule IEx do
164164
`IEx.Options.print_help/1` will print documentation for the given option.
165165
166166
In particular, it might be convenient to customize those options inside your
167-
.iex file like this:
167+
`.iex.exs` file like this:
168168
169169
# .iex
170170
IEx.Options.set :inspect, limit: 3

lib/iex/lib/iex/evaluator.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ defmodule IEx.Evaluator do
4545
end
4646

4747
@doc """
48-
Locates and loads an .iex file from one of predefined locations.
48+
Locates and loads an .iex.exs file from one of predefined locations.
4949
Returns the new config.
5050
"""
5151
def load_dot_iex(config, path \\ nil) do
5252
candidates = if path do
5353
[path]
5454
else
55-
Enum.map [".iex", "~/.iex"], &Path.expand/1
55+
Enum.map [".iex.exs", "~/.iex.exs"], &Path.expand/1
5656
end
5757

5858
path = Enum.find candidates, &File.regular?/1

lib/iex/lib/iex/options.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule IEx.Options do
22
@moduledoc """
33
Provides an interface for adjusting options of the running IEx session.
44
5-
Changing options is usually done inside an IEx session or in your .iex file.
5+
Changing options is usually done inside an IEx session or in your .iex.exs file.
66
See `h(IEx)` for more info on the latter.
77
88
If the value of an option is a keyword list, only those keys that are

0 commit comments

Comments
 (0)