Module: Berkshelf::Mixin::DSLEval
- Included in:
- Berksfile
- Defined in:
- lib/berkshelf/mixin/dsl_eval.rb
Defined Under Namespace
Modules: ClassMethods
Classes: CleanRoom
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.included(base) ⇒ Object
13
14
15
|
# File 'lib/berkshelf/mixin/dsl_eval.rb', line 13
def included(base)
base.send(:extend, ClassMethods)
end
|
Instance Method Details
#dsl_eval(&block) ⇒ Object
43
44
45
46
|
# File 'lib/berkshelf/mixin/dsl_eval.rb', line 43
def dsl_eval(&block)
self.class.clean_room.new(self).instance_eval(&block)
self
end
|
#dsl_eval_file(filepath) ⇒ Object
51
52
53
54
55
|
# File 'lib/berkshelf/mixin/dsl_eval.rb', line 51
def dsl_eval_file(filepath)
filepath = filepath.to_s
contents = File.read(filepath)
dsl_eval { eval(contents, binding, filepath, 1) }
end
|