Class: Emplace::Project

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

Instance Method Summary collapse

Constructor Details

#initialize(name, opts = {}, impl = Emplace.load_env) ⇒ Project

Returns a new instance of Project.



6
7
8
9
10
# File 'lib/emplace.rb', line 6

def initialize(name, opts = {}, impl = Emplace.load_env)
  @name = name
  @opts = opts
  @impl = impl
end

Instance Method Details

#build!Object



31
32
33
# File 'lib/emplace.rb', line 31

def build!
  @impl.build build_dir
end

#build_dirObject



14
15
16
# File 'lib/emplace.rb', line 14

def build_dir
  'build'
end

#clean!Object



23
24
25
26
27
# File 'lib/emplace.rb', line 23

def clean!
  FileUtils.rm_rf build_dir
  FileUtils.rm_rf dist_dir
  FileUtils.rm_rf vendor_dir
end

#cmake!Object



28
29
30
# File 'lib/emplace.rb', line 28

def cmake!
  @impl.cmake @name, module_dir, build_dir, dist_dir
end

#dist_dirObject



17
18
19
# File 'lib/emplace.rb', line 17

def dist_dir
  'dist'
end

#extract!Object



40
41
42
# File 'lib/emplace.rb', line 40

def extract!
  @impl.extract @name, vendor_dir
end

#fetch!Object



43
44
45
# File 'lib/emplace.rb', line 43

def fetch!
  @impl.fetch(@name, @opts, vendor_dir)
end

#module_dirObject



11
12
13
# File 'lib/emplace.rb', line 11

def module_dir
  File.join(File.dirname(File.dirname(__FILE__)), 'modules')
end

#package!Object



37
38
39
# File 'lib/emplace.rb', line 37

def package!
  @impl.package @name, dist_dir
end

#test!Object



34
35
36
# File 'lib/emplace.rb', line 34

def test!
  @impl.test build_dir
end

#vendor_dirObject



20
21
22
# File 'lib/emplace.rb', line 20

def vendor_dir
  'vendor'
end