Class: Evm::Builder::Dsl
- Inherits:
-
Object
- Object
- Evm::Builder::Dsl
- Defined in:
- lib/evm/builder.rb
Instance Method Summary collapse
- #autogen ⇒ Object
- #build_path ⇒ Object
- #builds_path ⇒ Object
- #configure ⇒ Object
- #copy(from, to) ⇒ Object
- #git(url) ⇒ Object
-
#initialize ⇒ Dsl
constructor
A new instance of Dsl.
- #install(&block) ⇒ Object
- #installation_path ⇒ Object
- #installations_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(url) ⇒ Object
- #tar_xz(url) ⇒ 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
#autogen ⇒ Object
51 52 53 |
# File 'lib/evm/builder.rb', line 51 def autogen run_command './autogen.sh' end |
#build_path ⇒ Object
67 68 69 |
# File 'lib/evm/builder.rb', line 67 def build_path File.join(builds_path, @name) end |
#builds_path ⇒ Object
63 64 65 |
# File 'lib/evm/builder.rb', line 63 def builds_path File.join(Evm.config[:path], 'tmp') end |
#configure ⇒ Object
55 56 57 |
# File 'lib/evm/builder.rb', line 55 def configure run_command './configure', *@options end |
#copy(from, to) ⇒ Object
83 84 85 |
# File 'lib/evm/builder.rb', line 83 def copy(from, to) run_command "cp -a #{from} #{to}" end |
#git(url) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/evm/builder.rb', line 17 def git(url) git_repo = Evm::Git.new(build_path) if git_repo.exist? git_repo.pull else git_repo.clone(url) end end |
#install(&block) ⇒ Object
47 48 49 |
# File 'lib/evm/builder.rb', line 47 def install(&block) yield end |
#installation_path ⇒ Object
75 76 77 |
# File 'lib/evm/builder.rb', line 75 def installation_path File.join(installations_path, @name) end |
#installations_path ⇒ Object
71 72 73 |
# File 'lib/evm/builder.rb', line 71 def installations_path Evm.config[:path] end |
#linux(&block) ⇒ Object
38 39 40 |
# File 'lib/evm/builder.rb', line 38 def linux(&block) yield if Evm::Os.linux? end |
#make(target) ⇒ Object
59 60 61 |
# File 'lib/evm/builder.rb', line 59 def make(target) run_command 'make', target end |
#option(name, value = nil) ⇒ Object
42 43 44 45 |
# File 'lib/evm/builder.rb', line 42 def option(name, value = nil) @options << name @options << value if value end |
#osx(&block) ⇒ Object
34 35 36 |
# File 'lib/evm/builder.rb', line 34 def osx(&block) yield if Evm::Os.osx? end |
#platform_name ⇒ Object
79 80 81 |
# File 'lib/evm/builder.rb', line 79 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 |
#tar_gz(url) ⇒ Object
30 31 32 |
# File 'lib/evm/builder.rb', line 30 def tar_gz(url) tar_packaged(url, 'gz') end |
#tar_xz(url) ⇒ Object
26 27 28 |
# File 'lib/evm/builder.rb', line 26 def tar_xz(url) tar_packaged(url, 'xz') end |