tara 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tara.rb +1 -1
- data/lib/tara/archive.rb +6 -6
- data/lib/tara/installer.rb +18 -10
- data/lib/tara/{executable.rb → shim.rb} +1 -1
- data/lib/tara/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8becc22fc23dec6323164fa640d18e062cd7b7f3
|
4
|
+
data.tar.gz: ddd7ae48b1cfab03a864384e8e617889cba48671
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e86a0fddd03a6afa670d3eddeebcffcda3f52149020c81890f641c14261e7bc0371c94b5a290d5691801ab41df7335f98d93f3d1c126948a679a219173744b4
|
7
|
+
data.tar.gz: 6492aa2bf1fe0bbb33fb14566db8c7d0bf1aff66aa943acfcd6a3c48f7b2664849fa09d4fba77b60a0e14120df54081703c428260b84de845144ee7ad55f9bbb
|
data/lib/tara.rb
CHANGED
data/lib/tara/archive.rb
CHANGED
@@ -112,7 +112,7 @@ module Tara
|
|
112
112
|
copy_file(project_dir, package_dir, executable)
|
113
113
|
FileUtils.chmod(0755, package_dir.join(executable))
|
114
114
|
relative_executable = executable.relative_path_from(project_dir)
|
115
|
-
|
115
|
+
create_shim(package_dir, relative_executable)
|
116
116
|
end
|
117
117
|
end
|
118
118
|
end
|
@@ -144,11 +144,11 @@ module Tara
|
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
147
|
-
def
|
148
|
-
|
149
|
-
|
150
|
-
File.open(
|
151
|
-
FileUtils.chmod(0755,
|
147
|
+
def create_shim(package_dir, executable)
|
148
|
+
shim_path = package_dir.join(executable.basename)
|
149
|
+
shim = Shim.new(*executable.split)
|
150
|
+
File.open(shim_path, 'w') { |f| shim.write(f) }
|
151
|
+
FileUtils.chmod(0755, shim_path)
|
152
152
|
end
|
153
153
|
end
|
154
154
|
end
|
data/lib/tara/installer.rb
CHANGED
@@ -47,9 +47,9 @@ module Tara
|
|
47
47
|
Dir['vendor/ruby/*/extensions/*'].each do |ext_file|
|
48
48
|
FileUtils.rm_rf(ext_file)
|
49
49
|
end
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
%w[o so bundle].each do |ext|
|
51
|
+
find_and_remove_files('vendor/ruby/*/gems', %(*.#{ext}))
|
52
|
+
end
|
53
53
|
FileUtils.cp_r('vendor', lib_path, preserve: true)
|
54
54
|
end
|
55
55
|
end
|
@@ -107,20 +107,20 @@ module Tara
|
|
107
107
|
|
108
108
|
def strip_leftovers
|
109
109
|
%w[c cpp h rl].each do |ext|
|
110
|
-
|
110
|
+
find_and_remove_files(ruby_vendor_path, %(*.#{ext}))
|
111
111
|
end
|
112
|
-
|
113
|
-
|
114
|
-
|
112
|
+
find_and_remove_files(ruby_vendor_path, 'extconf.rb')
|
113
|
+
find_and_remove_files(vendor_gems_glob.join('*', 'ext'), 'Makefile')
|
114
|
+
find_and_remove_directories(vendor_gems_glob.join('*', 'ext'), 'tmp')
|
115
115
|
end
|
116
116
|
|
117
117
|
def strip_java_files
|
118
|
-
|
118
|
+
find_and_remove_files(vendor_gems_glob, '*.java')
|
119
119
|
end
|
120
120
|
|
121
121
|
def strip_git_files
|
122
|
-
|
123
|
-
|
122
|
+
find_and_remove_directories(vendor_gems_glob, '.git')
|
123
|
+
find_and_remove_directories(bundler_gems_glob, '.git')
|
124
124
|
end
|
125
125
|
|
126
126
|
def strip_from_gems(things)
|
@@ -130,6 +130,14 @@ module Tara
|
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
133
|
+
def find_and_remove_files(dir, glob)
|
134
|
+
@shell.exec(%(find #{dir} -name "#{glob}" -type f -exec rm -f "{}" \\; 2> /dev/null || true))
|
135
|
+
end
|
136
|
+
|
137
|
+
def find_and_remove_directories(dir, glob)
|
138
|
+
@shell.exec(%(find #{dir} -name "#{glob}" -type d -exec rm -rf "{}" \\; 2> /dev/null || true))
|
139
|
+
end
|
140
|
+
|
133
141
|
def lib_path
|
134
142
|
@lib_path ||= Pathname.new(@package_dir).join('lib')
|
135
143
|
end
|
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.3.
|
4
|
+
version: 0.3.1
|
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: 2015-
|
11
|
+
date: 2015-07-25 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
|
@@ -24,10 +24,10 @@ files:
|
|
24
24
|
- lib/tara/archive.rb
|
25
25
|
- lib/tara/archiver.rb
|
26
26
|
- lib/tara/cli.rb
|
27
|
-
- lib/tara/executable.rb
|
28
27
|
- lib/tara/fetcher.rb
|
29
28
|
- lib/tara/installer.rb
|
30
29
|
- lib/tara/shell.rb
|
30
|
+
- lib/tara/shim.rb
|
31
31
|
- lib/tara/version.rb
|
32
32
|
homepage: http://github.com/mthssdrbrg/tara
|
33
33
|
licenses:
|