Class: Evm::Builder::Dsl

Inherits:
Object
  • Object
show all
Defined in:
lib/evm/builder.rb

Instance Method Summary collapse

Constructor Details

#initializeDsl

Returns a new instance of Dsl.



7
8
9
# File 'lib/evm/builder.rb', line 7

def initialize
  @options = []
end

Instance Method Details

#build_pathObject



48
49
50
# File 'lib/evm/builder.rb', line 48

def build_path
  Evm.local.join('tmp', @name)
end

#configureObject



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_pathObject



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_nameObject



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

#tar_gz(name) ⇒ Object



17
18
19
20
21
# File 'lib/evm/builder.rb', line 17

def tar_gz(name)
  tar_file = Evm::TarFile.new(name)
  tar_file.download!
  tar_file.extract!
end