24
25
26
27
28
29
30
31
32
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
|
# File 'lib/logical-construct/plan/standalone-bundle.rb', line 24
def define
directory gems.absolute_path
in_namespace do
Mattock::BundleCommandTask.define_task(:standalone => gems.absolute_path) do |bundle_build|
bundle_build.command = (
cmd("cd", target_dir.absolute_path) &
cmd("bundle", "install"){|bundler|
bundler.options << "--gemfile=" + gemfile.absolute_path
bundler.options << "--path=" + gems.absolute_path
bundler.options << "--standalone"
bundler.options << "--binstubs=bin"
})
end
task :pristine => gems.absolute_path do
gem_scope = [Gem.ruby_engine, Gem::ConfigMap[:ruby_version]].join("/")
cmd_env = {
"RUBYOPT" => "",
"GEM_HOME" => gems.pathname.join(gem_scope).to_s }
cmd("gem pristine") do |gem|
gem.options << "--all"
gem.options << "--extensions"
gem.command_environment.merge! cmd_env
end.must_succeed!
end
task :load_setup do
require gems.pathname.join("bundler/setup")
end
end
task 'install:perform' => self[:pristine]
task 'compile:perform' => self[:standalone]
task 'compile:preflight' => gemfile.absolute_path
task :preflight => self[:load_setup]
end
|