Class: DevBall::PkgSpec::Gem
- Inherits:
-
Base
- Object
- Base
- DevBall::PkgSpec::Gem
show all
- Defined in:
- lib/devball/pkgspec/gem.rb
Instance Method Summary
collapse
Methods inherited from Base
#ball, #ball_file_name, #ball_name, #ball_version, #build_concurrent?, #build_dir_name, #build_targets, #configure_script_name, #depends_on, depends_on, find, #install_links, #install_service_links, #install_targets, #link_mappings, load_packages, #package_install_dir, #package_name, #recursive_depends_on, register_package, #remove_build, #remove_install, set_ball, set_lib_ball, set_patch, #step_environment_setup, #step_patch, #step_setup_links, #to_s
Instance Method Details
24
25
26
|
# File 'lib/devball/pkgspec/gem.rb', line 24
def configure_params()
return {}
end
|
#gem_repository ⇒ Object
override to specify a different gem repository. Default returns nil and indicates to use the standard rubyforge repo.
29
30
31
|
# File 'lib/devball/pkgspec/gem.rb', line 29
def gem_repository()
return nil
end
|
#step_build ⇒ Object
20
21
22
|
# File 'lib/devball/pkgspec/gem.rb', line 20
def step_build()
end
|
16
17
18
|
# File 'lib/devball/pkgspec/gem.rb', line 16
def step_configure()
end
|
12
13
14
|
# File 'lib/devball/pkgspec/gem.rb', line 12
def ()
end
|
#step_install ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# File 'lib/devball/pkgspec/gem.rb', line 33
def step_install()
Dir.chdir($package_dir) {|dir|
params = configure_params.collect {|key, val|
if (val)
"--#{key}=#{val}"
else
"--#{key}"
end
}
if (params.length)
params.unshift("--")
end
if (gem_repository)
params.unshift(gem_repository)
params.unshift("--source")
end
if (ENV['RUBINIUS'])
params = ["rbx", "gem", "install", ball, *params].collect {|i| %Q{"#{i}"} }
else
params = ["gem", "install", ball, *params].collect {|i| %Q{"#{i}"} }
end
success = false
errors = []
open("|#{params.join(' ')} 2>&1", "r") {|io|
io.each {|line|
puts(line)
if (match = /ERROR:\s+(.+)$/.match(line))
errors.push(match[1])
end
if (match = /^[0-9]+ gems? installed/.match(line))
success = true
end
if (match = /^Successfully installed/.match(line))
success = true
end
}
}
if (!success)
raise(InstallFailed, "Could not install gem: #{errors.join(', ')}")
end
}
if (ENV['JRUBY'])
return "JRuby"
elsif (ENV['Rubinius'])
return "Rubinius"
else
return "Ruby"
end
end
|
#step_uninstall ⇒ Object
88
89
90
91
92
93
94
95
|
# File 'lib/devball/pkgspec/gem.rb', line 88
def step_uninstall()
if (ENV['RUBINIUS'])
system("rbx", "gem", "uninstall", ball())
else
system("gem", "uninstall", ball())
end
super()
end
|