Method: Cup::Cupfile#initialize

Defined in:
lib/cup/cupfile.rb

#initialize(path) ⇒ Cupfile

Returns a new instance of Cupfile.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/cup/cupfile.rb', line 8

def initialize path

  @path = path
  @javascript_patterns = {}
  @uglifier_options = {}
  @before_build = lambda {}
  @after_build = lambda {}
  @validation_errors = []

  %w{vendor spec lib src}.each do |dir|
    set_javascript_patterns_for dir.to_sym, :*
  end

  cup_define_block = eval(File.read(path), binding, path.to_s)
  DSL.interpret self, &cup_define_block
end