Class: Assets::Repository::Directory
- Inherits:
-
Object
- Object
- Assets::Repository::Directory
- Defined in:
- lib/assets/repository.rb
Overview
Physical directory repository
Instance Method Summary collapse
-
#compile(name) ⇒ Rule::Compile::Sass
private
Build a compile rule.
-
#file(name) ⇒ Rule::File
private
Build a file rule.
-
#glob(pattern) ⇒ Enumerable<String>
private
Return names matching pattern.
-
#path(name) ⇒ Pathname
private
Return path for name.
Instance Method Details
#compile(name) ⇒ Rule::Compile::Sass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Build a compile rule
55 56 57 |
# File 'lib/assets/repository.rb', line 55 def compile(name) Rule::Compile.build(file(name)) end |
#file(name) ⇒ Rule::File
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Build a file rule
18 19 20 |
# File 'lib/assets/repository.rb', line 18 def file(name) Rule::File.new(name.to_s, path(name)) end |
#glob(pattern) ⇒ Enumerable<String>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return names matching pattern
30 31 32 33 34 35 |
# File 'lib/assets/repository.rb', line 30 def glob(pattern) root = self.root Pathname.glob(root.join(pattern)).map do |match| match.relative_path_from(root).to_s end end |
#path(name) ⇒ Pathname
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return path for name
45 46 47 |
# File 'lib/assets/repository.rb', line 45 def path(name) root.join(name) end |