Class: PrettyDoc::Resource::Scss
- Inherits:
-
PrettyDoc::Resource
- Object
- PrettyDoc::Resource
- PrettyDoc::Resource::Scss
- Defined in:
- lib/pretty_doc/resources/scss.rb
Overview
Scss resource
Instance Attribute Summary collapse
-
#scss_pathname ⇒ Object
Returns the value of attribute scss_pathname.
Attributes inherited from PrettyDoc::Resource
Instance Method Summary collapse
-
#initialize(scss_pathname) ⇒ Scss
constructor
A new instance of Scss.
- #write(dir, options = {}) ⇒ Object
Constructor Details
#initialize(scss_pathname) ⇒ Scss
Returns a new instance of Scss.
12 13 14 |
# File 'lib/pretty_doc/resources/scss.rb', line 12 def initialize(scss_pathname) self.scss_pathname = scss_pathname end |
Instance Attribute Details
#scss_pathname ⇒ Object
Returns the value of attribute scss_pathname.
10 11 12 |
# File 'lib/pretty_doc/resources/scss.rb', line 10 def scss_pathname @scss_pathname end |
Instance Method Details
#write(dir, options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/pretty_doc/resources/scss.rb', line 16 def write(dir, = {}) PrettyDoc.mktmpdir do |tmppath| tmpdir = Pathname.new(tmppath) ::Compass.configuration.sass_path = scss_pathname.to_s ::Compass.configuration.css_path = tmpdir.to_s update_project = ::Compass::Commands::UpdateProject.new( PrettyDoc.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 |