RubyPackager 0.2.1.20101110 → 1.0.0.20120301

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
2
+ # Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
3
3
  # Licensed under the terms specified in LICENSE file. No warranty is provided.
4
4
  #++
5
5
 
@@ -11,14 +11,14 @@ module RubyPackager
11
11
 
12
12
  # Check that we can use this installer
13
13
  #
14
- # Return:
14
+ # Return::
15
15
  # * _Boolean_: Can we use this installer ?
16
- def checkTools
16
+ def check_tools
17
17
  rSuccess = true
18
18
 
19
19
  # Check that makensis is present
20
20
  if (!system('makensis /VERSION'))
21
- logErr "Need to have MakeNSIS installed in the system PATH to create installer.\nPlease download and install MakeNSIS in the PATH from http://nsis.sourceforge.net/Main_Page"
21
+ log_err "Need to have MakeNSIS installed in the system PATH to create installer.\nPlease download and install MakeNSIS in the PATH from http://nsis.sourceforge.net/Main_Page"
22
22
  rSuccess = false
23
23
  end
24
24
 
@@ -27,24 +27,24 @@ module RubyPackager
27
27
 
28
28
  # Create the installer with everything in the release directory.
29
29
  #
30
- # Parameters:
30
+ # Parameters::
31
31
  # * *iRootDir* (_String_): The Root directory
32
32
  # * *iReleaseDir* (_String_): The release directory (all files to put in the installer are there)
33
33
  # * *iInstallerDir* (_String_): The directory where the installer has to be put
34
34
  # * *iVersion* (_String_): Release version
35
35
  # * *iReleaseInfo* (_ReleaseInfo_): Release info
36
- # Return:
36
+ # Return::
37
37
  # * _String_: File name to distribute, or nil in case of failure
38
- def createInstaller(iRootDir, iReleaseDir, iInstallerDir, iVersion, iReleaseInfo)
38
+ def create_installer(iRootDir, iReleaseDir, iInstallerDir, iVersion, iReleaseInfo)
39
39
  rFileName = nil
40
40
 
41
- if (iReleaseInfo.InstallInfo[:NSISFileName] == nil)
42
- logErr 'No NSISFileName specified among the Install description.'
41
+ if (iReleaseInfo.install_info[:nsis_file_name] == nil)
42
+ log_err 'No NSISFileName specified among the Install description.'
43
43
  else
44
- lNSISOK = system("makensis /DVERSION=#{iVersion} \"/DRELEASEDIR=#{iReleaseDir.gsub(/\//,'\\')}\" \"#{iRootDir.gsub(/\//,'\\')}\\#{iReleaseInfo.InstallInfo[:NSISFileName].gsub(/\//,'\\')}\"")
44
+ lNSISOK = system("makensis /DVERSION=#{iVersion} \"/DRELEASEDIR=#{iReleaseDir.gsub(/\//,'\\')}\" \"#{iRootDir.gsub(/\//,'\\')}\\#{iReleaseInfo.install_info[:nsis_file_name].gsub(/\//,'\\')}\"")
45
45
  if (lNSISOK)
46
- lInstallerDir = File.dirname("#{iRootDir}/#{iReleaseInfo.InstallInfo[:NSISFileName]}")
47
- rFileName = "#{iReleaseInfo.InstallInfo[:InstallerName]}_#{iVersion}_setup.exe"
46
+ lInstallerDir = File.dirname("#{iRootDir}/#{iReleaseInfo.install_info[:nsis_file_name]}")
47
+ rFileName = "#{iReleaseInfo.install_info[:installer_name]}_#{iVersion}_setup.exe"
48
48
  FileUtils.mv("#{lInstallerDir}/setup.exe", "#{iInstallerDir}/#{rFileName}")
49
49
  end
50
50
  end
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
2
+ # Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
3
3
  # Licensed under the terms specified in LICENSE file. No warranty is provided.
4
4
  #++
5
5
 
@@ -16,30 +16,33 @@ module RubyPackager
16
16
 
17
17
  # Check if the tools we will use to generate an executable are present
18
18
  #
19
- # Parameters:
19
+ # Parameters::
20
20
  # * *iRootDir* (_String_): Root directory
21
21
  # * *iIncludeRuby* (_Boolean_): Do we include Ruby in the release ?
22
- # Return:
22
+ # * *iNeedBinaryCompilation* (_Boolean_): Do we need to compile RB files into a binary executable ?
23
+ # Return::
23
24
  # * _Boolean_: Are tools correctly useable ?
24
- def checkExeTools(iRootDir, iIncludeRuby)
25
+ def check_exe_tools(iRootDir, iIncludeRuby, iNeedBinaryCompilation)
25
26
  rSuccess = true
26
27
 
27
28
  if (iIncludeRuby)
28
29
  # We need allinoneruby
29
30
  if (Gem.find_files('allinoneruby').empty?)
30
- logErr "Need to have allinoneruby gem to release including Ruby.\nPlease install allinoneruby gem (gem install allinoneruby)."
31
+ log_err "Need to have allinoneruby gem to release including Ruby.\nPlease install allinoneruby gem (gem install allinoneruby)."
31
32
  rSuccess = false
32
33
  end
33
34
  end
34
- # Check that edicon is present
35
- if (!File.exists?("#{PLATFORM_DIR}/edicon/edicon.exe"))
36
- logErr "Need to have edicon.exe installed in #{PLATFORM_DIR}/edicon to set a Windows executable's icon.\nPlease install edicon, part of Ocra Gem (gem install ocra), and copy from the Gem directory (ocra-1.1.1/share/ocra/edicon.exe) to #{PLATFORM_DIR}/edicon/edicon.exe."
37
- rSuccess = false
38
- end
39
- # Check that exerb is present
40
- if (!system('exerb.bat --version'))
41
- logErr "Need to have exerb installed in the system PATH to create a Windows executable.\nPlease download and install exerb from http://exerb.sourceforge.jp/index.en.html"
42
- rSuccess = false
35
+ if (iNeedBinaryCompilation)
36
+ # Check that edicon is present
37
+ if (!File.exists?("#{PLATFORM_DIR}/edicon/edicon.exe"))
38
+ log_err "Need to have edicon.exe installed in #{PLATFORM_DIR}/edicon to set a Windows executable's icon.\nPlease install edicon, part of Ocra Gem (gem install ocra), and copy from the Gem directory (ocra-1.1.1/share/ocra/edicon.exe) to #{PLATFORM_DIR}/edicon/edicon.exe."
39
+ rSuccess = false
40
+ end
41
+ # Check that exerb is present
42
+ if (!system('exerb.bat --version'))
43
+ log_err "Need to have exerb installed in the system PATH to create a Windows executable.\nPlease download and install exerb from http://exerb.sourceforge.jp/index.en.html"
44
+ rSuccess = false
45
+ end
43
46
  end
44
47
 
45
48
  return rSuccess
@@ -48,20 +51,20 @@ module RubyPackager
48
51
  # Create the binary.
49
52
  # This is called when the core library has been copied in the release directory.
50
53
  #
51
- # Parameters:
54
+ # Parameters::
52
55
  # * *iRootDir* (_String_): Root directory
53
56
  # * *iReleaseDir* (_String_): Release directory
54
57
  # * *iIncludeRuby* (_Boolean_): Do we include Ruby in the release ?
55
58
  # * *iExecutableInfo* (<em>map<Symbol,Object></em>): The executable information
56
- # Return:
59
+ # Return::
57
60
  # * _Boolean_: Success ?
58
- def createBinary(iRootDir, iReleaseDir, iIncludeRuby, iExecutableInfo)
61
+ def create_binary(iRootDir, iReleaseDir, iIncludeRuby, iExecutableInfo)
59
62
  rSuccess = true
60
63
 
61
64
  lBinSubDir = "Launch/#{RUBY_PLATFORM}/bin"
62
65
  lRubyBaseBinName = nil
63
66
  lRubyLaunchCmd = nil
64
- if (iExecutableInfo[:TerminalApplication])
67
+ if (iExecutableInfo[:terminal_application])
65
68
  lRubyBaseBinName = 'ruby'
66
69
  lRubyLaunchCmd = 'ruby'
67
70
  else
@@ -73,16 +76,16 @@ module RubyPackager
73
76
  # First create the binary containing all ruby
74
77
  lBinDir = "#{iReleaseDir}/#{lBinSubDir}"
75
78
  FileUtils::mkdir_p(lBinDir)
76
- changeDir(lBinDir) do
79
+ change_dir(lBinDir) do
77
80
  lCmd = nil
78
- if (iExecutableInfo[:TerminalApplication])
81
+ if (iExecutableInfo[:terminal_application])
79
82
  lCmd = "allinoneruby.bat #{lBinName}"
80
83
  else
81
84
  lCmd = "allinoneruby.bat --rubyw #{lBinName}"
82
85
  end
83
86
  rSuccess = system(lCmd)
84
87
  if (!rSuccess)
85
- logErr "Error while executing \"#{lCmd}\""
88
+ log_err "Error while executing \"#{lCmd}\""
86
89
  end
87
90
  end
88
91
  end
@@ -93,7 +96,7 @@ module RubyPackager
93
96
  File.open(lTempFileName, 'w') do |oFile|
94
97
  oFile << "
95
98
  \#--
96
- \# Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
99
+ \# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
97
100
  \# Licensed under the terms specified in LICENSE file. No warranty is provided.
98
101
  \#++
99
102
 
@@ -107,9 +110,9 @@ module RubyPackager
107
110
 
108
111
  \# Execute a shell command
109
112
  \#
110
- \# Parameters:
113
+ \# Parameters::
111
114
  \# * *iCmd* (_String_): The shell command to execute
112
- \# Return:
115
+ \# Return::
113
116
  \# * _Boolean_: Success ?
114
117
  def self.shellExecute(iCmd)
115
118
  puts \"> \#{iCmd}\"
@@ -130,12 +133,12 @@ lCurrentDir = Dir.getwd
130
133
  if (system('#{lRubyBaseBinName} --version'))
131
134
  \# Launch directly
132
135
  puts \"Ruby found in environment. Using it directly.\"
133
- lSuccess = RubyPackager::shellExecute(\"#{lRubyLaunchCmd} -w \\\"\#{lCurrentDir}/#{iExecutableInfo[:StartupRBFile]}\\\" \#{ARGV.join(' ')}\")
136
+ lSuccess = RubyPackager::shellExecute(\"#{lRubyLaunchCmd} -w \\\"\#{lCurrentDir}/#{iExecutableInfo[:startup_rb_file]}\\\" \#{ARGV.join(' ')}\")
134
137
  end
135
138
  if (!lSuccess)
136
139
  \# Use allinoneruby
137
140
  puts \"Ruby not found in environment. Using shipped Ruby.\"
138
- lSuccess = RubyPackager::shellExecute(\"start \\\"Title\\\" \\\"\#{lCurrentDir}/#{lBinSubDir}/#{lBinName}\\\" \\\"\#{lCurrentDir}/#{iExecutableInfo[:StartupRBFile]}\\\" \#{ARGV.join(' ')}\")
141
+ lSuccess = RubyPackager::shellExecute(\"start \\\"Title\\\" \\\"\#{lCurrentDir}/#{lBinSubDir}/#{lBinName}\\\" \\\"\#{lCurrentDir}/#{iExecutableInfo[:startup_rb_file]}\\\" \#{ARGV.join(' ')}\")
139
142
  if (!lSuccess)
140
143
  puts 'Unable to execute the application. Please reinstall it.'
141
144
  puts 'Hit enter to quit.'
@@ -144,19 +147,19 @@ if (!lSuccess)
144
147
  end
145
148
  "
146
149
  end
147
- changeDir(iReleaseDir) do
148
- rSuccess = system("exerb.bat -o #{iExecutableInfo[:ExeName]}.exe #{lTempFileName}")
150
+ change_dir(iReleaseDir) do
151
+ rSuccess = system("exerb.bat -o #{iExecutableInfo[:exe_name]}.exe #{lTempFileName}")
149
152
  end
150
153
  if (rSuccess)
151
154
  File.unlink(lTempFileName)
152
155
  # And set its icon
153
- lEdiconCmd = "#{PLATFORM_DIR}/edicon/edicon.exe #{iReleaseDir}/#{iExecutableInfo[:ExeName]}.exe #{iRootDir}/#{iExecutableInfo[:IconName]}"
156
+ lEdiconCmd = "#{PLATFORM_DIR}/edicon/edicon.exe #{iReleaseDir}/#{iExecutableInfo[:exe_name]}.exe #{iRootDir}/#{iExecutableInfo[:icon_name]}"
154
157
  rSuccess = system(lEdiconCmd)
155
158
  if (!rSuccess)
156
- logErr "Error while executing \"#{lEdiconCmd}\""
159
+ log_err "Error while executing \"#{lEdiconCmd}\""
157
160
  end
158
161
  else
159
- logErr "Error while executing \"exerb.bat -o #{iExecutableInfo[:ExeName]}.exe #{lTempFileName}\""
162
+ log_err "Error while executing \"exerb.bat -o #{iExecutableInfo[:exe_name]}.exe #{lTempFileName}\""
160
163
  end
161
164
  end
162
165
 
metadata CHANGED
@@ -3,11 +3,11 @@ name: RubyPackager
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
- - 0
7
- - 2
8
6
  - 1
9
- - 20101110
10
- version: 0.2.1.20101110
7
+ - 0
8
+ - 0
9
+ - 20120301
10
+ version: 1.0.0.20120301
11
11
  platform: ruby
12
12
  authors:
13
13
  - Muriel Salvan
@@ -15,24 +15,51 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-10 00:00:00 +01:00
18
+ date: 2012-03-01 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rUtilAnts
23
23
  prerelease: false
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
28
29
  segments:
29
- - 0
30
30
  - 1
31
- version: "0.1"
31
+ - 0
32
+ version: "1.0"
32
33
  type: :runtime
33
34
  version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: allinoneruby
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ segments:
44
+ - 0
45
+ version: "0"
46
+ type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: highline
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ segments:
57
+ - 0
58
+ version: "0"
59
+ type: :runtime
60
+ version_requirements: *id003
34
61
  description: Generate installable binary distributions of Ruby programs for many platforms (many OS, with or without Ruby installed on clients...). Fit to distribute extensible (plugins) Ruby programs also. Handles also libraries and uploads on websites (SF.net...).
35
- email: murielsalvan@users.sourceforge.net
62
+ email: muriel@x-aeon.com
36
63
  executables:
37
64
  - Release.rb
38
65
  extensions: []
@@ -44,9 +71,13 @@ files:
44
71
  - bin/Release.rb
45
72
  - ChangeLog
46
73
  - Credits
74
+ - lib/RubyPackager/Distributors/RubyGems.rb
47
75
  - lib/RubyPackager/Distributors/SourceForge.rb
48
76
  - lib/RubyPackager/i386-cygwin/PlatformReleaser.rb
49
77
  - lib/RubyPackager/i386-linux/PlatformReleaser.rb
78
+ - lib/RubyPackager/i386-mingw32/edicon/edicon.exe
79
+ - lib/RubyPackager/i386-mingw32/Installers/NSIS.rb
80
+ - lib/RubyPackager/i386-mingw32/PlatformReleaser.rb
50
81
  - lib/RubyPackager/i386-mswin32/edicon/edicon.exe
51
82
  - lib/RubyPackager/i386-mswin32/Installers/NSIS.rb
52
83
  - lib/RubyPackager/i386-mswin32/PlatformReleaser.rb
@@ -57,7 +88,6 @@ files:
57
88
  - LICENSE
58
89
  - README
59
90
  - ReleaseInfo
60
- - TODO
61
91
  has_rdoc: true
62
92
  homepage: http://rubypackager.sourceforge.net/
63
93
  licenses: []
@@ -68,6 +98,7 @@ rdoc_options: []
68
98
  require_paths:
69
99
  - lib
70
100
  required_ruby_version: !ruby/object:Gem::Requirement
101
+ none: false
71
102
  requirements:
72
103
  - - ">="
73
104
  - !ruby/object:Gem::Version
@@ -75,6 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
106
  - 0
76
107
  version: "0"
77
108
  required_rubygems_version: !ruby/object:Gem::Requirement
109
+ none: false
78
110
  requirements:
79
111
  - - ">="
80
112
  - !ruby/object:Gem::Version
@@ -84,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
116
  requirements: []
85
117
 
86
118
  rubyforge_project: rubypackager
87
- rubygems_version: 1.3.6
119
+ rubygems_version: 1.3.7
88
120
  signing_key:
89
121
  specification_version: 3
90
122
  summary: Solution to release Ruby programs on any platform.
data/TODO DELETED
@@ -1,16 +0,0 @@
1
- * Documentation
2
- ** Write a complete User Guide.
3
- ** Write a complete Developer Guide.
4
- ** Create FAQ
5
-
6
- * Testing
7
- ** Test that each possible option from ReleaseInfo is used correctly in every context (Installers, Distributors...)
8
- ** Test checkTools on ReleaseInfo, Installers and Distributors
9
- ** Test that including Ruby in exe effectively works in an environment not having Ruby
10
-
11
- * Development
12
- ** Make it run under MacOS
13
- ** Make rdoc modifications part of a real Gem or an RDoc improvement.
14
- ** Use RDI in checkContext methods.
15
- ** As it is possible to have many failures when delivering or generating installers, and as generating executables and documentation is a long process, it should be better to reuse partially generated content.
16
- ** Delivering a Gem has to be done using "gem push" with a RubyGems.org account info.