Class: Frizz::Local
- Inherits:
-
Object
- Object
- Frizz::Local
- Defined in:
- lib/frizz/local.rb
Defined Under Namespace
Classes: File
Instance Method Summary collapse
- #file_for(local_path) ⇒ Object
- #files ⇒ Object
-
#initialize(root_path) ⇒ Local
constructor
A new instance of Local.
Constructor Details
#initialize(root_path) ⇒ Local
Returns a new instance of Local.
3 4 5 |
# File 'lib/frizz/local.rb', line 3 def initialize(root_path) @root_path = root_path end |
Instance Method Details
#file_for(local_path) ⇒ Object
17 18 19 |
# File 'lib/frizz/local.rb', line 17 def file_for(local_path) ::File.open (local_path) end |
#files ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/frizz/local.rb', line 7 def files @files ||= begin Dir.chdir(root_path) do Dir["**/*"].map do |local_path| File.new((local_path), local_path) unless ::File.directory?(local_path) end.compact end end end |