rb2exe 0.1.47 → 0.1.49
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/README.md +15 -5
- data/bin/build +2 -1
- data/bin/rb2exe +23 -17
- data/bin/traveling-ruby-2.2.2/test-rake +1 -0
- data/lib/rb2exe/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 228617d28fb7b751b1200c5e088b80c4714b2c49
|
4
|
+
data.tar.gz: e27c3823553721eb252c9b1d1881cab4e646b6cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce2c78c045c2aa6e90b897496fbe522bee0c2b28c1e1690b65e484514bedea1ce26041588ce0602892e07a58b14ec2bdf995d4901e935694618cfd0e230586b5
|
7
|
+
data.tar.gz: addd64f8fdfe721ad63e86fc313d8f989c795c523a15d088a57fc4035c9c3d427cad5f877da5dfbf46404ccb0deaef3f8fb3c86f0c136420767fc2dd6bf29bb4
|
data/README.md
CHANGED
@@ -11,8 +11,7 @@ gem install rb2exe
|
|
11
11
|
## Usage
|
12
12
|
|
13
13
|
```bash
|
14
|
-
rb2exe
|
15
|
-
rb2exe . test.rb test.sh
|
14
|
+
rb2exe script.rb <optional folder to include> <optional output filename>
|
16
15
|
```
|
17
16
|
|
18
17
|
## Usage Example:
|
@@ -20,10 +19,18 @@ rb2exe . test.rb test.sh
|
|
20
19
|
mkdir test
|
21
20
|
cd test
|
22
21
|
echo "puts 'Hello world'" > test.rb
|
23
|
-
rb2exe
|
24
|
-
./test
|
22
|
+
rb2exe test.rb
|
23
|
+
./test
|
25
24
|
```
|
26
25
|
|
26
|
+
## Security
|
27
|
+
|
28
|
+
rb2exe DOESN'T protects your source code.
|
29
|
+
|
30
|
+
In fact, the produced executable file contains all your source files and THEY CAN BE EASILY EXTRACTED.
|
31
|
+
|
32
|
+
rb2exe just packages your source files (plus a stand-alone ruby) in an auto-extract zip file. It doesn't protects your code in any way.
|
33
|
+
|
27
34
|
## Contributing
|
28
35
|
|
29
36
|
Bug reports and pull requests are welcome on GitHub at https://github.com/loureirorg/rb2exe.
|
@@ -31,4 +38,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/lourei
|
|
31
38
|
## TODO
|
32
39
|
|
33
40
|
* Allow ruby versions other than 2.2.2;
|
34
|
-
*
|
41
|
+
* Rails support;
|
42
|
+
* Gemfile support;
|
43
|
+
* Windows / OSX executable output;
|
44
|
+
* Testing suite;
|
data/bin/build
CHANGED
data/bin/rb2exe
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# Usage:
|
4
|
-
# rb2exe <app
|
5
|
-
# Eg: rb2exe
|
4
|
+
# rb2exe <app main file> <optional app directory> <optional output filename>
|
5
|
+
# Eg: rb2exe test.rb . exe_output
|
6
6
|
#
|
7
|
-
# WARNING: the entire <app directory> will be packed
|
8
7
|
require "tmpdir"
|
9
8
|
|
10
9
|
def blank?(arg)
|
@@ -14,24 +13,25 @@ end
|
|
14
13
|
# Gem path
|
15
14
|
gem_dir = File.expand_path(File.dirname(__FILE__) + "/..")
|
16
15
|
|
16
|
+
# Main ruby app (filename)
|
17
|
+
main_app_path = ARGV[0]
|
18
|
+
abort("You need to specify a ruby file.") if blank?(main_app_path)
|
19
|
+
abort("#{ARGV[0]} doesn't exist.") if ! File.exists?(ARGV[0])
|
20
|
+
|
17
21
|
# App directory
|
18
22
|
pwd = Dir.pwd
|
19
|
-
|
20
|
-
app_dir =
|
21
|
-
if ! Dir.exists?(app_dir)
|
22
|
-
abort "Directory #{app_dir} doesn't exist."
|
23
|
+
if blank?(ARGV[1])
|
24
|
+
app_dir = nil
|
23
25
|
else
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
# Main ruby app (filename)
|
28
|
-
main_app_path = ARGV[1]
|
29
|
-
if blank?(main_app_path)
|
30
|
-
abort("You need to specify a ruby file.")
|
26
|
+
app_dir = File.expand_path(ARGV[1])
|
27
|
+
abort "Directory #{app_dir} doesn't exist." if ! Dir.exists?(app_dir)
|
31
28
|
end
|
32
29
|
|
33
30
|
# Executable filename
|
34
|
-
|
31
|
+
# If not specified, uses the main app filename without its extension. Eg.:
|
32
|
+
# script.rb -> script
|
33
|
+
exe_fn = blank?(ARGV[2]) ? File.basename(ARGV[0], File.extname(ARGV[0])) : ARGV[2]
|
34
|
+
abort("Can't use '#{exe_fn}' as a filename (there's a folder with this name).") if Dir.exists?("#{pwd}/#{exe_fn}")
|
35
35
|
|
36
36
|
# Ruby version should be 2.2.2, 64 bits:
|
37
37
|
version = `echo $RUBY_VERSION`.strip
|
@@ -44,11 +44,17 @@ result = "Error"
|
|
44
44
|
Dir.mktmpdir do |tmp_dir|
|
45
45
|
FileUtils.mkdir_p("#{tmp_dir}/payload/lib")
|
46
46
|
FileUtils.cp_r("#{gem_dir}/bin/traveling-ruby-2.2.2", "#{tmp_dir}/payload/lib/ruby") # Copy ruby traveler 2.2.2 on "payload/lib/ruby"
|
47
|
-
|
47
|
+
# Move the "app" folder to "payload/lib"
|
48
|
+
if app_dir.nil?
|
49
|
+
FileUtils.mkdir_p("#{tmp_dir}/payload/lib/app/")
|
50
|
+
FileUtils.cp_r(main_app_path, "#{tmp_dir}/payload/lib/app/")
|
51
|
+
else
|
52
|
+
FileUtils.cp_r(app_dir, "#{tmp_dir}/payload/lib/app")
|
53
|
+
end
|
48
54
|
FileUtils.cp_r("#{gem_dir}/bin/installer", "#{tmp_dir}/payload/") # Create a wrapper script (name it as "installer")
|
49
55
|
FileUtils.cp_r("#{gem_dir}/bin/build", "#{tmp_dir}/") # Package builder
|
50
56
|
FileUtils.cp_r("#{gem_dir}/bin/decompress", "#{tmp_dir}/")
|
51
57
|
result = `#{tmp_dir}/build #{tmp_dir} #{main_app_path} #{exe_fn}`
|
52
|
-
FileUtils.mv("#{tmp_dir}/output",
|
58
|
+
FileUtils.mv("#{tmp_dir}/output", "#{pwd}/#{exe_fn}") # Output
|
53
59
|
end
|
54
60
|
print result
|
@@ -0,0 +1 @@
|
|
1
|
+
/home/daniel/projects/test-rake
|
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.49
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Loureiro
|
@@ -1049,6 +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
|
+
- bin/traveling-ruby-2.2.2/test-rake
|
1052
1053
|
- lib/rb2exe.rb
|
1053
1054
|
- lib/rb2exe/version.rb
|
1054
1055
|
- rb2exe.gemspec
|
@@ -1071,7 +1072,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1071
1072
|
version: '0'
|
1072
1073
|
requirements: []
|
1073
1074
|
rubyforge_project:
|
1074
|
-
rubygems_version: 2.
|
1075
|
+
rubygems_version: 2.5.1
|
1075
1076
|
signing_key:
|
1076
1077
|
specification_version: 4
|
1077
1078
|
summary: Ruby to Executable
|