rb2exe 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/Rakefile +2 -2
- data/bin/console +3 -3
- data/bin/rb2exe +36 -34
- data/bin/traveling-ruby-2.2.2/osx/lib/libcrypto.dylib +1 -1
- data/bin/traveling-ruby-2.2.2/osx/lib/libedit.dylib +1 -1
- data/bin/traveling-ruby-2.2.2/osx/lib/libffi.dylib +1 -1
- data/bin/traveling-ruby-2.2.2/osx/lib/libgmp.dylib +1 -1
- data/bin/traveling-ruby-2.2.2/osx/lib/liblzma.dylib +1 -1
- data/bin/traveling-ruby-2.2.2/osx/lib/libncurses.dylib +1 -1
- data/bin/traveling-ruby-2.2.2/osx/lib/libreadline.dylib +1 -1
- data/bin/traveling-ruby-2.2.2/osx/lib/libssl.dylib +1 -1
- data/bin/traveling-ruby-2.2.2/osx/lib/libtermcap.dylib +1 -1
- data/bin/traveling-ruby-2.2.2/osx/lib/libyaml.dylib +1 -1
- data/lib/rb2exe.rb +1 -2
- data/lib/rb2exe/version.rb +1 -1
- data/rb2exe.gemspec +11 -10
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3e6b3810dbdd1f71bcbbc2bc8d3b72646cac1bc11847f00cfa3c22f2aeb970c2
|
4
|
+
data.tar.gz: 1f39d656d994be7edcdefb8c9b755dcea170577dcd7fd8ce84880696ddd0af6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25837c672d9826da76828515b65ace96ed436b0dc89e2800445a6d4dae3bcb10ae31bdabad27d1f54efe67cbeaebafd1f4b7f72039a2878e556be836c3ed09e6
|
7
|
+
data.tar.gz: b4b9f7f7cec2b704710fc02284ac9acd7f86538ff8ba2a5f5ca73aaff508c0982f560314ee37ee5d55d09f776c2539128540feb41cd53467b1419dc8d1495996
|
data/README.md
CHANGED
@@ -101,7 +101,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/lourei
|
|
101
101
|
|
102
102
|
|
103
103
|
# Changelog
|
104
|
-
* 0.3.0: Includes a libruby.so.2.2 file
|
104
|
+
* 0.3.0: Includes a copy of the libruby.so.2.2 file;
|
105
105
|
* 0.2.5: Ignore output file when adding files. Add "--add-output" option;
|
106
106
|
* 0.2.4: Ignore '.git' folder by default. Add "--ignore-folder" option;
|
107
107
|
* 0.2.3: add "--daemon" option;
|
data/Rakefile
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
2
|
|
3
|
-
task :
|
3
|
+
task default: :spec
|
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'rb2exe'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require "rb2exe"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start
|
data/bin/rb2exe
CHANGED
@@ -3,16 +3,15 @@
|
|
3
3
|
# Usage:
|
4
4
|
# rb2exe script.rb [OPTIONS]
|
5
5
|
#
|
6
|
-
require_relative
|
7
|
-
require
|
6
|
+
require_relative '../lib/rb2exe/version.rb'
|
7
|
+
require 'tmpdir'
|
8
8
|
require 'optparse'
|
9
9
|
require 'bundler'
|
10
10
|
|
11
11
|
def blank?(arg)
|
12
|
-
|
12
|
+
arg.to_s.strip == ''
|
13
13
|
end
|
14
14
|
|
15
|
-
|
16
15
|
# Arguments
|
17
16
|
options = {
|
18
17
|
quiet: false,
|
@@ -25,28 +24,31 @@ options = {
|
|
25
24
|
target: 'l64'
|
26
25
|
}
|
27
26
|
opt_parser = OptionParser.new do |opts|
|
28
|
-
opts.banner =
|
27
|
+
opts.banner = 'Usage: rb2exe RUBY_SCRIPT [options]'
|
29
28
|
opts.version = Rb2exe::VERSION
|
30
29
|
|
31
|
-
opts.on(
|
32
|
-
opts.on(
|
33
|
-
opts.on(
|
34
|
-
opts.on(
|
35
|
-
opts.on(
|
36
|
-
opts.on(
|
37
|
-
opts.on(
|
38
|
-
opts.on(
|
39
|
-
opts.on(
|
30
|
+
opts.on('-q', '--quiet', 'Do not run verbosely') { |v| options[:quiet] = v }
|
31
|
+
opts.on('-a', '--add=FOLDER', 'Add an entire folder (eg. ".")') { |v| options[:add] = v }
|
32
|
+
opts.on('-i', '--ignore-folder=FOLDER', 'Do not add a folder') { |v| options[:ignore_folder] = v }
|
33
|
+
opts.on('-ao', '--add-output', 'Do not ignore output file when adding files') { |v| options[:add_output] = v }
|
34
|
+
opts.on('-o', '--output=OUTPUT', 'Output executable filename') { |v| options[:output] = v }
|
35
|
+
opts.on('-r', '--rails', 'Rails support') { |v| options[:rails] = v }
|
36
|
+
opts.on('-d', '--daemon', 'Runs the app as a background task') { |v| options[:daemon] = v }
|
37
|
+
opts.on('-t', '--target=[osx|l32|l64|win]', 'Target platform (binary)') { |v| options[:target] = v }
|
38
|
+
opts.on('-h', '--help', 'Help') do
|
39
|
+
puts opt_parser
|
40
|
+
exit
|
41
|
+
end
|
40
42
|
end
|
41
43
|
opt_parser.parse!
|
42
44
|
|
43
45
|
# Gem path
|
44
|
-
gem_dir = File.expand_path(File.dirname(__FILE__) +
|
46
|
+
gem_dir = File.expand_path(File.dirname(__FILE__) + '/..')
|
45
47
|
|
46
48
|
# Main ruby app (filename)
|
47
49
|
main_app_path = ARGV[0]
|
48
|
-
abort(
|
49
|
-
abort("#{ARGV[0]} doesn't exist.") if !
|
50
|
+
abort(opt_parser.to_s) if !options[:rails] && blank?(main_app_path)
|
51
|
+
abort("#{ARGV[0]} doesn't exist.") if !options[:rails] && !File.exist?(ARGV[0])
|
50
52
|
|
51
53
|
# App directory
|
52
54
|
pwd = Dir.pwd
|
@@ -57,7 +59,7 @@ else
|
|
57
59
|
app_dir = nil
|
58
60
|
else
|
59
61
|
app_dir = File.expand_path(options[:add])
|
60
|
-
abort "Directory #{app_dir} doesn't exist."
|
62
|
+
abort "Directory #{app_dir} doesn't exist." unless Dir.exist?(app_dir)
|
61
63
|
end
|
62
64
|
end
|
63
65
|
|
@@ -65,30 +67,30 @@ end
|
|
65
67
|
# If not specified, uses the main app filename without its extension. Eg.:
|
66
68
|
# script.rb -> script
|
67
69
|
if blank?(options[:output]) && options[:rails]
|
68
|
-
exe_fn =
|
70
|
+
exe_fn = 'output'
|
69
71
|
else
|
70
72
|
exe_fn = blank?(options[:output]) ? File.basename(ARGV[0], File.extname(ARGV[0])) : options[:output]
|
71
|
-
abort("Can't use '#{exe_fn}' as a filename (there's a folder with this name).") if Dir.
|
73
|
+
abort("Can't use '#{exe_fn}' as a filename (there's a folder with this name).") if Dir.exist?("#{pwd}/#{exe_fn}")
|
72
74
|
end
|
73
75
|
|
74
76
|
# Ruby version should be 2.2.2, 64 bits:
|
75
|
-
version =
|
76
|
-
if version !=
|
77
|
+
version = RUBY_VERSION.strip
|
78
|
+
if version != '2.2.2'
|
77
79
|
abort "Your ruby version should be EXACTLY 2.2.2, not higher, not lower (your is #{version})."
|
78
80
|
end
|
79
81
|
|
80
82
|
# Temporary directory
|
81
|
-
result =
|
83
|
+
result = 'Error'
|
82
84
|
Dir.mktmpdir do |tmp_dir|
|
83
85
|
FileUtils.mkdir_p("#{tmp_dir}/payload/lib")
|
84
86
|
|
85
87
|
# Copy ruby traveler 2.2.2 to "payload/lib/ruby"
|
86
88
|
ruby_src = case options[:target]
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
89
|
+
when 'l64' then "#{gem_dir}/bin/traveling-ruby-2.2.2/l64"
|
90
|
+
when 'l32' then "#{gem_dir}/bin/traveling-ruby-2.2.2/l32"
|
91
|
+
when 'osx' then "#{gem_dir}/bin/traveling-ruby-2.2.2/osx"
|
92
|
+
when 'win' then "#{gem_dir}/bin/traveling-ruby-2.2.2/win"
|
93
|
+
else abort("Unknow platform (#{options[:target]})")
|
92
94
|
end
|
93
95
|
FileUtils.cp_r(ruby_src, "#{tmp_dir}/payload/lib/ruby")
|
94
96
|
|
@@ -102,11 +104,11 @@ Dir.mktmpdir do |tmp_dir|
|
|
102
104
|
FileUtils.cp_r("#{gem_dir}/bin/installer", "#{tmp_dir}/payload/") # Create a wrapper script (name is "installer")
|
103
105
|
|
104
106
|
# Gemfile support
|
105
|
-
if File.
|
106
|
-
puts
|
107
|
+
if File.exist?("#{tmp_dir}/payload/lib/app/Gemfile")
|
108
|
+
puts 'Gemfile detected. Loading gems.' unless options[:quiet]
|
107
109
|
FileUtils.mkdir_p("#{tmp_dir}/payload/lib/tmp") # Create a "tmp" folder on ".package/payload/lib"
|
108
110
|
FileUtils.cp("#{tmp_dir}/payload/lib/app/Gemfile", "#{tmp_dir}/payload/lib/tmp/") # Copy the project Gemfile to tmp
|
109
|
-
FileUtils.cp("#{tmp_dir}/payload/lib/app/Gemfile.lock", "#{tmp_dir}/payload/lib/tmp/") if File.
|
111
|
+
FileUtils.cp("#{tmp_dir}/payload/lib/app/Gemfile.lock", "#{tmp_dir}/payload/lib/tmp/") if File.exist?("#{tmp_dir}/payload/lib/app/Gemfile.lock")
|
110
112
|
# Download gems into the "lib/vendor" folder
|
111
113
|
Bundler.with_clean_env do
|
112
114
|
Dir.chdir("#{tmp_dir}/payload/lib/app") do
|
@@ -114,9 +116,9 @@ Dir.mktmpdir do |tmp_dir|
|
|
114
116
|
end
|
115
117
|
end
|
116
118
|
FileUtils.rm_rf("#{tmp_dir}/payload/lib/tmp/") # Delete tmp folder
|
117
|
-
|
119
|
+
`cd #{tmp_dir}/payload/lib/ && rm -f vendor/*/*/cache/*` # Delete gem's cache in the vendor folder
|
118
120
|
FileUtils.cp("#{tmp_dir}/payload/lib/app/Gemfile", "#{tmp_dir}/payload/lib/vendor/") # Copy the Gemfile to the vendor folder
|
119
|
-
FileUtils.cp("#{tmp_dir}/payload/lib/app/Gemfile.lock", "#{tmp_dir}/payload/lib/vendor/") if File.
|
121
|
+
FileUtils.cp("#{tmp_dir}/payload/lib/app/Gemfile.lock", "#{tmp_dir}/payload/lib/vendor/") if File.exist?("#{tmp_dir}/payload/lib/app/Gemfile.lock")
|
120
122
|
# Create a bundler config
|
121
123
|
FileUtils.mkdir_p("#{tmp_dir}/payload/lib/vendor/.bundle")
|
122
124
|
FileUtils.cp("#{gem_dir}/lib/bundler-config", "#{tmp_dir}/payload/lib/vendor/.bundle/config")
|
@@ -129,7 +131,7 @@ Dir.mktmpdir do |tmp_dir|
|
|
129
131
|
end
|
130
132
|
|
131
133
|
# ignore output file when adding files
|
132
|
-
|
134
|
+
unless options[:add_output]
|
133
135
|
puts "Ignoring #{exe_fn}" unless options[:quiet]
|
134
136
|
FileUtils.rm_rf("#{tmp_dir}/payload/lib/app/#{exe_fn}")
|
135
137
|
end
|
@@ -1 +1 @@
|
|
1
|
-
libcrypto.1.0.0.dylib
|
1
|
+
bin/traveling-ruby-2.2.2/osx/lib/libcrypto.1.0.0.dylib
|
@@ -1 +1 @@
|
|
1
|
-
libedit.0.dylib
|
1
|
+
bin/traveling-ruby-2.2.2/osx/lib/libedit.0.dylib
|
@@ -1 +1 @@
|
|
1
|
-
libffi.6.dylib
|
1
|
+
bin/traveling-ruby-2.2.2/osx/lib/libffi.6.dylib
|
@@ -1 +1 @@
|
|
1
|
-
libgmp.10.dylib
|
1
|
+
bin/traveling-ruby-2.2.2/osx/lib/libgmp.10.dylib
|
@@ -1 +1 @@
|
|
1
|
-
liblzma.5.dylib
|
1
|
+
bin/traveling-ruby-2.2.2/osx/lib/liblzma.5.dylib
|
@@ -1 +1 @@
|
|
1
|
-
libncurses.5.dylib
|
1
|
+
bin/traveling-ruby-2.2.2/osx/lib/libncurses.5.dylib
|
@@ -1 +1 @@
|
|
1
|
-
libedit.0.dylib
|
1
|
+
bin/traveling-ruby-2.2.2/osx/lib/libedit.0.dylib
|
@@ -1 +1 @@
|
|
1
|
-
libssl.1.0.0.dylib
|
1
|
+
bin/traveling-ruby-2.2.2/osx/lib/libssl.1.0.0.dylib
|
@@ -1 +1 @@
|
|
1
|
-
libncurses.5.dylib
|
1
|
+
bin/traveling-ruby-2.2.2/osx/lib/libncurses.5.dylib
|
@@ -1 +1 @@
|
|
1
|
-
libyaml-0.2.dylib
|
1
|
+
bin/traveling-ruby-2.2.2/osx/lib/libyaml-0.2.dylib
|
data/lib/rb2exe.rb
CHANGED
data/lib/rb2exe/version.rb
CHANGED
data/rb2exe.gemspec
CHANGED
@@ -1,25 +1,26 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'rb2exe/version'
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
8
|
+
spec.name = 'rb2exe'
|
8
9
|
spec.version = Rb2exe::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
10
|
+
spec.authors = ['Daniel Loureiro']
|
11
|
+
spec.email = ['loureirorg@gmail.com']
|
11
12
|
spec.licenses = ['CC0-1.0']
|
12
13
|
|
13
|
-
spec.summary =
|
14
|
-
spec.description =
|
15
|
-
spec.homepage =
|
14
|
+
spec.summary = 'Ruby to Executable'
|
15
|
+
spec.description = 'Ruby to EXE - Turn ruby scripts into portable executable apps.'
|
16
|
+
spec.homepage = 'http://www.learnwithdaniel.com/2016/08/ruby-to-portable-exe-app/'
|
16
17
|
|
17
18
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
-
spec.bindir =
|
19
|
+
spec.bindir = 'bin'
|
19
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
-
spec.require_paths = [
|
21
|
+
spec.require_paths = ['lib']
|
21
22
|
spec.executables << 'rb2exe'
|
22
23
|
|
23
|
-
spec.add_development_dependency
|
24
|
-
spec.add_development_dependency
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.12'
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
25
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rb2exe
|
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
|
- Daniel Loureiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -4078,7 +4078,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
4078
4078
|
version: '0'
|
4079
4079
|
requirements: []
|
4080
4080
|
rubyforge_project:
|
4081
|
-
rubygems_version: 2.
|
4081
|
+
rubygems_version: 2.7.6
|
4082
4082
|
signing_key:
|
4083
4083
|
specification_version: 4
|
4084
4084
|
summary: Ruby to Executable
|