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
- #after_build(&block) ⇒ Object
-
#before_build(&block) ⇒ Object
block cachers.
-
#initialize(cupfile) ⇒ DSL
constructor
A new instance of DSL.
- #javascripts(&block) ⇒ Object
-
#m ⇒ Object
DSL members setters.
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 |
#m ⇒ Object
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 |