class Fangorn::Sass

Public Class Methods

new(input) click to toggle source
Calls superclass method Fangorn::Output::new
# File lib/fangorn/sass.rb, line 7
def initialize(input)
  output = Output::dist? ? application_css : File.join(Output::dest, input.sub(File.join(Output::source, ''), '')).sub(/sass$/, 'css')
  super input, output
end

Protected Instance Methods

application_css() click to toggle source
# File lib/fangorn/sass.rb, line 23
def application_css
  File.join Output::dest, 'stylesheets', 'application.css'
end
create_command() click to toggle source
# File lib/fangorn/sass.rb, line 13
def create_command
  remove! unless @@cleaned
  @@cleaned = true

  File.open(@output, Output::dist? ? 'a' : 'w') do |f|
    f.puts "/* #{@input} */"
    f.write ::Sass::Engine.new(File.read(@input), load_paths: [File.dirname(@input)]).render
    f.puts
  end
end