Class: Cup::Cupfile::DSL

Inherits:
BasicObject
Defined in:
lib/cup/cupfile.rb

Defined Under Namespace

Classes: JavascriptsDSL

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cupfile) ⇒ DSL

Returns a new instance of DSL.



93
94
95
# File 'lib/cup/cupfile.rb', line 93

def initialize cupfile
  @cupfile = cupfile
end

Class Method Details

.interpret(cupfile, &block) ⇒ Object



88
89
90
91
# File 'lib/cup/cupfile.rb', line 88

def self.interpret cupfile, &block
  new(cupfile).instance_eval &block
  cupfile
end

Instance Method Details

#after_build(&block) ⇒ Object



106
107
108
# File 'lib/cup/cupfile.rb', line 106

def after_build &block
  @cupfile.instance_variable_set :@after_build, block
end

#before_build(&block) ⇒ Object

block cachers



102
103
104
# File 'lib/cup/cupfile.rb', line 102

def before_build &block
  @cupfile.instance_variable_set :@before_build, block
end

#javascripts(&block) ⇒ Object



97
98
99
# File 'lib/cup/cupfile.rb', line 97

def javascripts &block
  JavascriptsDSL.interpret @cupfile, &block
end

#mObject

DSL members setters



82
83
84
85
86
# File 'lib/cup/cupfile.rb', line 82

%W{version name licence uglifier_options}.each do |m|
  define_method m do |value|
    @cupfile.instance_variable_set "@#{m}", value
  end
end