ocra 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,11 @@
1
+ === 1.1.3
2
+
3
+ * Use Win32API (provided with Ruby) instead of win32-api (gem).
4
+
5
+ * No longer sets GEM_HOME (which would override the default gem
6
+ path). Instead sets GEM_PATH. Resolves issues with gems not loading
7
+ on Ruby 1.9.
8
+
1
9
  === 1.1.2
2
10
 
3
11
  * Warnings can be disabled using --no-warnings.
data/Rakefile CHANGED
@@ -23,12 +23,13 @@ task :standalone => [ 'bin/ocrasa.rb' ]
23
23
  standalone_zip = "bin/ocrasa-#{ENV['VERSION']}.zip"
24
24
 
25
25
  file standalone_zip => 'bin/ocrasa.rb' do
26
- chdir('bin') do
27
- system("zip ocrasa-#{ENV['VERSION']}.zip ocrasa.rb")
26
+ chdir 'bin' do
27
+ system "zip ocrasa-#{ENV['VERSION']}.zip ocrasa.rb"
28
28
  end
29
29
  end
30
30
 
31
31
  task :release_standalone => standalone_zip do
32
+ load 'bin/ocra'
32
33
  sh "rubyforge add_release ocra ocra-standalone #{Ocra::VERSION} #{standalone_zip}"
33
34
  end
34
35
 
@@ -75,7 +76,7 @@ end
75
76
 
76
77
  def each_ruby_version
77
78
  raise "Set RUBIES to point to where you have various versions of Ruby installed" if ENV['RUBIES'].nil?
78
- root = ENV['RUBIES']
79
+ root = ENV['RUBIES'].tr '\\', '/'
79
80
  Dir.glob(File.join(root, 'ruby*','bin')).each do |path|
80
81
  path.tr!('/','\\')
81
82
  pathenv = ENV['PATH']
@@ -106,11 +107,19 @@ task :setup_all_ruby do
106
107
  end
107
108
  end
108
109
 
109
- task :test_all_ruby do
110
+ desc 'Run test suite with all version of Ruby found in ENV["RUBIES"]'
111
+ task :test_all_rubies do
110
112
  each_ruby_version do
111
113
  system("ruby -v")
112
114
  system("ruby test/test_ocra.rb")
113
115
  end
114
116
  end
115
117
 
118
+ desc 'List all version of Ruby found in ENV["RUBIES"]'
119
+ task :list_all_rubies do
120
+ each_ruby_version do
121
+ system "ruby -v"
122
+ end
123
+ end
124
+
116
125
  # vim: syntax=Ruby
data/bin/ocra CHANGED
@@ -10,7 +10,7 @@ module Ocra
10
10
  OP_DECOMPRESS_LZMA = 4
11
11
  OP_SETENV = 5
12
12
 
13
- VERSION = "1.1.2"
13
+ VERSION = "1.1.3"
14
14
 
15
15
  IGNORE_MODULES = /^enumerator.so$/
16
16
 
@@ -267,8 +267,12 @@ EOF
267
267
  if File.directory?(file)
268
268
  sb.ensuremkdir(File.join('src',file).tr('/','\\'))
269
269
  else
270
- path = File.join('src', file).tr('/','\\')
271
- sb.createfile(file, path)
270
+ if subpath?(file, exec_prefix)
271
+ target = file[exec_prefix.size+1..-1]
272
+ else
273
+ target = File.join('src', file).tr('/','\\')
274
+ end
275
+ sb.createfile(file, target)
272
276
  end
273
277
  end
274
278
 
@@ -319,7 +323,7 @@ EOF
319
323
  # Set environment variable
320
324
  sb.setenv('RUBYOPT', ENV['RUBYOPT'] || '')
321
325
  sb.setenv('RUBYLIB', load_path.uniq.join(';'))
322
- sb.setenv('GEM_HOME', "\xFF\\gemhome")
326
+ sb.setenv('GEM_PATH', "\xFF\\gemhome")
323
327
 
324
328
  # Launch the script
325
329
  sb.createprocess("bin\\" + rubyexe, "#{rubyexe} \"\xff\\src\\" + Ocra.files[0] + "\"")
@@ -331,19 +335,11 @@ EOF
331
335
 
332
336
  module LibraryDetector
333
337
  def LibraryDetector.loaded_dlls
334
- begin
335
- require 'rubygems'
336
- gem 'win32-api', '>=1.2.0'
337
- require 'win32/api'
338
- rescue Exception => e
339
- puts "=== ERROR: Failed to load the win32-api gem. Install win32-api or use --no-autodll."
340
- puts "=== CAUSE: #{e.class.name}: #{e.message.chomp}"
341
- exit
342
- end
338
+ require 'Win32API'
343
339
 
344
- enumprocessmodules = Win32::API.new('EnumProcessModules', 'LPLP', 'B', 'psapi')
345
- getmodulefilename = Win32::API.new('GetModuleFileName', 'LPL', 'L')
346
- getcurrentprocess = Win32::API.new('GetCurrentProcess', 'V', 'L')
340
+ enumprocessmodules = Win32API.new('psapi', 'EnumProcessModules', ['L','P','L','P'], 'B')
341
+ getmodulefilename = Win32API.new('kernel32', 'GetModuleFileName', ['L','P','L'], 'L')
342
+ getcurrentprocess = Win32API.new('kernel32', 'GetCurrentProcess', ['V'], 'L')
347
343
 
348
344
  bytes_needed = 4 * 32
349
345
  module_handle_buffer = nil
@@ -1,3 +1,3 @@
1
1
  class Ocra
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.3'
3
3
  end
Binary file
Binary file
Binary file
@@ -3,6 +3,11 @@ require "tmpdir"
3
3
  require "fileutils"
4
4
  require "rbconfig"
5
5
 
6
+ require 'rbconfig'
7
+ puts "Version: #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
8
+ puts "Architecture: #{RbConfig::CONFIG['arch']}"
9
+ puts "Host: #{RbConfig::CONFIG['host']}"
10
+
6
11
  begin
7
12
  require "rubygems"
8
13
  gem 'win32-api', '>=1.2.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Christensen
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-10 00:00:00 +02:00
12
+ date: 2009-11-21 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,12 +20,12 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.3.1
23
+ version: 2.3.3
24
24
  version:
25
25
  description: |-
26
- OCRA (One-Click Ruby Application) builds Windows executables from Ruby
27
- source code. The executable is a self-extracting, self-running
28
- executable that contains the Ruby interpreter, your source code and
26
+ OCRA (One-Click Ruby Application) builds Windows executables from Ruby
27
+ source code. The executable is a self-extracting, self-running
28
+ executable that contains the Ruby interpreter, your source code and
29
29
  any additionally needed ruby libraries or DLL.
30
30
  email:
31
31
  - larsch@belunktum.dk
@@ -50,7 +50,7 @@ files:
50
50
  - test/test_ocra.rb
51
51
  - lib/ocra.rb
52
52
  has_rdoc: true
53
- homepage: http://rubyforge.org/projects/ocra/
53
+ homepage: http://rubyforge.org/projects/ocra/
54
54
  licenses: []
55
55
 
56
56
  post_install_message:
@@ -74,9 +74,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  requirements: []
75
75
 
76
76
  rubyforge_project: ocra
77
- rubygems_version: 1.3.4
77
+ rubygems_version: 1.3.5
78
78
  signing_key:
79
79
  specification_version: 3
80
- summary: OCRA (One-Click Ruby Application) builds Windows executables from Ruby source code
80
+ summary: OCRA (One-Click Ruby Application) builds Windows executables from Ruby
81
81
  source code
82
82
  test_files:
83
83
  - test/test_ocra.rb