Class: Zine::Style
- Inherits:
-
Object
- Object
- Zine::Style
- Defined in:
- lib/zine/style.rb
Overview
Render sass into CSS in the source directory, to be copied later
Instance Method Summary collapse
-
#initialize(directories) ⇒ Style
constructor
Source & destination files.
-
#process(string_or_file_writer) ⇒ Object
Write the CSS file.
Constructor Details
#initialize(directories) ⇒ Style
Source & destination files
9 10 11 12 |
# File 'lib/zine/style.rb', line 9 def initialize(directories) @style_file = File.join directories['styles'], 'screen.scss' @css_file = File.join directories['source'], 'screen.css' end |
Instance Method Details
#process(string_or_file_writer) ⇒ Object
Write the CSS file
15 16 17 18 19 |
# File 'lib/zine/style.rb', line 15 def process(string_or_file_writer) sass = File.read(@style_file) css = SassC::Engine.new(sass, style: :compressed).render string_or_file_writer.write @css_file, css end |