Class: RequirejsOptimizer::Build

Inherits:
Object
  • Object
show all
Defined in:
lib/requirejs_optimizer/build.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Build

Returns a new instance of Build.



7
8
9
# File 'lib/requirejs_optimizer/build.rb', line 7

def initialize(*args)
  @steps = args.inject({}) { |m, s| m[s.name] = s.new; m }
end

Instance Attribute Details

#stepsObject

Returns the value of attribute steps.



5
6
7
# File 'lib/requirejs_optimizer/build.rb', line 5

def steps
  @steps
end

Instance Method Details

#runObject



11
12
13
# File 'lib/requirejs_optimizer/build.rb', line 11

def run
  @steps.each { |s| s.last.perform }
end

#step(name) ⇒ Object



15
16
17
# File 'lib/requirejs_optimizer/build.rb', line 15

def step(name)
  @steps[name]
end