Class: Stylus::Runner
- Inherits:
-
Object
- Object
- Stylus::Runner
- Defined in:
- lib/stylus_rails/runner.rb
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(*paths) ⇒ Runner
constructor
A new instance of Runner.
Constructor Details
#initialize(*paths) ⇒ Runner
Returns a new instance of Runner.
5 6 7 |
# File 'lib/stylus_rails/runner.rb', line 5 def initialize(*paths) @paths = paths.flatten.select { |path| should_parse?(path) } end |
Instance Attribute Details
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
3 4 5 |
# File 'lib/stylus_rails/runner.rb', line 3 def paths @paths end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/stylus_rails/runner.rb', line 9 def call directories = group_paths directories.each_pair do |directory, files| FileUtils.mkdir_p(directory) unless File.directory?(directory) output = `stylus #{files.join(" ")} -o #{directory}#{' -c' if Stylus.compress?} 2>&1` if failed? handle_failure(output) else Stylus.logger.info(output) end end end |