core_ex 0.5.1.1 → 0.5.5.0
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.
- data/NEWS +1 -1
- data/SPEC.yml +3 -2
- data/lib/core_ex/rakefile_base.rf +35 -18
- data/lib/core_ex/version.rb +10 -0
- data/lib/core_ex.rb +4 -0
- data/lib/version.rb +13 -13
- metadata +3 -2
data/NEWS
CHANGED
data/SPEC.yml
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
---
|
2
2
|
Author: The Uttk Team.
|
3
3
|
License: Ruby License
|
4
|
-
Revision: '$Id: /w/fey/ruby_ex/trunk/core_ex/SPEC.yml
|
4
|
+
Revision: '$Id: /w/fey/ruby_ex/trunk/core_ex/SPEC.yml 22217 2006-02-24T09:12:17.325948Z pouillar $'
|
5
5
|
|
6
|
-
version: !feydakins.org,2006/version dev-ruby/core_ex-0.
|
6
|
+
version: !feydakins.org,2006/version dev-ruby/core_ex-0.5
|
7
7
|
|
8
8
|
title: CoreEx -- A proposal for a standard library extension.
|
9
9
|
summary: CoreEx is a proposal for a standard library extension.
|
@@ -23,6 +23,7 @@ root_test_suite: test/check-pkg-core_ex.yml
|
|
23
23
|
rdoc_dir: doc/html
|
24
24
|
trunk_url: svn://svn.feydakins.org/ruby_ex/trunk/core_ex
|
25
25
|
tags_url: svn://svn.feydakins.org/ruby_ex/tags
|
26
|
+
version_path: !path lib/core_ex/version.rb
|
26
27
|
|
27
28
|
rdoc_files: !filelist
|
28
29
|
- README
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved.
|
2
2
|
# Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
|
3
3
|
# License:: Gnu General Public License.
|
4
|
-
# Revision:: $Id: /w/fey/ruby_ex/trunk/core_ex/lib/core_ex/rakefile_base.rf
|
4
|
+
# Revision:: $Id: /w/fey/ruby_ex/trunk/core_ex/lib/core_ex/rakefile_base.rf 22249 2006-02-26T12:51:58.028558Z pouillar $
|
5
5
|
|
6
6
|
DEFAULT_RUBY_EX_VERSION = ENV['DEFAULT_RUBY_EX_VERSION'] || '~> 0.3'
|
7
7
|
DEFAULT_UTTK_VERSION = ENV['DEFAULT_UTTK_VERSION'] || '~> 0.3'
|
@@ -290,6 +290,11 @@ clean_task :gem_spec do
|
|
290
290
|
end
|
291
291
|
|
292
292
|
|
293
|
+
task :edit_news do
|
294
|
+
edit 'NEWS'
|
295
|
+
end
|
296
|
+
|
297
|
+
|
293
298
|
task :commit do
|
294
299
|
default = "svn commit -m 'Bump to #{SPEC.version}'"
|
295
300
|
$commit_cmd ||= ask "Type the command that you use to commit,
|
@@ -308,7 +313,7 @@ task :tag => [ :spec ] do
|
|
308
313
|
tags = SPEC.tags_url.to_s + "/#{tag_name}"
|
309
314
|
trunk = SPEC.trunk_url || SPEC.vcs_url
|
310
315
|
say "Make the SVN tag (#{trunk} -> #{tags})"
|
311
|
-
sh 'svn', 'copy', trunk.to_s, tags.to_s, '-m', "
|
316
|
+
sh 'svn', 'copy', trunk.to_s, tags.to_s, '-m', "Releasing #{tag_name}"
|
312
317
|
end
|
313
318
|
|
314
319
|
|
@@ -347,15 +352,23 @@ module Rake
|
|
347
352
|
contents = SPEC_YML.read.gsub(/^(version\s*:\s+)(.*)\s*$/) { $1 + SPEC.version.to_yaml.gsub(/^---\s*/, '') }
|
348
353
|
SPEC_YML.mv(bak)
|
349
354
|
SPEC_YML.overwrite(contents)
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
+
version_path = SPEC.version_path.to_path
|
356
|
+
TempPath.new('version.rb.bak') do |vbak|
|
357
|
+
contents = version_path.read.gsub(/Version.parse\(.*\)$/,
|
358
|
+
"Version.parse(#{SPEC.version.to_s.dump})")
|
359
|
+
version_path.mv(vbak)
|
360
|
+
version_path.overwrite(contents)
|
361
|
+
begin
|
362
|
+
task_loop :clobber, :edit_news, :check, :doc,
|
363
|
+
:package, :distcheck, :commit
|
364
|
+
rescue Exception => ex
|
365
|
+
bak.mv(SPEC_YML)
|
366
|
+
vbak.mv(version_path)
|
367
|
+
raise ex
|
368
|
+
end
|
355
369
|
end
|
356
|
-
bak.rm_f
|
357
|
-
task_loop :"after_commit_#@name"
|
358
370
|
end
|
371
|
+
Rake::Task[:"after_commit_#@name"].invoke
|
359
372
|
end
|
360
373
|
task :"after_commit_#@name" => [ :spec ] do
|
361
374
|
task_loop :tag, :publish_doc, :publish_package
|
@@ -374,11 +387,12 @@ module Rake
|
|
374
387
|
choose do |menu|
|
375
388
|
menu.prompt = 'Retry, skip, or abort? '
|
376
389
|
|
377
|
-
menu.choice :retry do
|
390
|
+
menu.choice :retry do
|
391
|
+
Rake::Task[tasks.first].instance_eval { @already_invoked = false }
|
392
|
+
end
|
378
393
|
menu.choice :skip do tasks.shift end
|
379
|
-
menu.choice :abort do
|
394
|
+
menu.choice :abort do raise ex end
|
380
395
|
end
|
381
|
-
raise ex
|
382
396
|
end
|
383
397
|
end
|
384
398
|
end
|
@@ -391,7 +405,8 @@ releases = [ :major_release,
|
|
391
405
|
:release_candidate,
|
392
406
|
:alpha_release,
|
393
407
|
:beta_release,
|
394
|
-
:pre_release
|
408
|
+
:pre_release,
|
409
|
+
:official_release ]
|
395
410
|
|
396
411
|
for release in releases do
|
397
412
|
Rake::ReleaseTask.new release
|
@@ -409,7 +424,7 @@ task :publish_package => [ :spec, :package ] do
|
|
409
424
|
|
410
425
|
rubyforge_user = SPEC.rubyforge_user || SPEC.user || ENV['USER']
|
411
426
|
rubyforge_project = SPEC.rubyforge_project || SPEC.version.name
|
412
|
-
release_name = SPEC.version.
|
427
|
+
release_name = SPEC.version.pretty_version
|
413
428
|
|
414
429
|
require 'net/http'
|
415
430
|
require 'open-uri'
|
@@ -434,6 +449,9 @@ task :publish_package => [ :spec, :package ] do
|
|
434
449
|
say "Releasing #{path.basename}..."
|
435
450
|
next unless agree 'Agree? (y/n)', true
|
436
451
|
|
452
|
+
cmd = "rubyforge add_release '#{group_id}' '#{package_name}' " +
|
453
|
+
"'#{release_name}' '#{path}' --release_notes '#{release_notes}' " +
|
454
|
+
"--release_changes '#{release_changes}' --preformatted"
|
437
455
|
unless release_id then
|
438
456
|
release = { :notes => release_notes, :changes => release_changes }
|
439
457
|
[:notes, :changes].each do |x|
|
@@ -448,11 +466,10 @@ task :publish_package => [ :spec, :package ] do
|
|
448
466
|
break if agree 'Agree? (y/n) ', true
|
449
467
|
end
|
450
468
|
end
|
451
|
-
|
452
|
-
release_id = res[/release_id: (\d+)/, 1]
|
469
|
+
release_id = `#{cmd} --show_release_id`[/release_id: (\d+)/, 1]
|
453
470
|
puts "release_id: #{release_id}"
|
454
471
|
else
|
455
|
-
system "
|
472
|
+
system "#{cmd} --release_id '#{release_id}'"
|
456
473
|
end
|
457
474
|
|
458
475
|
end
|
@@ -460,7 +477,7 @@ end
|
|
460
477
|
|
461
478
|
clean_task :publish_package do
|
462
479
|
[release_notes, release_changes].each do |x|
|
463
|
-
x.rm_f
|
480
|
+
x.rm_f if x.exist? and agree "Remove #{x}? (y/n) "
|
464
481
|
end
|
465
482
|
end
|
466
483
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved.
|
2
|
+
# Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
|
3
|
+
# License:: Gnu General Public License.
|
4
|
+
# Revision:: $Id: /w/fey/ruby_ex/trunk/core_ex/lib/core_ex/lazy_loading.rb 21865 2006-02-18T17:13:28.680350Z pouillar $
|
5
|
+
|
6
|
+
module CoreEx
|
7
|
+
|
8
|
+
Version = Version.parse("dev-ruby/core_ex-0.5")
|
9
|
+
|
10
|
+
end # module CoreEx
|
data/lib/core_ex.rb
CHANGED
data/lib/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright:: Copyright (c) 2004 Nicolas Despres. All rights reserved.
|
2
2
|
# Author:: Nicolas Despres <polrop@lrde.epita.fr>.
|
3
3
|
# License:: Gnu General Public License.
|
4
|
-
# Revision:: $Id: /w/fey/ruby_ex/trunk/core_ex/lib/version.rb
|
4
|
+
# Revision:: $Id: /w/fey/ruby_ex/trunk/core_ex/lib/version.rb 22251 2006-02-26T13:07:53.356882Z pouillar $
|
5
5
|
|
6
6
|
|
7
7
|
class Version
|
@@ -110,10 +110,10 @@ class Version
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
-
def
|
113
|
+
def pretty_version
|
114
114
|
more = ''
|
115
115
|
more << " #@release_name" unless @release_name.empty?
|
116
|
-
"#{@tag.
|
116
|
+
"#{@tag.pretty_string}: #{major_minor}#{more}"
|
117
117
|
end
|
118
118
|
|
119
119
|
def to_a
|
@@ -210,8 +210,8 @@ class Version
|
|
210
210
|
@name, @descr, @rank, @offset = name, descr, rank, offset
|
211
211
|
end
|
212
212
|
|
213
|
-
def
|
214
|
-
(offset.zero?)? descr : "#{descr}
|
213
|
+
def pretty_string
|
214
|
+
(offset.zero?)? descr : "#{descr} #{offset}"
|
215
215
|
end
|
216
216
|
|
217
217
|
def <=> ( other )
|
@@ -342,14 +342,14 @@ class VersionTest < Test::Unit::TestCase
|
|
342
342
|
assert_equal `1.0_alpha2`, `1.0_alpha1`.alpha_release
|
343
343
|
end
|
344
344
|
|
345
|
-
def
|
346
|
-
assert_equal 'Revision
|
347
|
-
assert_equal 'Official Release: 0.1', @a.
|
348
|
-
assert_equal 'Official Release: 2.0', @b.
|
349
|
-
assert_equal 'Official Release: 0.0', @c.
|
350
|
-
assert_equal 'Alpha Release: 0.1', @a_alpha.
|
351
|
-
assert_equal 'Official Release Patch Level
|
352
|
-
assert_equal 'Pre Release
|
345
|
+
def test_pretty_version
|
346
|
+
assert_equal 'Revision 462: 0.1', `0.1_r462`.pretty_version
|
347
|
+
assert_equal 'Official Release: 0.1', @a.pretty_version
|
348
|
+
assert_equal 'Official Release: 2.0', @b.pretty_version
|
349
|
+
assert_equal 'Official Release: 0.0', @c.pretty_version
|
350
|
+
assert_equal 'Alpha Release: 0.1', @a_alpha.pretty_version
|
351
|
+
assert_equal 'Official Release Patch Level 3: 2.0', @b_p3.pretty_version
|
352
|
+
assert_equal 'Pre Release 4: 1.2 bar', `dev-util/foo-1.2_pre4#bar`.pretty_version
|
353
353
|
end
|
354
354
|
|
355
355
|
def test_to_s
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: core_ex
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.5.
|
7
|
-
date: 2006-02-
|
6
|
+
version: 0.5.5.0
|
7
|
+
date: 2006-02-26 00:00:00 +01:00
|
8
8
|
summary: CoreEx is a proposal for a standard library extension.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- lib/core_ex/require.rb
|
52
52
|
- lib/core_ex/exception.rb
|
53
53
|
- lib/core_ex/enumerable.rb
|
54
|
+
- lib/core_ex/version.rb
|
54
55
|
- lib/core_ex/pathname.rb
|
55
56
|
- lib/core_ex/proc.rb
|
56
57
|
- lib/core_ex/module/attr_once.rb
|