Methods
C
E
F
L
N
T
Attributes
[R] path
[RW] glob
Class Public methods
new(root, current, *paths)
     # File railties/lib/rails/paths.rb, line 107
107:       def initialize(root, current, *paths)
108:         options = paths.last.is_a?(::Hash) ? paths.pop : {}
109:         super(paths.flatten)
110: 
111:         @current  = current
112:         @root     = root
113:         @glob     = options[:glob]
114: 
115:         options[:autoload_once] ? autoload_once! : skip_autoload_once!
116:         options[:eager_load]    ? eager_load!    : skip_eager_load!
117:         options[:autoload]      ? autoload!      : skip_autoload!
118:         options[:load_path]     ? load_path!     : skip_load_path!
119:       end
Instance Public methods
children()
     # File railties/lib/rails/paths.rb, line 121
121:       def children
122:         keys = @root.keys.select { |k| k.include?(@current) }
123:         keys.delete(@current)
124:         @root.values_at(*keys.sort)
125:       end
existent()

Returns all expanded paths but only if they exist in the filesystem.

     # File railties/lib/rails/paths.rb, line 190
190:       def existent
191:         expanded.select { |f| File.exists?(f) }
192:       end
existent_directories()
     # File railties/lib/rails/paths.rb, line 194
194:       def existent_directories
195:         expanded.select { |d| File.directory?(d) }
196:       end
expanded()

Expands all paths against the root and return all unique values.

This method is also aliased as to_a
     # File railties/lib/rails/paths.rb, line 153
153:       def expanded
154:         raise "You need to set a path root" unless @root.path
155:         result = []
156: 
157:         each do |p|
158:           path = File.expand_path(p, @root.path)
159: 
160:           if @glob
161:             if File.directory? path
162:               result.concat expand_dir(path, @glob)
163:             else
164:               # FIXME: I think we can remove this branch, but I'm not sure.
165:               # Say the filesystem has this file:
166:               #
167:               #   /tmp/foobar
168:               #
169:               # and someone adds this path:
170:               #
171:               #   /tmp/foo
172:               #
173:               # with a glob of "*", then this function will return
174:               #
175:               #   /tmp/foobar
176:               #
177:               # We need to figure out if that is desired behavior.
178:               result.concat expand_file(path, @glob)
179:             end
180:           else
181:             result << path
182:           end
183:         end
184: 
185:         result.uniq!
186:         result
187:       end
first()
     # File railties/lib/rails/paths.rb, line 127
127:       def first
128:         expanded.first
129:       end
last()
     # File railties/lib/rails/paths.rb, line 131
131:       def last
132:         expanded.last
133:       end
to_a()

Alias for expanded