Class: Allen::Preprocessors::Preprocessor

Inherits:
Object
  • Object
show all
Extended by:
Rake::DSL
Defined in:
lib/allen/preprocessors.rb

Direct Known Subclasses

Banshee, Coyote, Sass

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.name=(value) ⇒ Object Also known as: name

Sets the attribute name

Parameters:

  • value

    the value to set the attribute name to.



16
17
18
# File 'lib/allen/preprocessors.rb', line 16

def name=(value)
  @name = value
end

Class Method Details

.build(input, output) ⇒ Object



26
27
28
# File 'lib/allen/preprocessors.rb', line 26

def self.build(input, output)
  sh "#{@name} #{relative input}:#{relative output}"
end

.compress(input, output) ⇒ Object



30
31
32
# File 'lib/allen/preprocessors.rb', line 30

def self.compress(input, output)
  sh "#{@name} #{relative input}:#{relative output} --compress"
end

.relative(path) ⇒ Object



22
23
24
# File 'lib/allen/preprocessors.rb', line 22

def self.relative(path)
  path.gsub(Dir.pwd + '/',"")
end

.watch(input, output) ⇒ Object



34
35
36
# File 'lib/allen/preprocessors.rb', line 34

def self.watch(input, output)
  sh "#{@name} #{relative input}:#{relative output} --watch"
end