Class: Evm::Builder::Dsl
- Inherits:
-
Object
- Object
- Evm::Builder::Dsl
- Defined in:
- lib/evm/builder.rb
Instance Method Summary collapse
- #build_path ⇒ Object
- #configure ⇒ Object
- #copy(from, to) ⇒ Object
-
#initialize ⇒ Dsl
constructor
A new instance of Dsl.
- #install(&block) ⇒ Object
- #installation_path ⇒ Object
- #linux(&block) ⇒ Object
- #make(target) ⇒ Object
- #option(name, value = nil) ⇒ Object
- #osx(&block) ⇒ Object
- #platform_name ⇒ Object
- #recipe(name, &block) ⇒ Object
- #tar_gz(name) ⇒ Object
Constructor Details
#initialize ⇒ Dsl
Returns a new instance of Dsl.
7 8 9 |
# File 'lib/evm/builder.rb', line 7 def initialize @options = [] end |
Instance Method Details
#build_path ⇒ Object
48 49 50 |
# File 'lib/evm/builder.rb', line 48 def build_path Evm.local.join('tmp', @name) end |
#configure ⇒ Object
40 41 42 |
# File 'lib/evm/builder.rb', line 40 def configure run_command './configure', *@options end |
#copy(from, to) ⇒ Object
60 61 62 |
# File 'lib/evm/builder.rb', line 60 def copy(from, to) FileUtils.cp_r(from, to) end |
#install(&block) ⇒ Object
36 37 38 |
# File 'lib/evm/builder.rb', line 36 def install(&block) yield end |
#installation_path ⇒ Object
52 53 54 |
# File 'lib/evm/builder.rb', line 52 def installation_path Evm.local.join(@name) end |
#linux(&block) ⇒ Object
27 28 29 |
# File 'lib/evm/builder.rb', line 27 def linux(&block) yield if Evm::Os.linux? end |
#make(target) ⇒ Object
44 45 46 |
# File 'lib/evm/builder.rb', line 44 def make(target) run_command 'make', target end |
#option(name, value = nil) ⇒ Object
31 32 33 34 |
# File 'lib/evm/builder.rb', line 31 def option(name, value = nil) @options << name @options << value if value end |
#osx(&block) ⇒ Object
23 24 25 |
# File 'lib/evm/builder.rb', line 23 def osx(&block) yield if Evm::Os.osx? end |
#platform_name ⇒ Object
56 57 58 |
# File 'lib/evm/builder.rb', line 56 def platform_name Evm::Os.platform_name end |
#recipe(name, &block) ⇒ Object
11 12 13 14 15 |
# File 'lib/evm/builder.rb', line 11 def recipe(name, &block) @name = name yield end |