Class: Lm2doc::Resource::Compass
- Inherits:
-
Lm2doc::Resource
- Object
- Lm2doc::Resource
- Lm2doc::Resource::Compass
- Defined in:
- lib/lm2doc/resource/compass.rb
Instance Attribute Summary collapse
-
#scss_pathname ⇒ Object
Returns the value of attribute scss_pathname.
Attributes inherited from Lm2doc::Resource
Instance Method Summary collapse
-
#initialize(scss_pathname) ⇒ Compass
constructor
A new instance of Compass.
- #write(dir, options = {}) ⇒ Object
Constructor Details
#initialize(scss_pathname) ⇒ Compass
Returns a new instance of Compass.
13 14 15 |
# File 'lib/lm2doc/resource/compass.rb', line 13 def initialize(scss_pathname) self.scss_pathname = scss_pathname end |
Instance Attribute Details
#scss_pathname ⇒ Object
Returns the value of attribute scss_pathname.
11 12 13 |
# File 'lib/lm2doc/resource/compass.rb', line 11 def scss_pathname @scss_pathname end |
Instance Method Details
#write(dir, options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/lm2doc/resource/compass.rb', line 17 def write(dir, = {}) Lm2doc.mktmpdir do |tmppath| tmpdir = Pathname.new(tmppath) ::Compass.configuration.sass_path = self.scss_pathname.to_s ::Compass.configuration.css_path = tmpdir.to_s update_project = ::Compass::Commands::UpdateProject.new(Lm2doc.root.join("tmp").to_s, { quiet: true }) update_project.perform tmpdir.children.each do |child| relative_pathname = child.relative_path_from(tmpdir) FileUtils.cp(child, File.join(dir, relative_pathname)) end end end |