releasy 0.2.0rc2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,7 +24,7 @@ module Releasy
24
24
  system tmp_ocra_executable
25
25
  rm tmp_ocra_executable, fileutils_options
26
26
 
27
- mv Dir["#{File.dirname(folder)}/ocr*\.tmp"].first, folder, fileutils_options
27
+ mv Dir["#{File.dirname(folder)}/ocr*.tmp"].first, folder, fileutils_options
28
28
 
29
29
  maker = Releasy::WindowsWrapperMaker.new
30
30
  maker.build_executable("#{folder}/#{executable_name}", "src/#{project.executable}",
@@ -9,7 +9,99 @@ module Releasy
9
9
  # @attr repository [String] Name of Github repository (defaults to: the repository name in `git config remote.origin.url` or _project.underscored_name_).
10
10
  # @attr token [String] Github token associated with {#login} - a 32-digit hexadecimal string - DO NOT COMMIT A FILE CONTAINING YOUR GITHUB TOKEN (defaults to: `git config github.token`)
11
11
  class Github < Deployer
12
+ # Patch to add an asynchronous version of upload, that also yields every second and takes into account timeout.
13
+ module UploaderUploadAsync
14
+ def upload_async(info)
15
+ unless info[:repos]
16
+ raise "required repository name"
17
+ end
18
+ info[:repos] = @login + '/' + info[:repos] unless info[:repos].include? '/'
19
+
20
+ if info[:file]
21
+ file = info[:file]
22
+ unless File.exist?(file) && File.readable?(file)
23
+ raise "file does not exsits or readable"
24
+ end
25
+ info[:name] ||= File.basename(file)
26
+ end
27
+ unless info[:file] || info[:data]
28
+ raise "required file or data parameter to upload"
29
+ end
30
+
31
+ unless info[:name]
32
+ raise "required name parameter for filename with data parameter"
33
+ end
34
+
35
+ if info[:replace]
36
+ list_files(info[:repos]).each { |obj|
37
+ next unless obj[:name] == info[:name]
38
+ delete info[:repos], obj[:id]
39
+ }
40
+ elsif list_files(info[:repos]).any?{|obj| obj[:name] == info[:name]}
41
+ raise "file '#{info[:name]}' is already uploaded. please try different name"
42
+ end
43
+
44
+ info[:content_type] ||= 'application/octet-stream'
45
+ stat = HTTPClient.post("https://github.com/#{info[:repos]}/downloads", {
46
+ "file_size" => info[:file] ? File.stat(info[:file]).size : info[:data].size,
47
+ "content_type" => info[:content_type],
48
+ "file_name" => info[:name],
49
+ "description" => info[:description] || '',
50
+ "login" => @login,
51
+ "token" => @token
52
+ })
53
+
54
+ unless stat.code == 200
55
+ raise "Failed to post file info"
56
+ end
57
+
58
+ upload_info = JSON.parse(stat.content)
59
+ if info[:file]
60
+ f = File.open(info[:file], 'rb')
61
+ else
62
+ f = Tempfile.open('net-github-upload')
63
+ f << info[:data]
64
+ f.flush
65
+ end
66
+
67
+ client = HTTPClient.new
68
+ client.send_timeout = info[:upload_timeout] if info[:upload_timeout]
69
+
70
+ res = begin
71
+ connection = client.post_async("http://github.s3.amazonaws.com/", [
72
+ ['Filename', info[:name]],
73
+ ['policy', upload_info['policy']],
74
+ ['success_action_status', 201],
75
+ ['key', upload_info['path']],
76
+ ['AWSAccessKeyId', upload_info['accesskeyid']],
77
+ ['Content-Type', upload_info['content_type'] || 'application/octet-stream'],
78
+ ['signature', upload_info['signature']],
79
+ ['acl', upload_info['acl']],
80
+ ['file', f]
81
+ ])
82
+
83
+ until connection.finished?
84
+ yield if block_given?
85
+ sleep info[:yield_interval] || 1
86
+ end
87
+
88
+ connection.pop
89
+ ensure
90
+ f.close
91
+ end
92
+
93
+ if res.status == 201
94
+ return FasterXmlSimple.xml_in(res.body.read)['PostResponse']['Location']
95
+ else
96
+ raise 'Failed to upload' + extract_error_message(res.body)
97
+ end
98
+ end
99
+ end
100
+
101
+
12
102
  TYPE = :github
103
+ # Maximum time to allow an upload to continue. An hour to upload a file isn't unreasonable. Better than the default 2 minutes, which uploads about 4MB for me.
104
+ UPLOAD_TIMEOUT = 60 * 60
13
105
 
14
106
  Deployers.register self
15
107
 
@@ -83,7 +175,10 @@ module Releasy
83
175
  raise ConfigError, "#user must be set manually if it is not configured on the system" unless user
84
176
  raise ConfigError, "#token must be set manually if it is not configured on the system" unless token
85
177
 
86
- require 'net/github-upload' # Hold off requiring this unless needed, so it doesn't slow down creating tasks.
178
+ # Hold off requiring this unless needed, so it doesn't slow down creating tasks.
179
+ if require 'net/github-upload'
180
+ Net::GitHub::Upload.send :include, UploaderUploadAsync
181
+ end
87
182
 
88
183
  uploader = Net::GitHub::Upload.new(:login => user, :token => token)
89
184
 
@@ -92,7 +187,10 @@ module Releasy
92
187
  t = Time.now
93
188
 
94
189
  begin
95
- uploader.upload(:repos => repository, :file => file, :description => description, :replace => @force_replace)
190
+ uploader.upload_async :repos => repository, :file => file, :description => description, :replace => @force_replace, :upload_timeout => UPLOAD_TIMEOUT do
191
+ print '.'
192
+ end
193
+ puts '.'
96
194
  rescue => ex
97
195
  # Probably failed to overwrite an existing file.
98
196
  error "Error uploading file #{file}: #{ex.message}"
@@ -100,7 +198,8 @@ module Releasy
100
198
  end
101
199
 
102
200
  link = "https://github.com/downloads/#{user}/#{repository}/#{File.basename(file)}"
103
- heading %[Successfully uploaded to "#{link}" in #{(Time.now - t).ceil}s]
201
+ time = "%d:%02d" % (Time.now - t).ceil.divmod(60)
202
+ heading %[Successfully uploaded to "#{link}" in #{time}]
104
203
 
105
204
  link
106
205
  end
@@ -10,28 +10,35 @@ module Releasy::Mixins::Log
10
10
  end
11
11
  end
12
12
 
13
+ protected
14
+ # Current level of logging. This affects ALL objects that are logging!
13
15
  def log_level; Releasy::Mixins::Log.log_level; end
14
16
 
17
+ protected
15
18
  # Options for fileutils commands, based on log_level.
16
19
  def fileutils_options
17
20
  { :verbose => log_level == :verbose }
18
21
  end
19
22
 
23
+ protected
20
24
  # Heading message shown unless :silent
21
25
  def heading(str)
22
26
  puts "=== #{str}" unless log_level == :silent
23
27
  end
24
28
 
29
+ protected
25
30
  # Heading message shown if :verbose
26
31
  def info(str)
27
32
  puts str if log_level == :verbose
28
33
  end
29
34
 
35
+ protected
30
36
  # Warning message shown unless :silent
31
37
  def warn(str)
32
38
  puts "=== WARNING: #{str}" unless log_level == :silent
33
39
  end
34
40
 
41
+ protected
35
42
  # Error message always shown.
36
43
  def error(str)
37
44
  puts "=== ERROR: #{str}"
@@ -1,3 +1,5 @@
1
+ require 'set'
2
+
1
3
  require 'releasy/dsl_wrapper'
2
4
  require 'releasy/builders'
3
5
  require 'releasy/packagers'
@@ -270,9 +272,9 @@ module Releasy
270
272
  def generate_archive_tasks
271
273
  return if active_builders.empty?
272
274
 
273
- windows_tasks = []
274
- osx_tasks = []
275
- top_level_tasks = []
275
+ windows_tasks = Set.new
276
+ osx_tasks = Set.new
277
+ top_level_tasks = Set.new
276
278
 
277
279
  active_builders.each do |builder|
278
280
  output_task = builder.type.to_s.sub '_', ':'
@@ -281,7 +283,9 @@ module Releasy
281
283
  packagers.each do |packager|
282
284
  packager.send :generate_tasks, output_task, builder.send(:folder), @deployers
283
285
 
284
- task "deploy:#{output_task}:#{packager.type}" => @deployers.map {|d| "deploy:#{output_task}:#{packager.type}:#{d.type}" }
286
+ unless @deployers.empty?
287
+ task "deploy:#{output_task}:#{packager.type}" => @deployers.map {|d| "deploy:#{output_task}:#{packager.type}:#{d.type}" }
288
+ end
285
289
  end
286
290
 
287
291
  @deployers.each do |deployer|
@@ -292,13 +296,13 @@ module Releasy
292
296
 
293
297
  case output_task
294
298
  when /^windows:/
295
- windows_tasks << "#{output_task}"
296
- top_level_tasks << "windows" unless top_level_tasks.include? "windows"
299
+ windows_tasks << output_task
300
+ top_level_tasks << 'windows'
297
301
  when /^osx:/
298
- osx_tasks << "package:#{output_task}"
299
- top_level_tasks << "osx" unless top_level_tasks.include? "osx"
302
+ osx_tasks << output_task
303
+ top_level_tasks << 'osx'
300
304
  else
301
- top_level_tasks << "#{output_task}"
305
+ top_level_tasks << output_task
302
306
  end
303
307
  end
304
308
 
@@ -306,44 +310,45 @@ module Releasy
306
310
  unless windows_tasks.empty?
307
311
  task "package:windows" => windows_tasks.map {|t| "package:#{t}" }
308
312
 
309
- generate_deploy_tasks "windows", windows_tasks
313
+ generate_deploy_tasks windows_tasks
310
314
  end
311
315
 
312
316
  # OS X tasks.
313
317
  unless osx_tasks.empty?
314
318
  task "package:osx" => osx_tasks.map {|t| "package:#{t}" }
315
319
 
316
- generate_deploy_tasks "osx", osx_tasks
320
+ generate_deploy_tasks osx_tasks
317
321
  end
318
322
 
319
323
  # Top level tasks.
320
324
  desc "Package #{description}"
321
325
  task "package" => top_level_tasks.map {|t| "package:#{t}" }
322
326
 
323
- unless @deployers.empty?
324
- desc "Deploy #{description}"
325
- task "deploy" => top_level_tasks.map {|t| "deploy:#{t}" }
326
-
327
- generate_deploy_tasks "", top_level_tasks
328
- end
327
+ generate_deploy_tasks top_level_tasks
329
328
 
330
329
  self
331
330
  end
332
331
 
333
332
  protected
334
- def generate_deploy_tasks(task_name, tasks)
335
- deploy_task = task_name.empty? ? "deploy" : "deploy:#{task_name}"
333
+ def generate_deploy_tasks(tasks)
334
+ return if @deployers.empty?
336
335
 
337
- unless @deployers.empty?
338
- task deploy_task => tasks.map {|t| "deploy:#{t}" }
336
+ # Work out the namespace first. If there isn't one, then make a described (root) deploy task.
337
+ tasks.first =~ /(.*):.*/
338
+ namespace = $1
339
+ deploy_task = namespace ? "deploy:#{namespace}" : 'deploy'
339
340
 
340
- @deployers.each do |deployer|
341
- task "#{deploy_task}:#{deployer.type}" => tasks.map {|t| "deploy:#{t}:#{deployer.type}" }
342
- end
341
+ unless namespace
342
+ desc "Deploy #{description}"
343
+ task 'deploy' => tasks.map {|t| "deploy:#{t}" }
344
+ end
343
345
 
344
- tasks.each do |t|
345
- task "deploy:#{t}" => @deployers.map {|d| "deploy:#{t}:#{d.type}" }
346
- end
346
+ @deployers.each do |d|
347
+ task "#{deploy_task}:#{d.type}" => tasks.map {|t| "deploy:#{t}:#{d.type}" }
348
+ end
349
+
350
+ tasks.each do |t|
351
+ task "deploy:#{t}" => @deployers.map {|d| "deploy:#{t}:#{d.type}" }
347
352
  end
348
353
  end
349
354
 
@@ -1,3 +1,3 @@
1
1
  module Releasy
2
- VERSION = "0.2.0rc2"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -94,7 +94,7 @@ context Releasy::Deployers::Github do
94
94
  should "expect an Net::GitHub::Upload to be created and used to upload" do
95
95
  stub_file_size
96
96
  mock(Net::GitHub::Upload).new :login => "test_user", :token => "0" * 32 do
97
- mock!.upload :repos => "test_app", :file => "file.zip", :description => "Test App 0.1", :replace => false
97
+ mock!.upload_async :repos => "test_app", :file => "file.zip", :description => "Test App 0.1", :replace => false, :upload_timeout => 3600
98
98
  end
99
99
 
100
100
  topic.send :deploy, "file.zip"
@@ -105,7 +105,7 @@ context Releasy::Deployers::Github do
105
105
  should "expect an Net::GitHub::Upload to be created and exit (not forcing replacement and file already exists)" do
106
106
  stub_file_size
107
107
  mock(Net::GitHub::Upload).new :login => "test_user", :token => "0" * 32 do
108
- mock!.upload :repos => "test_app", :file => "file.zip", :description => "Test App 0.1", :replace => false do
108
+ mock!.upload_async :repos => "test_app", :file => "file.zip", :description => "Test App 0.1", :replace => false, :upload_timeout => 3600 do
109
109
  raise "file already exists"
110
110
  end
111
111
  end
@@ -120,7 +120,7 @@ context Releasy::Deployers::Github do
120
120
  should "expect an Net::GitHub::Upload to be created and used to upload (forcing replacement)" do
121
121
  stub_file_size
122
122
  mock(Net::GitHub::Upload).new :login => "test_user", :token => "0" * 32 do
123
- mock!.upload :repos => "test_app", :file => "file.zip", :description => "Test App 0.1", :replace => true
123
+ mock!.upload_async :repos => "test_app", :file => "file.zip", :description => "Test App 0.1", :replace => true, :upload_timeout => 3600
124
124
  end
125
125
 
126
126
  topic.replace!
@@ -2,6 +2,8 @@ require File.expand_path("../teststrap", File.dirname(__FILE__))
2
2
 
3
3
  # Change directory into the project, since that is where we work from normally.
4
4
 
5
+ folder_base = "pkg/test_project_2a_v0_1_5"
6
+
5
7
  # @author Bil Bas (Spooner)
6
8
  context Releasy::Project do
7
9
  teardown do
@@ -79,6 +81,8 @@ context Releasy::Project do
79
81
 
80
82
  context "defined" do
81
83
  setup do
84
+ stub(Releasy).win_platform?.returns true
85
+
82
86
  Releasy::Project.new do
83
87
  name "Test Project - (2a)"
84
88
  version "v0.1.5"
@@ -88,21 +92,20 @@ context Releasy::Project do
88
92
  exclude_encoding
89
93
 
90
94
  add_build :source
95
+
91
96
  add_build :osx_app do
92
- add_package :tar_gz do
93
- extension ".tgz"
94
- end
95
- wrapper Dir["../wrappers/gosu-mac-wrapper-*.tar.gz"].first
97
+ wrapper "../wrappers/gosu-mac-wrapper-0.7.41.tar.gz"
96
98
  url "org.url.app"
97
99
  end
98
- add_build :windows_standalone do
99
- exclude_encoding
100
- end
100
+
101
+ add_build :windows_installer
101
102
 
102
103
  files source_files
103
104
 
104
105
  add_link "www.frog.com", "Frog"
105
106
  add_link "www2.fish.com", "Fish"
107
+
108
+ add_deploy :github
106
109
  end
107
110
  end
108
111
 
@@ -119,44 +122,79 @@ context Releasy::Project do
119
122
  asserts(:folder_base).equals "pkg/test_project_2a_v0_1_5"
120
123
  asserts(:links).equals "www.frog.com" => "Frog", "www2.fish.com" => "Fish"
121
124
 
122
- asserts(:active_builders).size(Gem.win_platform? ? 3 : 2)
125
+ asserts(:active_builders).size 3
123
126
  asserts("source active_packagers") { topic.send(:active_packagers, topic.send(:active_builders).find {|b| b.type == :source }) }.size 2
124
- asserts("osx app active_packagers") { topic.send(:active_packagers, topic.send(:active_builders).find {|b| b.type == :osx_app }) }.size 3
125
- if Gem.win_platform?
126
- asserts("Windows standalone active_packagers") { topic.send(:active_packagers, topic.send(:active_builders).find {|b| b.type == :windows_standalone }) }.size 2
127
- end
128
-
129
- asserts "add_build yields an instance_eval-ed Releasy::DSLWrapper" do
130
- correct = false
131
- topic.add_build :windows_folder do
132
- correct = (is_a?(Releasy::DSLWrapper) and owner.is_a?(Releasy::Builders::WindowsFolder))
127
+ asserts("osx app active_packagers") { topic.send(:active_packagers, topic.send(:active_builders).find {|b| b.type == :osx_app }) }.size 2
128
+ asserts("Windows standalone active_packagers") { topic.send(:active_packagers, topic.send(:active_builders).find {|b| b.type == :windows_installer }) }.size 2
129
+
130
+ context "adding builds and packages" do
131
+ asserts "#add_build yields an instance_eval-ed Releasy::DSLWrapper" do
132
+ correct = false
133
+ topic.add_build :windows_standalone do
134
+ correct = (is_a?(Releasy::DSLWrapper) and owner.is_a?(Releasy::Builders::WindowsStandalone))
135
+ end
136
+ correct
133
137
  end
134
- correct
135
- end
136
138
 
137
- asserts "add_package yields an instance_eval-ed Releasy::DSLWrapper" do
138
- correct = false
139
- topic.add_package :tar_gz do
140
- correct = (is_a?(Releasy::DSLWrapper) and owner.is_a?(Releasy::Packagers::TarGzip))
139
+ asserts "#add_package yields an instance_eval-ed Releasy::DSLWrapper" do
140
+ correct = false
141
+ topic.add_package :tar_gz do
142
+ correct = (is_a?(Releasy::DSLWrapper) and owner.is_a?(Releasy::Packagers::TarGzip))
143
+ end
144
+ correct
141
145
  end
142
- correct
143
146
  end
144
147
 
145
148
  context "#generate_archive_tasks" do
146
149
  asserts(:generate_archive_tasks).equals { topic }
147
150
 
148
- should "call generate_tasks on all packagers" do
151
+ should "call #generate_tasks on all packagers" do
149
152
  topic.send(:active_builders).each do |builder|
150
- topic.send(:active_packagers, builder).each {|a| mock(a).generate_tasks(builder.type.to_s.sub('_', ':'), builder.send(:folder), []) }
153
+ topic.send(:active_packagers, builder).each do |packager|
154
+ mock(packager).generate_tasks(builder.type.to_s.sub('_', ':'), builder.send(:folder), satisfy {|a| a.size == 1 and a.first.is_a? Releasy::Deployers::Github })
155
+ end
151
156
  end
152
157
  topic.send :generate_archive_tasks
153
158
  end
154
159
  end
155
160
 
161
+ context "#generate_deploy_tasks" do
162
+ context "without namespace" do
163
+ setup do
164
+ Rake::Task.clear
165
+ topic.send :generate_deploy_tasks, %w[a b]
166
+ end
167
+
168
+ tasks = [
169
+ [ :Task, "deploy", %w[deploy:a deploy:b] ],
170
+ [ :Task, "deploy:github", %w[deploy:a:github deploy:b:github] ],
171
+ [ :Task, "deploy:a", %w[deploy:a:github] ],
172
+ [ :Task, "deploy:b", %w[deploy:b:github] ],
173
+ ]
174
+
175
+ test_tasks tasks
176
+ end
177
+
178
+ context "with namespace" do
179
+ setup do
180
+ Rake::Task.clear
181
+ topic.send :generate_deploy_tasks, %w[c:a c:b]
182
+ end
183
+
184
+ tasks = [
185
+ [ :Task, "deploy:c:github", %w[deploy:c:a:github deploy:c:b:github] ],
186
+ [ :Task, "deploy:c:a", %w[deploy:c:a:github] ],
187
+ [ :Task, "deploy:c:b", %w[deploy:c:b:github] ],
188
+ ]
189
+
190
+ test_tasks tasks
191
+ end
192
+ end
193
+
156
194
  context "#generate_tasks" do
157
195
  asserts(:generate_tasks).equals { topic }
158
196
 
159
- should "call generate_tasks on all builders" do
197
+ should "call #generate_tasks on all builders" do
160
198
  topic.send(:active_builders) {|b| mock(b).generate_tasks }
161
199
  topic.send :generate_tasks
162
200
  end
@@ -165,6 +203,77 @@ context Releasy::Project do
165
203
  mock(topic).generate_archive_tasks
166
204
  topic.send :generate_tasks
167
205
  end
206
+
207
+ context "generated tasks" do
208
+ tasks = [
209
+ [ :Task, "deploy", %w[deploy:source deploy:osx deploy:windows] ],
210
+ [ :Task, "deploy:github", %w[deploy:source:github deploy:osx:github deploy:windows:github] ],
211
+ [ :Task, "deploy:source", %w[deploy:source:github] ],
212
+
213
+ [ :Task, "deploy:source:github", %w[deploy:source:zip:github deploy:source:7z:github] ],
214
+ [ :Task, "deploy:source:zip", %w[deploy:source:zip:github] ],
215
+ [ :Task, "deploy:source:zip:github", %w[package:source:zip] ],
216
+ [ :Task, "deploy:source:7z", %w[deploy:source:7z:github] ],
217
+ [ :Task, "deploy:source:7z:github", %w[package:source:7z] ],
218
+
219
+ [ :Task, "deploy:osx", %w[deploy:osx:github] ],
220
+ [ :Task, "deploy:osx:app", %w[deploy:osx:app:github] ],
221
+ [ :Task, "deploy:osx:github", %w[deploy:osx:app:github] ],
222
+ [ :Task, "deploy:osx:app:github", %w[deploy:osx:app:zip:github deploy:osx:app:7z:github] ],
223
+ [ :Task, "deploy:osx:app:zip", %w[deploy:osx:app:zip:github] ],
224
+ [ :Task, "deploy:osx:app:zip:github", %w[package:osx:app:zip] ],
225
+ [ :Task, "deploy:osx:app:7z", %w[deploy:osx:app:7z:github] ],
226
+ [ :Task, "deploy:osx:app:7z:github", %w[package:osx:app:7z] ],
227
+
228
+ [ :Task, "deploy:windows", %w[deploy:windows:github] ],
229
+ [ :Task, "deploy:windows:installer", %w[deploy:windows:installer:github] ],
230
+ [ :Task, "deploy:windows:github", %w[deploy:windows:installer:github] ],
231
+ [ :Task, "deploy:windows:installer:github", %w[deploy:windows:installer:zip:github deploy:windows:installer:7z:github] ],
232
+ [ :Task, "deploy:windows:installer:zip", %w[deploy:windows:installer:zip:github] ],
233
+ [ :Task, "deploy:windows:installer:zip:github", %w[package:windows:installer:zip] ],
234
+ [ :Task, "deploy:windows:installer:7z", %w[deploy:windows:installer:7z:github] ],
235
+ [ :Task, "deploy:windows:installer:7z:github", %w[package:windows:installer:7z] ],
236
+
237
+ [ :Task, "package", %w[package:source package:osx package:windows] ],
238
+
239
+ [ :Task, "package:source", %w[package:source:7z package:source:zip] ],
240
+ [ :Task, "package:source:zip", ["#{folder_base}_SOURCE.zip"] ],
241
+ [ :Task, "package:source:7z", ["#{folder_base}_SOURCE.7z"] ],
242
+
243
+ [ :Task, "package:osx", %w[package:osx:app] ],
244
+ [ :Task, "package:osx:app", %w[package:osx:app:7z package:osx:app:zip] ],
245
+ [ :Task, "package:osx:app:zip", ["#{folder_base}_OSX.zip"] ],
246
+ [ :Task, "package:osx:app:7z", ["#{folder_base}_OSX.7z"] ],
247
+
248
+ [ :Task, "package:windows", %w[package:windows:installer] ],
249
+ [ :Task, "package:windows:installer", %w[package:windows:installer:7z package:windows:installer:zip] ],
250
+ [ :Task, "package:windows:installer:zip", ["#{folder_base}_WIN32_INSTALLER.zip"] ],
251
+ [ :Task, "package:windows:installer:7z", ["#{folder_base}_WIN32_INSTALLER.7z"] ],
252
+
253
+ [ :Task, "build", %w[build:source build:osx build:windows] ],
254
+ [ :Task, "build:source", ["#{folder_base}_SOURCE"] ],
255
+ [ :Task, "build:osx", %w[build:osx:app] ],
256
+ [ :Task, "build:osx:app", ["#{folder_base}_OSX"] ],
257
+ [ :Task, "build:windows", %w[build:windows:installer] ],
258
+ [ :Task, "build:windows:installer", ["#{folder_base}_WIN32_INSTALLER"] ],
259
+
260
+ [ :FileCreationTask, 'pkg', [] ],
261
+
262
+ [ :FileCreationTask, "#{folder_base}_SOURCE", source_files ],
263
+ [ :FileTask, "#{folder_base}_SOURCE.7z", ["#{folder_base}_SOURCE"] ],
264
+ [ :FileTask, "#{folder_base}_SOURCE.zip", ["#{folder_base}_SOURCE"] ],
265
+
266
+ [ :FileCreationTask, "#{folder_base}_OSX", source_files + ["../wrappers/gosu-mac-wrapper-0.7.41.tar.gz"] ],
267
+ [ :FileTask, "#{folder_base}_OSX.7z", ["#{folder_base}_OSX" ] ],
268
+ [ :FileTask, "#{folder_base}_OSX.zip", ["#{folder_base}_OSX"] ],
269
+
270
+ [ :FileCreationTask, "#{folder_base}_WIN32_INSTALLER", source_files ],
271
+ [ :FileTask, "#{folder_base}_WIN32_INSTALLER.7z", ["#{folder_base}_WIN32_INSTALLER"] ],
272
+ [ :FileTask, "#{folder_base}_WIN32_INSTALLER.zip", ["#{folder_base}_WIN32_INSTALLER"] ],
273
+ ]
274
+
275
+ test_tasks tasks
276
+ end
168
277
  end
169
278
 
170
279
  context "defined with Object#tap-like syntax" do
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: releasy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0rc2
5
- prerelease: 5
4
+ version: 0.2.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Bil Bas (Spooner)
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-27 00:00:00.000000000 Z
12
+ date: 2012-01-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ocra
16
- requirement: &22452180 !ruby/object:Gem::Requirement
16
+ requirement: &22502412 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.3.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *22452180
24
+ version_requirements: *22502412
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &22451748 !ruby/object:Gem::Requirement
27
+ requirement: &22500432 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.9.2.2
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *22451748
35
+ version_requirements: *22500432
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: cri
38
- requirement: &22451352 !ruby/object:Gem::Requirement
38
+ requirement: &22498248 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.1.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *22451352
46
+ version_requirements: *22498248
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: thor
49
- requirement: &22450980 !ruby/object:Gem::Requirement
49
+ requirement: &21878016 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.14.6
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *22450980
57
+ version_requirements: *21878016
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: net-github-upload
60
- requirement: &22450644 !ruby/object:Gem::Requirement
60
+ requirement: &21877176 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.0.7
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *22450644
68
+ version_requirements: *21877176
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: riot
71
- requirement: &22450260 !ruby/object:Gem::Requirement
71
+ requirement: &21876108 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.12.5
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *22450260
79
+ version_requirements: *21876108
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rr
82
- requirement: &22449912 !ruby/object:Gem::Requirement
82
+ requirement: &21874980 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 1.0.4
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *22449912
90
+ version_requirements: *21874980
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: yard
93
- requirement: &22449552 !ruby/object:Gem::Requirement
93
+ requirement: &22417668 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 0.7.4
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *22449552
101
+ version_requirements: *22417668
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: redcarpet
104
- requirement: &22449180 !ruby/object:Gem::Requirement
104
+ requirement: &22430232 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: 2.0.1
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *22449180
112
+ version_requirements: *22430232
113
113
  description: ! 'Releasy helps to make Ruby application releases simpler, by creating
114
114
  and archiving source folders, Windows folders,
115
115
 
@@ -220,13 +220,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
220
220
  version: '0'
221
221
  segments:
222
222
  - 0
223
- hash: 710558637
223
+ hash: -77117219
224
224
  required_rubygems_version: !ruby/object:Gem::Requirement
225
225
  none: false
226
226
  requirements:
227
- - - ! '>'
227
+ - - ! '>='
228
228
  - !ruby/object:Gem::Version
229
- version: 1.3.1
229
+ version: '0'
230
+ segments:
231
+ - 0
232
+ hash: -77117219
230
233
  requirements:
231
234
  - 7z (optional; used to generate archives)
232
235
  - InnoSetup (optional on Windows; used to make Win32 installer)