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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b4fc1bca82401591c908c635fbf9dbe8da7d2d10
4
- data.tar.gz: 7b7f4b3cffdfd06722ce09727c3ca341c9758dff
2
+ SHA256:
3
+ metadata.gz: 3e6b3810dbdd1f71bcbbc2bc8d3b72646cac1bc11847f00cfa3c22f2aeb970c2
4
+ data.tar.gz: 1f39d656d994be7edcdefb8c9b755dcea170577dcd7fd8ce84880696ddd0af6c
5
5
  SHA512:
6
- metadata.gz: 9e6908177c8f64865b7a7ee47f945abaa3632e563f88c23153814bb6a0498df3c07b682b31a9bdb79977e8a9d8979f7332fcf8c722c99e499a0b6121be27b903
7
- data.tar.gz: 2b331b231022fe4a97a05e14761b598cba753b5f8032cf5d5880d45fa489d46358873a53d567f9fd22a2fa33b64d11d34329c1f45c36523fc5d4f4102260367a
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 copy;
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 "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
2
2
 
3
- task :default => :spec
3
+ task default: :spec
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "rb2exe"
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 "irb"
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 "../lib/rb2exe/version.rb"
7
- require "tmpdir"
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
- "#{arg}".strip == ""
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 = "Usage: rb2exe RUBY_SCRIPT [options]"
27
+ opts.banner = 'Usage: rb2exe RUBY_SCRIPT [options]'
29
28
  opts.version = Rb2exe::VERSION
30
29
 
31
- opts.on("-q", "--quiet", "Do not run verbosely") { |v| options[:quiet] = v }
32
- opts.on("-a", "--add=FOLDER", "Add an entire folder (eg. \".\")") { |v| options[:add] = v }
33
- opts.on("-i", "--ignore-folder=FOLDER", "Do not add a folder") { |v| options[:ignore_folder] = v }
34
- opts.on("-ao", "--add-output", "Do not ignore output file when adding files") { |v| options[:add_output] = v }
35
- opts.on("-o", "--output=OUTPUT", "Output executable filename") { |v| options[:output] = v }
36
- opts.on("-r", "--rails", "Rails support") { |v| options[:rails] = v }
37
- opts.on("-d", "--daemon", "Runs the app as a background task") { |v| options[:daemon] = v }
38
- opts.on("-t", "--target=[osx|l32|l64|win]", "Target platform (binary)") { |v| options[:target] = v }
39
- opts.on("-h","--help", "Help") { puts opt_parser }
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("#{opt_parser}") if ! options[:rails] && blank?(main_app_path)
49
- abort("#{ARGV[0]} doesn't exist.") if ! options[:rails] && ! File.exists?(ARGV[0])
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." if ! Dir.exists?(app_dir)
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 = "output"
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.exists?("#{pwd}/#{exe_fn}")
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 = `echo $RUBY_VERSION`.strip
76
- if version != "ruby-2.2.2"
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 = "Error"
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
- when "l64" then "#{gem_dir}/bin/traveling-ruby-2.2.2/l64"
88
- when "l32" then "#{gem_dir}/bin/traveling-ruby-2.2.2/l32"
89
- when "osx" then "#{gem_dir}/bin/traveling-ruby-2.2.2/osx"
90
- when "win" then "#{gem_dir}/bin/traveling-ruby-2.2.2/win"
91
- else abort("Unknow platform (#{options[:target]})")
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.exists?("#{tmp_dir}/payload/lib/app/Gemfile")
106
- puts "Gemfile detected. Loading gems." unless options[:quiet]
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.exists?("#{tmp_dir}/payload/lib/app/Gemfile.lock")
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
- %x[cd #{tmp_dir}/payload/lib/ && rm -f vendor/*/*/cache/*] # Delete gem's cache in the vendor folder
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.exists?("#{tmp_dir}/payload/lib/app/Gemfile.lock")
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
- if ! options[:add_output]
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
@@ -1,5 +1,4 @@
1
- require "rb2exe/version"
1
+ require 'rb2exe/version'
2
2
 
3
3
  module Rb2exe
4
-
5
4
  end
@@ -1,3 +1,3 @@
1
1
  module Rb2exe
2
- VERSION = "0.3.0"
2
+ VERSION = '0.3.1'.freeze
3
3
  end
@@ -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 = "rb2exe"
8
+ spec.name = 'rb2exe'
8
9
  spec.version = Rb2exe::VERSION
9
- spec.authors = ["Daniel Loureiro"]
10
- spec.email = ["loureirorg@gmail.com"]
10
+ spec.authors = ['Daniel Loureiro']
11
+ spec.email = ['loureirorg@gmail.com']
11
12
  spec.licenses = ['CC0-1.0']
12
13
 
13
- spec.summary = %q{Ruby to Executable}
14
- spec.description = %q{Ruby to EXE - Turn ruby scripts into portable executable apps.}
15
- spec.homepage = "http://www.learnwithdaniel.com/2016/08/ruby-to-portable-exe-app/"
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 = "bin"
19
+ spec.bindir = 'bin'
19
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
- spec.require_paths = ["lib"]
21
+ spec.require_paths = ['lib']
21
22
  spec.executables << 'rb2exe'
22
23
 
23
- spec.add_development_dependency "bundler", "~> 1.12"
24
- spec.add_development_dependency "rake", "~> 10.0"
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.0
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: 2017-04-26 00:00:00.000000000 Z
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.5.1
4081
+ rubygems_version: 2.7.6
4082
4082
  signing_key:
4083
4083
  specification_version: 4
4084
4084
  summary: Ruby to Executable