echoe 1.0.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/echoe.rb +36 -12
- metadata +3 -3
data/lib/echoe.rb
CHANGED
@@ -89,7 +89,7 @@ require 'rbconfig'
|
|
89
89
|
# * RUBY_FLAGS - Used to specify flags to ruby [has smart default].
|
90
90
|
|
91
91
|
class Echoe
|
92
|
-
VERSION = '1.
|
92
|
+
VERSION = '1.1'
|
93
93
|
|
94
94
|
rubyprefix = Config::CONFIG['prefix']
|
95
95
|
sitelibdir = Config::CONFIG['sitelibdir']
|
@@ -106,7 +106,7 @@ class Echoe
|
|
106
106
|
(RUBY_DEBUG ? " #{RUBY_DEBUG}" : '')
|
107
107
|
FILTER = ENV['FILTER'] # for tests (eg FILTER="-n test_blah")
|
108
108
|
|
109
|
-
attr_accessor :author, :bin_files, :changes, :clean_globs, :description, :email, :extra_deps, :lib_files, :name, :need_tar, :need_zip, :rdoc_pattern, :rubyforge_name, :spec, :spec_extras, :summary, :test_files, :test_globs, :url, :version
|
109
|
+
attr_accessor :author, :bin_files, :changes, :clean_globs, :description, :email, :extra_deps, :lib_files, :name, :need_tar, :need_tar_gz, :need_zip, :rdoc_pattern, :rubyforge_name, :spec, :spec_extras, :summary, :test_files, :test_globs, :url, :version, :tar_extension #, :tar_separator, :zip_separator
|
110
110
|
|
111
111
|
def initialize(name, version)
|
112
112
|
self.name = name
|
@@ -126,7 +126,10 @@ class Echoe
|
|
126
126
|
self.extra_deps = []
|
127
127
|
self.spec_extras = {}
|
128
128
|
self.need_tar = true
|
129
|
+
self.need_tar_gz = false
|
129
130
|
self.need_zip = false
|
131
|
+
# self.tar_separator = "." # separator choice is buried in rake/packagetask, bah
|
132
|
+
# self.zip_separator = "."
|
130
133
|
|
131
134
|
if name == 'echoe' then
|
132
135
|
extra_deps << ['rake']
|
@@ -188,7 +191,9 @@ class Echoe
|
|
188
191
|
s.add_dependency(*dep)
|
189
192
|
end
|
190
193
|
|
191
|
-
|
194
|
+
manifest = "Manifest"
|
195
|
+
manifest += ".txt" if File.exist? "Manifest.txt"
|
196
|
+
s.files = File.read(manifest).split
|
192
197
|
s.executables = s.files.grep(/bin/) { |f| File.basename(f) }
|
193
198
|
|
194
199
|
s.bindir = "bin"
|
@@ -224,6 +229,7 @@ class Echoe
|
|
224
229
|
|
225
230
|
Rake::GemPackageTask.new spec do |pkg|
|
226
231
|
pkg.need_tar = @need_tar
|
232
|
+
pkg.need_tar_gz = @need_tar_gz
|
227
233
|
pkg.need_zip = @need_zip
|
228
234
|
end
|
229
235
|
|
@@ -259,12 +265,19 @@ class Echoe
|
|
259
265
|
task :release => [:clean, :package] do |t|
|
260
266
|
v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
|
261
267
|
abort "Versions don't match #{v} vs #{version}" if v != version
|
268
|
+
|
269
|
+
gem 'rubyforge', '= 0.4.0'
|
262
270
|
require 'rubyforge'
|
263
|
-
pkg = "pkg/#{name}-#{version}"
|
264
271
|
|
272
|
+
pkg = "pkg/#{name}-#{version}"
|
273
|
+
pkg_gem = pkg + ".gem"
|
274
|
+
pkg_tar = pkg + ".tgz"
|
275
|
+
pkg_tar_gz = pkg + ".tar.gz"
|
276
|
+
pkg_zip = pkg + ".zip"
|
277
|
+
|
265
278
|
if $DEBUG then
|
266
|
-
puts "release_id = rf.add_release #{rubyforge_name.inspect}, #{name.inspect}, #{version.inspect}, \"#{
|
267
|
-
puts "rf.add_file #{rubyforge_name.inspect}, #{name.inspect}, release_id, \"#{
|
279
|
+
puts "release_id = rf.add_release #{rubyforge_name.inspect}, #{name.inspect}, #{version.inspect}, \"#{pkg_tar}\""
|
280
|
+
puts "rf.add_file #{rubyforge_name.inspect}, #{name.inspect}, release_id, \"#{pkg_gem}\""
|
268
281
|
end
|
269
282
|
|
270
283
|
rf = RubyForge.new
|
@@ -276,12 +289,19 @@ class Echoe
|
|
276
289
|
c["release_changes"] = changes if changes
|
277
290
|
c["preformatted"] = true
|
278
291
|
|
279
|
-
files = [(@need_tar ?
|
280
|
-
|
281
|
-
|
292
|
+
files = [(@need_tar ? pkg_tar : nil),
|
293
|
+
(@need_tar_gz ? pkg_tar_gz : nil),
|
294
|
+
(@need_zip ? pkg_zip : nil),
|
295
|
+
pkg_gem].compact
|
282
296
|
|
283
297
|
puts "Releasing #{name} v. #{version}"
|
284
|
-
|
298
|
+
self.version = self.version.ljust(3)
|
299
|
+
|
300
|
+
begin
|
301
|
+
rf.add_release rubyforge_name, name, version, *files
|
302
|
+
rescue NoMethodError => boom
|
303
|
+
puts "If you are releasing a package for the first time, don't panic.\nOtherwise, it seems that this release already exists."
|
304
|
+
end
|
285
305
|
end
|
286
306
|
|
287
307
|
############################################################
|
@@ -292,7 +312,7 @@ class Echoe
|
|
292
312
|
rd.options << '-d' if RUBY_PLATFORM !~ /win32/ and `which dot` =~ /\/dot/
|
293
313
|
rd.rdoc_dir = 'doc'
|
294
314
|
files = spec.files.grep(rdoc_pattern)
|
295
|
-
files -= ['Manifest.txt']
|
315
|
+
files -= ['Manifest.txt', 'Manifest']
|
296
316
|
rd.rdoc_files.push(*files)
|
297
317
|
|
298
318
|
title = "#{name}-#{version} Documentation"
|
@@ -389,7 +409,11 @@ class Echoe
|
|
389
409
|
end
|
390
410
|
files = files.sort.join "\n"
|
391
411
|
File.open f, 'w' do |fp| fp.puts files end
|
392
|
-
|
412
|
+
|
413
|
+
manifest = "Manifest"
|
414
|
+
manifest += ".txt" if File.exist? "Manifest.txt"
|
415
|
+
|
416
|
+
system "diff -du #{manifest}.txt #{f}"
|
393
417
|
rm f
|
394
418
|
end
|
395
419
|
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.2
|
3
3
|
specification_version: 1
|
4
4
|
name: echoe
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.
|
7
|
-
date: 2007-
|
6
|
+
version: "1.1"
|
7
|
+
date: 2007-02-06 00:00:00 -05:00
|
8
8
|
summary: Echoe makes gem creation easy.
|
9
9
|
require_paths:
|
10
10
|
- lib
|