Skip to content

Commit

Permalink
Fixup links, code tags in Rails::Paths::Root
Browse files Browse the repository at this point in the history
  • Loading branch information
skipkayhil committed Sep 11, 2023
1 parent 1b97206 commit 7fd0aab
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions railties/lib/rails/paths.rb
Expand Up @@ -4,9 +4,9 @@

module Rails
module Paths
# This object is an extended hash that behaves as root of the +Rails::Paths+ system.
# This object is an extended hash that behaves as root of the Rails::Paths system.
# It allows you to collect information about how you want to structure your application
# paths through a Hash-like API. It requires you to give a physical path on initialization.
# paths through a Hash-like \API. It requires you to give a physical path on initialization.
#
# root = Root.new "/rails"
# root.add "app/controllers", eager_load: true
Expand All @@ -18,33 +18,36 @@ module Paths
# path.eager_load? # => true
# path.is_a?(Rails::Paths::Path) # => true
#
# The +Path+ object is simply an enumerable and allows you to easily add extra paths:
# The Path[rdoc-ref:Rails::Paths::Path] object is simply an enumerable and
# allows you to easily add extra paths:
#
# path.is_a?(Enumerable) # => true
# path.to_ary.inspect # => ["app/controllers"]
#
# path << "lib/controllers"
# path.to_ary.inspect # => ["app/controllers", "lib/controllers"]
#
# Notice that when you add a path using +add+, the path object created already
# contains the path with the same path value given to +add+. In some situations,
# you may not want this behavior, so you can give <tt>:with</tt> as option.
# Notice that when you add a path using #add, the
# Path[rdoc-ref:Rails::Paths::Path] object created already contains the path
# with the same path value given to #add. In some situations, you may not
# want this behavior, so you can give <tt>:with</tt> as option.
#
# root.add "config/routes", with: "config/routes.rb"
# root["config/routes"].inspect # => ["config/routes.rb"]
#
# The +add+ method accepts the following options as arguments:
# eager_load, autoload, autoload_once, and glob.
# The #add method accepts the following options as arguments:
# +eager_load+, +autoload+, +autoload_once+, and +glob+.
#
# Finally, the +Path+ object also provides a few helpers:
# Finally, the Path[rdoc-ref:Rails::Paths::Path] object also provides a few
# helpers:
#
# root = Root.new "/rails"
# root.add "app/controllers"
#
# root["app/controllers"].expanded # => ["/rails/app/controllers"]
# root["app/controllers"].existent # => ["/rails/app/controllers"]
#
# Check the +Rails::Paths::Path+ documentation for more information.
# Check the Rails::Paths::Path documentation for more information.
class Root
attr_accessor :path

Expand Down

0 comments on commit 7fd0aab

Please sign in to comment.