rb2exe 0.1.52 → 0.1.53
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/bin/rb2exe +27 -1
- data/lib/bundler-config +3 -0
- data/lib/rb2exe/version.rb +1 -1
- metadata +2 -2
- data/bin/traveling-ruby-2.2.2/test-rake +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7514934e6aafcd94c546bed5e4c2f07015f492e3
|
4
|
+
data.tar.gz: 44af662d5e97fe0ec0c7de279e77d9aaaecb9d98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea357fdff2778172d5730784555509f1af7b2c28548eb237a5278675991817ca682e8948960de09a863125cfae67dd98ba65b4cb7a829a3869bc22aae0733617
|
7
|
+
data.tar.gz: 9a7e3ad2595eec5f11a9833ac412f913a7bcf0d5f09dc1c435f2cd49c50d8582b56fc723dacc1edd70a67a2801cd8c92566ec0eaac509e886ad387005dc6d4b7
|
data/README.md
CHANGED
@@ -39,6 +39,19 @@ rb2exe main.rb --add .
|
|
39
39
|
./main
|
40
40
|
```
|
41
41
|
|
42
|
+
## Example III - Gemfile support
|
43
|
+
```bash
|
44
|
+
mkdir test
|
45
|
+
cd test
|
46
|
+
echo "source 'https://rubygems.org'" > Gemfile
|
47
|
+
echo "gem 'faker'" >> Gemfile
|
48
|
+
echo "require 'faker'" > a.rb
|
49
|
+
echo 'puts "Hello #{Faker::Name.name}"' >> a.rb
|
50
|
+
|
51
|
+
rb2exe a.rb --add .
|
52
|
+
./a
|
53
|
+
```
|
54
|
+
|
42
55
|
|
43
56
|
## Security
|
44
57
|
|
data/bin/rb2exe
CHANGED
@@ -62,7 +62,10 @@ end
|
|
62
62
|
result = "Error"
|
63
63
|
Dir.mktmpdir do |tmp_dir|
|
64
64
|
FileUtils.mkdir_p("#{tmp_dir}/payload/lib")
|
65
|
-
|
65
|
+
|
66
|
+
# Copy ruby traveler 2.2.2 to "payload/lib/ruby"
|
67
|
+
FileUtils.cp_r("#{gem_dir}/bin/traveling-ruby-2.2.2", "#{tmp_dir}/payload/lib/ruby")
|
68
|
+
|
66
69
|
# Move the "app" folder to "payload/lib"
|
67
70
|
if app_dir.nil?
|
68
71
|
FileUtils.mkdir_p("#{tmp_dir}/payload/lib/app/")
|
@@ -71,6 +74,29 @@ Dir.mktmpdir do |tmp_dir|
|
|
71
74
|
FileUtils.cp_r(app_dir, "#{tmp_dir}/payload/lib/app")
|
72
75
|
end
|
73
76
|
FileUtils.cp_r("#{gem_dir}/bin/installer", "#{tmp_dir}/payload/") # Create a wrapper script (name it as "installer")
|
77
|
+
|
78
|
+
# Gemfile support
|
79
|
+
puts "#{tmp_dir}/payload/lib/app/Gemfile"
|
80
|
+
if File.exists?("#{tmp_dir}/payload/lib/app/Gemfile")
|
81
|
+
puts "Gemfile detected. Loading gems." unless options[:quiet]
|
82
|
+
FileUtils.mkdir_p("#{tmp_dir}/payload/lib/tmp") # Create a "tmp" folder on ".package/payload/lib"
|
83
|
+
FileUtils.cp("#{tmp_dir}/payload/lib/app/Gemfile", "#{tmp_dir}/payload/lib/tmp/") # Copy the project Gemfile to tmp
|
84
|
+
FileUtils.cp("#{tmp_dir}/payload/lib/app/Gemfile.lock", "#{tmp_dir}/payload/lib/tmp/")
|
85
|
+
# Download gems into the "lib/vendor" folder
|
86
|
+
Bundler.with_clean_env do
|
87
|
+
Dir.chdir("#{tmp_dir}/payload/lib/app") do
|
88
|
+
`bundle install --path #{tmp_dir}/payload/lib/vendor --without development`
|
89
|
+
end
|
90
|
+
end
|
91
|
+
FileUtils.rm_rf("#{tmp_dir}/payload/lib/tmp/") # Delete tmp folder
|
92
|
+
%x[cd #{tmp_dir}/payload/lib/ && rm -f vendor/*/*/cache/*] # Delete gem's cache in the vendor folder
|
93
|
+
FileUtils.cp("#{tmp_dir}/payload/lib/app/Gemfile", "#{tmp_dir}/payload/lib/vendor/") # Copy the Gemfile to the vendor folder
|
94
|
+
FileUtils.cp("#{tmp_dir}/payload/lib/app/Gemfile.lock", "#{tmp_dir}/payload/lib/vendor/")
|
95
|
+
# Create a bundler config
|
96
|
+
FileUtils.mkdir_p("#{tmp_dir}/payload/lib/vendor/.bundle")
|
97
|
+
FileUtils.cp("#{gem_dir}/lib/bundler-config", "#{tmp_dir}/payload/lib/vendor/.bundle/config")
|
98
|
+
end
|
99
|
+
|
74
100
|
FileUtils.cp_r("#{gem_dir}/bin/build", "#{tmp_dir}/") # Package builder
|
75
101
|
FileUtils.cp_r("#{gem_dir}/bin/decompress", "#{tmp_dir}/")
|
76
102
|
result = `#{tmp_dir}/build #{tmp_dir} #{main_app_path} #{exe_fn} #{options[:quiet]}`
|
data/lib/bundler-config
ADDED
data/lib/rb2exe/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rb2exe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.53
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Loureiro
|
@@ -1049,7 +1049,7 @@ files:
|
|
1049
1049
|
- bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/specifications/default/psych-2.0.8.gemspec
|
1050
1050
|
- bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/specifications/default/rake-10.4.2.gemspec
|
1051
1051
|
- bin/traveling-ruby-2.2.2/lib/ruby/gems/2.2.0/specifications/default/rdoc-4.2.0.gemspec
|
1052
|
-
-
|
1052
|
+
- lib/bundler-config
|
1053
1053
|
- lib/rb2exe.rb
|
1054
1054
|
- lib/rb2exe/version.rb
|
1055
1055
|
- rb2exe.gemspec
|
@@ -1 +0,0 @@
|
|
1
|
-
/home/daniel/projects/test-rake
|