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
7 8 9 10 |
# File 'lib/zine/style.rb', line 7 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
13 14 15 16 17 |
# File 'lib/zine/style.rb', line 13 def process(string_or_file_writer) sass = File.open(@style_file, 'r').read css = SassC::Engine.new(sass, style: :compressed).render string_or_file_writer.write @css_file, css end |