tara 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ext/bundler.rb +12 -0
- data/lib/tara.rb +1 -1
- data/lib/tara/installer.rb +37 -1
- data/lib/tara/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf67fd26a216bf00d73d635b4611334cb822d819
|
4
|
+
data.tar.gz: 5f17c1b3f28685d7d1e148a641dc8af995b671d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d366f9c00a4abfad35c071514bb19a43a929712de193e0f90f5ef3837560cd5587543d479e9db67728f6adf226475164898609d7447a1fdc8019a60e7c3682bb
|
7
|
+
data.tar.gz: bbbd4a77e5dd631eb11cb07f424737a51f98ca8a8cbb886638f965c598afcdcae9c1f059ee1ddcbc4c758cdcff09dd8cc94df8c57537ef730b06eea7ca8c768a
|
data/lib/ext/bundler.rb
ADDED
data/lib/tara.rb
CHANGED
data/lib/tara/installer.rb
CHANGED
@@ -35,7 +35,7 @@ module Tara
|
|
35
35
|
|
36
36
|
def bundler_command
|
37
37
|
@bundler_command ||= begin
|
38
|
-
command = 'bundle install --jobs 4 --path . --gemfile lib/vendor/Gemfile'
|
38
|
+
command = 'bundle install --jobs 4 --frozen --path . --gemfile lib/vendor/Gemfile'
|
39
39
|
command << %( --without #{@without_groups.join(' ')}) if @without_groups.any?
|
40
40
|
command
|
41
41
|
end
|
@@ -46,6 +46,7 @@ module Tara
|
|
46
46
|
copy_gem_files(vendor_path)
|
47
47
|
Dir.chdir(@package_dir) do
|
48
48
|
Bundler.with_clean_env do
|
49
|
+
copy_local_gems
|
49
50
|
@shell.exec_with_env(bundler_command, @bundle_env)
|
50
51
|
if @build_command
|
51
52
|
@shell.exec_with_env(@build_command, @bundle_env)
|
@@ -63,6 +64,41 @@ module Tara
|
|
63
64
|
end
|
64
65
|
end
|
65
66
|
|
67
|
+
def find_installed_gems
|
68
|
+
definition = Bundler::Definition.build('lib/vendor/Gemfile', 'lib/vendor/Gemfile.lock', false)
|
69
|
+
return [] unless definition.has_optional_groups?
|
70
|
+
@without_groups.each do |group|
|
71
|
+
definition.add_optional_group(group)
|
72
|
+
end
|
73
|
+
definition.specs.each_with_object([]) do |gem_spec, specs|
|
74
|
+
if gem_spec.full_gem_path.start_with?(Bundler.bundle_path.to_s) # Local gem
|
75
|
+
specs << {
|
76
|
+
:full_gem_path => gem_spec.full_gem_path,
|
77
|
+
:spec_file => gem_spec.spec_file,
|
78
|
+
:relative_path => Pathname.new(gem_spec.full_gem_path).relative_path_from(Bundler.bundle_path).to_s,
|
79
|
+
}
|
80
|
+
end
|
81
|
+
end
|
82
|
+
rescue Bundler::GemNotFound => e
|
83
|
+
[]
|
84
|
+
end
|
85
|
+
|
86
|
+
def copy_local_gems
|
87
|
+
local_gems = find_installed_gems
|
88
|
+
target_directory = File.join(@package_dir, 'lib/vendor', Bundler.ruby_scope)
|
89
|
+
|
90
|
+
spec_dir = File.join(target_directory, 'specifications')
|
91
|
+
FileUtils.mkdir_p(spec_dir)
|
92
|
+
FileUtils.mkdir_p(File.join(target_directory, 'bin'))
|
93
|
+
FileUtils.mkdir_p(File.join(target_directory, 'gems'))
|
94
|
+
FileUtils.mkdir_p(File.join(target_directory, 'bundler', 'gems'))
|
95
|
+
|
96
|
+
local_gems.each do |gemspec|
|
97
|
+
FileUtils.cp_r(gemspec[:full_gem_path], File.join(target_directory, gemspec[:relative_path]))
|
98
|
+
FileUtils.cp(gemspec[:spec_file], spec_dir) if File.exists?(gemspec[:spec_file])
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
66
102
|
def extract_ruby
|
67
103
|
FileUtils.mkdir_p(ruby_path)
|
68
104
|
FileUtils.mkdir_p(ruby_vendor_path)
|
data/lib/tara/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathias Söderberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Tara packs your Ruby app into a standalone archive with gems and a Ruby
|
14
14
|
runtime
|
@@ -20,6 +20,7 @@ extensions: []
|
|
20
20
|
extra_rdoc_files: []
|
21
21
|
files:
|
22
22
|
- bin/tara
|
23
|
+
- lib/ext/bundler.rb
|
23
24
|
- lib/tara.rb
|
24
25
|
- lib/tara/archive.rb
|
25
26
|
- lib/tara/archiver.rb
|
@@ -49,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
50
|
version: '0'
|
50
51
|
requirements: []
|
51
52
|
rubyforge_project:
|
52
|
-
rubygems_version: 2.4.
|
53
|
+
rubygems_version: 2.4.8
|
53
54
|
signing_key:
|
54
55
|
specification_version: 4
|
55
56
|
summary: Packs your Ruby app as a standalone archive
|