aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/constant_autoloading_and_reloading.md
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2014-12-15 20:06:12 +0100
committerJon Atack <jon@atack.com>2014-12-15 20:06:12 +0100
commit5a18406f0f523fe53d75b70b68d794292f519784 (patch)
tree1ea01452bb836f5dbfd57240a96790eb3a544750 /guides/source/constant_autoloading_and_reloading.md
parent72a815c3fdd288c1e94953712b7540b582adfab7 (diff)
downloadrails-5a18406f0f523fe53d75b70b68d794292f519784.tar.gz
rails-5a18406f0f523fe53d75b70b68d794292f519784.tar.bz2
rails-5a18406f0f523fe53d75b70b68d794292f519784.zip
Improve autoload_paths section
[skip ci]
Diffstat (limited to 'guides/source/constant_autoloading_and_reloading.md')
-rw-r--r--guides/source/constant_autoloading_and_reloading.md19
1 files changed, 9 insertions, 10 deletions
diff --git a/guides/source/constant_autoloading_and_reloading.md b/guides/source/constant_autoloading_and_reloading.md
index 9c0f9f58fc..4e067012b7 100644
--- a/guides/source/constant_autoloading_and_reloading.md
+++ b/guides/source/constant_autoloading_and_reloading.md
@@ -397,19 +397,18 @@ require 'erb'
```
Ruby looks for the file in the directories listed in `$LOAD_PATH`. That is, Ruby
-iterates over all its directories and for each one of them checks whether they
-have a file called "erb.rb", or "erb.so", or "erb.o", or "erb.dll". If it finds
-any of them, the interpreter loads it and ends the search. Otherwise, it tries
-again in the next directory of the list. If the list gets exhausted, `LoadError`
-is raised.
+iterates over all its directories and for each one of them checks whether it
+has a file called "erb.rb", "erb.so", "erb.o" or "erb.dll". If it finds one,
+the interpreter loads it and ends the search. Otherwise, it tries again in the
+next directory of the list. If the list gets exhausted, `LoadError` is raised.
We are going to cover how constant autoloading works in more detail later, but
-the idea is that when a constant like `Post` is hit and missing, if there's a
-*post.rb* file for example in *app/models* Rails is going to find it, evaluate
-it, and have `Post` defined as a side-effect.
+the idea is that when a constant like `Post` is hit and missing, if there is a
+*post.rb* file, for example in *app/models*, Rails will find it, evaluate it
+and have `Post` defined as a side-effect.
-Alright, Rails has a collection of directories similar to `$LOAD_PATH` in which
-to lookup that *post.rb*. That collection is called `autoload_paths` and by
+At this point, Rails has a collection of directories similar to `$LOAD_PATH` in
+which to look up *post.rb*. That collection is called `autoload_paths` and by
default it contains:
* All subdirectories of `app` in the application and engines. For example,