echoe 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (8) hide show
  1. data.tar.gz.sig +0 -0
  2. data/CHANGELOG +1 -0
  3. data/Manifest +1 -0
  4. data/Rakefile +1 -0
  5. data/echoe.gemspec +38 -101
  6. data/lib/echoe.rb +145 -128
  7. metadata +3 -3
  8. metadata.gz.sig +0 -0
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v3.0.2. Support for alternative Rakefile naming.
1
2
 
2
3
  v3.0.1. Compatibility with Rubygems 1.3.
3
4
 
data/Manifest CHANGED
@@ -1,4 +1,5 @@
1
1
  CHANGELOG
2
+ echoe.gemspec
2
3
  lib/echoe/client.rb
3
4
  lib/echoe/extensions.rb
4
5
  lib/echoe/platform.rb
data/Rakefile CHANGED
@@ -9,6 +9,7 @@ Echoe.new('echoe') do |p|
9
9
  p.docs_host = 'blog.evanweaver.com:~/www/bax/public/files/doc/'
10
10
  p.runtime_dependencies = ['rake', 'rubyforge >=1.0.0', 'highline']
11
11
  p.development_dependencies = []
12
+ p.retain_gemspec = true
12
13
  p.require_signed = true
13
14
  end
14
15
 
@@ -1,105 +1,42 @@
1
+ # -*- encoding: utf-8 -*-
1
2
 
2
- # Gem::Specification for Echoe-3.0.1
3
- # Originally generated by Echoe
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{echoe}
5
+ s.version = "3.0.2"
4
6
 
5
- --- !ruby/object:Gem::Specification
6
- name: echoe
7
- version: !ruby/object:Gem::Version
8
- version: 3.0.1
9
- platform: ruby
10
- authors:
11
- - Evan Weaver
12
- autorequire:
13
- bindir: bin
14
- date: 2008-09-28 00:00:00 -07:00
15
- default_executable:
16
- dependencies:
17
- - !ruby/object:Gem::Dependency
18
- name: rake
19
- type: :runtime
20
- version_requirement:
21
- version_requirements: !ruby/object:Gem::Requirement
22
- requirements:
23
- - - ">="
24
- - !ruby/object:Gem::Version
25
- version: "0"
26
- version:
27
- - !ruby/object:Gem::Dependency
28
- name: rubyforge
29
- type: :runtime
30
- version_requirement:
31
- version_requirements: !ruby/object:Gem::Requirement
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: 1.0.0
36
- version:
37
- - !ruby/object:Gem::Dependency
38
- name: highline
39
- type: :runtime
40
- version_requirement:
41
- version_requirements: !ruby/object:Gem::Requirement
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- version: "0"
46
- version:
47
- description: A Rubygems packaging tool that provides Rake tasks for documentation, extension compiling, testing, and deployment.
48
- email: ""
49
- executables: []
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Evan Weaver"]
9
+ s.cert_chain = ["/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-public_cert.pem"]
10
+ s.date = %q{2008-10-26}
11
+ s.description = %q{A Rubygems packaging tool that provides Rake tasks for documentation, extension compiling, testing, and deployment.}
12
+ s.email = %q{}
13
+ s.extra_rdoc_files = ["CHANGELOG", "lib/echoe/client.rb", "lib/echoe/extensions.rb", "lib/echoe/platform.rb", "lib/echoe.rb", "LICENSE", "README", "TODO"]
14
+ s.files = ["CHANGELOG", "echoe.gemspec", "lib/echoe/client.rb", "lib/echoe/extensions.rb", "lib/echoe/platform.rb", "lib/echoe.rb", "LICENSE", "Manifest", "MIT-LICENSE", "Rakefile", "README", "TODO"]
15
+ s.has_rdoc = true
16
+ s.homepage = %q{http://blog.evanweaver.com/files/doc/fauna/echoe/}
17
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Echoe", "--main", "README"]
18
+ s.require_paths = ["lib"]
19
+ s.rubyforge_project = %q{fauna}
20
+ s.rubygems_version = %q{1.3.0}
21
+ s.signing_key = %q{/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-private_key.pem}
22
+ s.summary = %q{A Rubygems packaging tool that provides Rake tasks for documentation, extension compiling, testing, and deployment.}
50
23
 
51
- extensions: []
24
+ if s.respond_to? :specification_version then
25
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
26
+ s.specification_version = 2
52
27
 
53
- extra_rdoc_files:
54
- - CHANGELOG
55
- - lib/echoe/client.rb
56
- - lib/echoe/extensions.rb
57
- - lib/echoe/platform.rb
58
- - lib/echoe.rb
59
- - LICENSE
60
- - README
61
- - TODO
62
- files:
63
- - CHANGELOG
64
- - lib/echoe/client.rb
65
- - lib/echoe/extensions.rb
66
- - lib/echoe/platform.rb
67
- - lib/echoe.rb
68
- - LICENSE
69
- - Manifest
70
- - MIT-LICENSE
71
- - Rakefile
72
- - README
73
- - TODO
74
- - echoe.gemspec
75
- has_rdoc: true
76
- homepage: http://blog.evanweaver.com/files/doc/fauna/echoe/
77
- post_install_message:
78
- rdoc_options:
79
- - --line-numbers
80
- - --inline-source
81
- - --title
82
- - Echoe
83
- - --main
84
- - README
85
- require_paths:
86
- - lib
87
- required_ruby_version: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- version: "0"
92
- version:
93
- required_rubygems_version: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - ">="
96
- - !ruby/object:Gem::Version
97
- version: "1.2"
98
- version:
99
- requirements: []
100
-
101
- rubyforge_project: fauna
102
- rubygems_version: 1.3.0
103
- specification_version: 2
104
- summary: A Rubygems packaging tool that provides Rake tasks for documentation, extension compiling, testing, and deployment.
105
- test_files: []
28
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
29
+ s.add_runtime_dependency(%q<rake>, [">= 0"])
30
+ s.add_runtime_dependency(%q<rubyforge>, [">= 1.0.0"])
31
+ s.add_runtime_dependency(%q<highline>, [">= 0"])
32
+ else
33
+ s.add_dependency(%q<rake>, [">= 0"])
34
+ s.add_dependency(%q<rubyforge>, [">= 1.0.0"])
35
+ s.add_dependency(%q<highline>, [">= 0"])
36
+ end
37
+ else
38
+ s.add_dependency(%q<rake>, [">= 0"])
39
+ s.add_dependency(%q<rubyforge>, [">= 1.0.0"])
40
+ s.add_dependency(%q<highline>, [">= 0"])
41
+ end
42
+ end
@@ -1,4 +1,3 @@
1
-
2
1
  require 'rubygems'
3
2
 
4
3
  require 'rubyforge'
@@ -14,7 +13,7 @@ require 'open-uri'
14
13
  require 'highline/import'
15
14
 
16
15
  begin
17
- require 'rcov/rcovtask'
16
+ require 'rcov/rcovtask'
18
17
  rescue LoadError
19
18
  end
20
19
 
@@ -35,7 +34,7 @@ Echoe includes some optional accessors for more advanced gem configuration.
35
34
  For example, a simple <tt>Rakefile</tt> might look like this:
36
35
 
37
36
  require 'echoe'
38
-
37
+
39
38
  Echoe.new("uncapitalizer") do |p|
40
39
  p.author = "Evan Weaver"
41
40
  p.summary = "A library that uncapitalizes strings. It's awesome."
@@ -43,7 +42,7 @@ For example, a simple <tt>Rakefile</tt> might look like this:
43
42
  p.docs_host = "uncapitalizer.com:~/www/files/doc/"
44
43
  p.runtime_dependencies = ["string_tools >=1.4.0"]
45
44
  end
46
-
45
+
47
46
  See below for the full list.
48
47
 
49
48
  == Signing gems
@@ -60,21 +59,21 @@ Make sure your environment is up-to-date:
60
59
 
61
60
  Upload your <tt>public_cert.pem</tt> file to your website or Rubyforge project, and tell your users to add that certificate to their system via:
62
61
  gem cert --add /path/to/public_cert.pem
63
-
62
+
64
63
  Finally, package and release your project as normal. Now users can install your gem via:
65
64
  sudo gem install gemname -P HighSecurity
66
65
 
67
66
  Note that you can also set the key and certificate locations in the Rakefile itself. Finally, you can add <tt>p.require_signed = true</tt> to your <tt>Rakefile</tt> so that you don't accidentally release an unsigned gem if your key is missing.
68
-
67
+
69
68
  == Metadependencies
70
69
 
71
- Echoe does not force packages to depend on Echoe itself. Instead, it generates a <tt>gemspec</tt> from your <tt>Rakefile</tt> and includes that. Downstream repackagers can use the <tt>gemspec</tt> as-is to build new versions of your gem even without Echoe.
70
+ Echoe does not force packages to depend on Echoe itself. Instead, it generates a <tt>gemspec</tt> from your <tt>Rakefile</tt> and includes that. Downstream repackagers can use the <tt>gemspec</tt> as-is to build new versions of your gem even without Echoe.
72
71
 
73
72
  However, Echoe is added to the <tt>development_dependencies</tt> array so that users can automatically install it via <tt>gem install --development</tt> if they prefer. You can override this behavior by setting <tt>p.development_dependencies = []</tt>.
74
73
 
75
74
  == Cross-packaging
76
75
 
77
- Echoe supports platform Rake targets to allow you to cross-package your gems. Just write the spec assuming <tt>RUBY_PLATFORM</tt> will be what you need it to be for each architecture, and then invoke Rake with the platform name when you're cross-packaging.
76
+ Echoe supports platform Rake targets to allow you to cross-package your gems. Just write the spec assuming <tt>RUBY_PLATFORM</tt> will be what you need it to be for each architecture, and then invoke Rake with the platform name when you're cross-packaging.
78
77
 
79
78
  For example, on JRuby, <tt>rake package</tt> will build a generic <tt>-ruby</tt> type gem. But if you want to include a Java-specific extension, you can do one of two things. You can package from within JRuby by checking if <tt>RUBY_PLATFORM =~ /java/</tt> and setting <tt>p.platform = jruby</tt>, or you can run <tt>rake java package</tt>, which will set <tt>RUBY_PLATFORM</tt> and <tt>p.platform</tt> for you.
80
79
 
@@ -149,14 +148,14 @@ Documentation options:
149
148
  class Echoe
150
149
 
151
150
  # user-configurable
152
- attr_accessor :author, :changes, :clean_pattern, :description, :email, :runtime_dependencies, :development_dependencies, :need_tgz, :need_tar_gz, :need_gem, :need_zip, :rdoc_pattern, :project, :summary, :test_pattern, :url, :version, :docs_host, :rdoc_template, :manifest_name, :install_message, :extension_pattern, :private_key, :certificate_chain, :require_signed, :ruby_version, :platform, :ignore_pattern, :executable_pattern, :changelog, :rcov_options
153
-
151
+ attr_accessor :author, :changes, :clean_pattern, :description, :email, :runtime_dependencies, :development_dependencies, :need_tgz, :need_tar_gz, :need_gem, :need_zip, :rdoc_pattern, :project, :summary, :test_pattern, :url, :version, :docs_host, :rdoc_template, :manifest_name, :install_message, :extension_pattern, :private_key, :certificate_chain, :require_signed, :ruby_version, :platform, :ignore_pattern, :executable_pattern, :changelog, :rcov_options, :gemspec_format
152
+
154
153
  # best left alone
155
- attr_accessor :name, :lib_files, :test_files, :bin_files, :spec, :rdoc_options, :rubyforge_name, :has_rdoc, :include_gemspec, :include_rakefile, :gemspec_name, :eval, :files, :changelog_patterns, :rubygems_version, :use_sudo
156
-
154
+ attr_accessor :name, :lib_files, :test_files, :bin_files, :spec, :rdoc_options, :rubyforge_name, :has_rdoc, :include_gemspec, :include_rakefile, :gemspec_name, :retain_gemspec, :rakefile_name, :eval, :files, :changelog_patterns, :rubygems_version, :use_sudo
155
+
157
156
  # legacy
158
157
  attr_accessor :extra_deps, :rdoc_files, :extensions, :dependencies
159
-
158
+
160
159
  def initialize(name, _version = nil)
161
160
  # Defaults
162
161
 
@@ -168,19 +167,19 @@ class Echoe
168
167
  self.email = ""
169
168
  self.clean_pattern = ["pkg", "doc", 'build/*', '**/coverage', '**/*.o', '**/*.so', '**/*.a', 'lib/*-*', '**/*.log', "{ext,lib}/*.{bundle,so,obj,pdb,lib,def,exp}", "ext/Makefile", "{ext,lib}/**/*.{bundle,so,obj,pdb,lib,def,exp}", "ext/**/Makefile", "pkg", "*.gem", ".config"]
170
169
  self.test_pattern = File.exist?("test/test_all.rb") ? "test/test_all.rb" : ['test/**/test_*.rb', 'test/**/*_test.rb']
171
- self.ignore_pattern = /^(pkg|doc)|\.svn|CVS|\.bzr|\.DS|\.git/
172
-
170
+ self.ignore_pattern = /^(pkg|doc)|\.svn|CVS|\.bzr|\.DS|\.git/
171
+
173
172
  self.changelog_patterns = {
174
173
  :version => [
175
- /^\s*v([\d\.]+)(\.|\s|$)/,
174
+ /^\s*v([\d\.]+)(\.|\s|$)/,
176
175
  /\s*\*\s*([\d\.]+)\s*\*\s*$/
177
176
  ],
178
177
  :changes => [
179
- /^\s*v([\d\.]+\. .*)/,
178
+ /^\s*v([\d\.]+\. .*)/,
180
179
  /\*\s*[\d\.]+\s*\*\s*(.*)\*\s*[\d\.]+\s*\*$/m
181
180
  ]
182
181
  }
183
-
182
+
184
183
  self.description = ""
185
184
  self.summary = ""
186
185
  self.install_message = nil
@@ -190,12 +189,14 @@ class Echoe
190
189
  self.rcov_options = []
191
190
  self.rdoc_pattern = /^(lib|bin|tasks|ext)|^README|^CHANGELOG|^TODO|^LICENSE|^COPYING$/
192
191
 
192
+ self.gemspec_format = :ruby
193
+
193
194
  title = (name.downcase == name ? name.capitalize : name)
194
195
  self.rdoc_options = ['--line-numbers', '--inline-source', '--title', title]
195
-
196
+
196
197
  readme = Dir['*'].detect { |filename| filename =~ /^readme/i }
197
198
  self.rdoc_options += ['--main', readme] if readme
198
-
199
+
199
200
  self.runtime_dependencies = []
200
201
  self.development_dependencies = ["echoe"]
201
202
  self.manifest_name = "Manifest"
@@ -206,13 +207,15 @@ class Echoe
206
207
 
207
208
  self.need_gem = true
208
209
  self.need_tar_gz = true
209
- self.need_tgz = false
210
+ self.need_tgz = false
210
211
  self.need_zip = false
211
212
  self.platform = $platform
212
213
 
213
214
  self.include_rakefile = true
214
- self.include_gemspec = true
215
+ self.include_gemspec = true
215
216
  self.gemspec_name = "#{name}.gemspec"
217
+ self.retain_gemspec = false
218
+ self.rakefile_name = "Rakefile"
216
219
  self.rubygems_version = ">= 1.2"
217
220
 
218
221
  yield self if block_given?
@@ -222,25 +225,25 @@ class Echoe
222
225
  self.runtime_dependencies = extra_deps if extra_deps and runtime_dependencies.empty?
223
226
  self.project = rubyforge_name if rubyforge_name
224
227
  self.rdoc_pattern = rdoc_files if rdoc_files
225
- self.extension_pattern = extensions if extensions
228
+ self.extension_pattern = extensions if extensions
226
229
 
227
230
  # read manifest
228
231
  begin
229
- self.files = File.read(manifest_name).split +
230
- [(gemspec_name if include_gemspec)] +
231
- [("Rakefile" if include_rakefile)]
232
+ self.files = File.read(manifest_name).split +
233
+ [(gemspec_name if include_gemspec)] +
234
+ [(rakefile_name if include_rakefile)]
232
235
  self.files = files.compact.uniq
233
236
  rescue Errno::ENOENT
234
237
  unless ARGV.include? "manifest"
235
238
  puts "Missing manifest. You can build one with 'rake manifest'."
236
- exit
239
+ exit 1
237
240
  else
238
241
  self.files = []
239
242
  end
240
- end
241
-
243
+ end
244
+
242
245
  # snag version and changeset
243
- self.version ||= _version
246
+ self.version ||= _version
244
247
  unless version
245
248
  if File.exist? changelog
246
249
  parsed = Array(changelog_patterns[:version]).map do |pattern|
@@ -263,8 +266,8 @@ class Echoe
263
266
  end.compact.first or ""
264
267
  else
265
268
  ""
266
- end
267
-
269
+ end
270
+
268
271
  # set some post-defaults
269
272
  self.certificate_chain = Array(certificate_chain).map {|file| File.expand_path(file)}
270
273
  self.private_key = File.expand_path(private_key) if private_key
@@ -275,11 +278,11 @@ class Echoe
275
278
  self.ignore_pattern = apply_pattern(ignore_pattern)
276
279
  self.rdoc_pattern = apply_pattern(rdoc_pattern, files) - [manifest_name]
277
280
  self.executable_pattern = apply_pattern(executable_pattern, files)
278
- self.test_pattern = apply_pattern(test_pattern)
281
+ self.test_pattern = apply_pattern(test_pattern)
279
282
 
280
283
  define_tasks
281
284
  end
282
-
285
+
283
286
  def apply_pattern(pattern, files = nil)
284
287
  files ||= Dir['**/**']
285
288
  case pattern
@@ -288,9 +291,17 @@ class Echoe
288
291
  Dir.glob(p)
289
292
  end.flatten)
290
293
  when Regexp
291
- files.select do |file|
294
+ files.select do |file|
292
295
  file =~ pattern
293
296
  end
297
+ when FileList
298
+ pattern.each do |ignorefile|
299
+ ignorefiles = File.open(ignorefile).to_a.map(&:chomp)
300
+ files = files.select do |file|
301
+ ignorefiles.map { |i| File.fnmatch(i, file) }.include?(true)
302
+ end
303
+ end
304
+ files
294
305
  else
295
306
  []
296
307
  end
@@ -299,7 +310,7 @@ class Echoe
299
310
  def define_tasks
300
311
 
301
312
  ### Packaging and Installing
302
-
313
+
303
314
  self.spec = Gem::Specification.new do |s|
304
315
  s.name = name
305
316
  s.version = version
@@ -333,17 +344,17 @@ class Echoe
333
344
  end
334
345
 
335
346
  s.files = files
336
-
347
+
337
348
  s.bindir = if executable_pattern.any?
338
349
  executable_pattern[0].split("/")[0]
339
350
  else
340
351
  "bin"
341
352
  end
342
-
353
+
343
354
  s.executables = executable_pattern.map do |file|
344
355
  file[(s.bindir.length + 1)..-1]
345
356
  end
346
-
357
+
347
358
  dirs = Dir['{lib,ext}']
348
359
  s.extensions = extension_pattern if extension_pattern.any?
349
360
  s.require_paths = dirs unless dirs.empty?
@@ -354,11 +365,11 @@ class Echoe
354
365
  else
355
366
  s.test_files = test_pattern
356
367
  end
357
-
368
+
358
369
  if eval
359
370
  s.instance_eval &eval
360
371
  end
361
-
372
+
362
373
  end
363
374
 
364
375
  self.lib_files = spec.files.grep(/^lib/)
@@ -370,35 +381,41 @@ class Echoe
370
381
  pkg.need_tar_gz = @need_tar_gz
371
382
  pkg.need_zip = @need_zip
372
383
  end
373
-
384
+
374
385
  task :build_gemspec do
375
386
  # Construct the gemspec file, if needed.
376
387
  if include_gemspec
377
388
  File.open(gemspec_name, 'w') do |f|
378
- f.puts "\n# Gem::Specification for #{name.capitalize}-#{version}\n# Originally generated by Echoe\n\n"
379
- spec.to_yaml.split("\n").each do |line|
380
- # Don't publish any information about the private key or certificate chain
381
- f.puts line unless line =~ /signing_key|cert_chain|\.pem/
382
- end
389
+ case gemspec_format
390
+ when :yaml
391
+ spec.to_yaml.split("\n").each do |line|
392
+ # Don't publish any information about the private key or certificate chain
393
+ f.puts line unless line =~ /signing_key|cert_chain|\.pem/
394
+ end
395
+ when :ruby
396
+ f.puts spec.to_ruby
397
+ else
398
+ raise "Unknown gemspec format #{gemspec_format.inspect}. Supported formats: :ruby and :yaml"
399
+ end
383
400
  end
384
- end
401
+ end
385
402
  end
386
-
403
+
387
404
  # Chain it to the gemspec task prerequisite
388
- task gemspec_name.to_sym => [:build_gemspec]
389
-
405
+ task gemspec_name.to_sym => [:build_gemspec]
406
+
390
407
  task :package do
391
408
  # Chain some cleanup tasks to the default :package task.
392
- # Remove the gemfile if it wasn't actually requested.
409
+ # Remove the gemfile if it wasn't actually requested.
393
410
  unless @need_gem
394
411
  puts " Gem file not requested. Removed."
395
412
  system "rm pkg/*.gem"
396
413
  end
397
414
  # Remove the generated gemspec once the packaging is done, to discourage people from modifying it by hand.
398
- if include_gemspec and File.exist? gemspec_name
415
+ if include_gemspec and File.exist? gemspec_name and not retain_gemspec
399
416
  File.delete gemspec_name
400
417
  end
401
-
418
+
402
419
  # Test signing status
403
420
  if private_key and File.exist? private_key
404
421
  puts "Signing gem."
@@ -407,13 +424,13 @@ class Echoe
407
424
  puts "Private key not found; gem will not be signed."
408
425
  end
409
426
  puts "Targeting \"#{platform}\" platform."
410
- end
427
+ end
411
428
 
412
429
  desc 'Install the gem'
413
430
  task :install => [:clean, :package, :uninstall] do
414
431
  system "#{'sudo' if use_sudo} gem install pkg/*.gem -P MediumSecurity --no-update-sources"
415
432
  end
416
-
433
+
417
434
  namespace :install do
418
435
  desc 'Install the gem including development dependencies'
419
436
  task :development => [:clean, :package, :uninstall] do
@@ -427,52 +444,52 @@ class Echoe
427
444
  end
428
445
 
429
446
  desc 'Package and upload the release to Rubyforge'
430
- task :release => [:clean, :package] do |t|
431
-
447
+ task :release => [:clean, :package] do |t|
448
+
432
449
  say "\n"
433
- if agree "Release #{name}-#{version} to Rubyforge? "
450
+ if agree "Release #{name}-#{version} to Rubyforge? "
434
451
  pkg = "pkg/#{name}-#{version}"
435
452
  pkg_gem = pkg + ".gem"
436
453
  pkg_tar = pkg + ".tgz"
437
454
  pkg_tar_gz = pkg + ".tar.gz"
438
- pkg_zip = pkg + ".zip"
439
-
440
- rf = RubyForge.new.configure
455
+ pkg_zip = pkg + ".zip"
456
+
457
+ rf = RubyForge.new.configure
441
458
  puts "Logging in"
442
459
  rf.login
443
-
460
+
444
461
  c = rf.userconfig
445
462
  c["release_notes"] = description if description
446
463
  c["release_changes"] = changes if changes
447
464
  c["preformatted"] = false
448
-
465
+
449
466
  files = [(@need_tgz ? pkg_tar : nil),
450
467
  (@need_tar_gz ? pkg_tar_gz : nil),
451
468
  (@need_zip ? pkg_zip : nil),
452
469
  (@need_gem ? pkg_gem : nil)].compact
453
-
470
+
454
471
  puts "Releasing #{name} v. #{version}"
455
472
  self.version = self.version.ljust(3)
456
-
473
+
457
474
  rf.add_release project, name, version, *files
458
475
  end
459
-
476
+
460
477
  end
461
-
478
+
462
479
  ### Extension building
463
480
 
464
481
  task :lib do
465
482
  directory "lib"
466
483
  end
467
-
484
+
468
485
  if extension_pattern.any?
469
-
486
+
470
487
  desc "Compile the binary extension module"
471
- task :compile => [:lib] do
472
- extension_pattern.each do |extension|
488
+ task :compile => [:lib] do
489
+ extension_pattern.each do |extension|
473
490
  ext_dir = File.dirname(extension)
474
491
  lib_target = nil
475
- Dir.chdir(ext_dir) do
492
+ Dir.chdir(ext_dir) do
476
493
  ruby File.basename(extension)
477
494
  system(PLATFORM =~ /win32/ ? 'nmake' : 'make')
478
495
  lib_target = open('Makefile').readlines.grep(/target_prefix = /).first.split('=').last.chomp("\n").strip
@@ -484,35 +501,35 @@ class Echoe
484
501
  end
485
502
  end
486
503
  end
487
-
504
+
488
505
  task :test => [:compile]
489
-
506
+
490
507
  end
491
-
508
+
492
509
  ### Cross-platform targets
493
-
510
+
494
511
  Gem::Specification::PLATFORM_CROSS_TARGETS.each do |target|
495
- task target do
512
+ task target do
496
513
  reset_target target
497
514
  end
498
515
  end
499
-
516
+
500
517
  ### Documentation
501
518
 
502
- Rake::RDocTask.new(:docs) do |rd|
519
+ Rake::RDocTask.new(:docs) do |rd|
503
520
  # rd.main = Dir['*'].detect {|f| f =~ /^readme/i}
504
521
  rd.options += Array(rdoc_options)
505
-
506
- rd.rdoc_dir = 'doc'
522
+
523
+ rd.rdoc_dir = 'doc'
507
524
  rd.rdoc_files.push(*rdoc_pattern)
508
525
 
509
526
  if rdoc_template
510
- rd.template = rdoc_template
527
+ rd.template = rdoc_template
511
528
  elsif ENV['RDOC_TEMPLATE']
512
529
  rd.template = ENV['RDOC_TEMPLATE']
513
- end
530
+ end
514
531
  end
515
-
532
+
516
533
  task :doc => [:redocs]
517
534
 
518
535
  desc "Publish documentation to #{docs_host ? "'#{docs_host}'" : "rubyforge"}"
@@ -522,10 +539,10 @@ class Echoe
522
539
  remote_dir_name = project
523
540
  remote_dir_name += "/#{name}" if project != name
524
541
 
525
- unless docs_host
542
+ unless docs_host
526
543
  config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
527
- pub = Rake::SshDirPublisher.new "#{config["username"]}@rubyforge.org",
528
- "/var/www/gforge-projects/#{remote_dir_name}",
544
+ pub = Rake::SshDirPublisher.new "#{config["username"]}@rubyforge.org",
545
+ "/var/www/gforge-projects/#{remote_dir_name}",
529
546
  local_dir
530
547
  if project != name then
531
548
  def pub.upload
@@ -539,29 +556,29 @@ class Echoe
539
556
  end
540
557
  end
541
558
  end
542
- pub.upload
559
+ pub.upload
543
560
  else
544
561
  # you may need ssh keys configured for this to work
545
562
  host, dir = docs_host.split(":")
546
563
  dir.chomp!("/")
547
-
564
+
548
565
  # XXX too dangerous?
549
566
  cmd = "ssh #{host} 'rm -rf #{dir}/#{remote_dir_name}'"
550
567
  puts "Deleting existing docs: #{cmd}"
551
- system(cmd)
552
-
568
+ system(cmd)
569
+
553
570
  cmd = "scp -qr #{local_dir} #{host}:#{dir}/#{remote_dir_name}"
554
571
  puts "Uploading: #{cmd}"
555
572
  system(cmd)
556
- end
573
+ end
557
574
  end
558
-
575
+
559
576
  desc 'Generate a release announcement, edit it, and post it to Rubyforge.'
560
577
  task :announce do
561
-
578
+
562
579
  filename = "/tmp/#{name}_#{version}_announcement.txt"
563
-
564
- if !File.exist?(filename) or agree "Overwrite existing announcement file? "
580
+
581
+ if !File.exist?(filename) or agree "Overwrite existing announcement file? "
565
582
  File.open(filename, 'w') do |f|
566
583
  f.write "Subject: #{name.capitalize} #{version}\n\n"
567
584
  f.write "#{name.capitalize} has been updated to #{version}. #{name.capitalize} is #{summary.uncapitalize}\n\n"
@@ -569,27 +586,27 @@ class Echoe
569
586
  f.write "More information is available at #{url} .\n\n" unless url.empty?
570
587
  end
571
588
  end
572
-
573
- begin
574
- editor = ENV['EDITOR'] || 'nano'
589
+
590
+ begin
591
+ editor = ENV['EDITOR'] || 'nano'
575
592
  system("#{editor} #{filename}") or raise "Editor '#{editor}' failed to start"
576
593
  puts File.open(filename).read
577
594
  end while !agree "Done editing? "
578
-
595
+
579
596
  if agree "Publish announcement to Rubyforge? "
580
597
  File.open(filename).readlines.detect { |line| line =~ /Subject: (.*)/ }
581
598
  subject = $1 or raise "Subject line seems to have disappeared"
582
-
599
+
583
600
  body = File.open(filename).readlines.reject { |line| line =~ /Subject: / }.join.gsub("\n\n\n", "\n\n")
584
-
585
- rf = RubyForge.new.configure
601
+
602
+ rf = RubyForge.new.configure
586
603
  rf.login
587
604
  rf.post_news(project, subject, body)
588
605
  puts "Published."
589
606
  File.delete filename
590
607
  end
591
- end
592
-
608
+ end
609
+
593
610
  ### Clean
594
611
 
595
612
  desc 'Clean up auto-generated files'
@@ -602,7 +619,7 @@ class Echoe
602
619
  end
603
620
  end
604
621
  end
605
-
622
+
606
623
  ### Manifest
607
624
 
608
625
  desc "Build a Manifest list"
@@ -614,16 +631,16 @@ class Echoe
614
631
  next unless file
615
632
  next if ignore_pattern.include?(file)
616
633
  next if File.directory?(file)
617
- next if !include_rakefile and file == "Rakefile"
634
+ next if !include_rakefile and file == rakefile_name
618
635
  files << file
619
636
  end
620
637
 
621
- files << "Rakefile" if include_rakefile
638
+ files << rakefile_name if include_rakefile
622
639
  files << manifest_name
623
640
  files.uniq!
624
-
641
+
625
642
  File.open(manifest_name, 'w').puts(files)
626
-
643
+
627
644
  (files | old_files).sort.each do |file|
628
645
  next if file == gemspec_name
629
646
  sign = " "
@@ -635,57 +652,57 @@ class Echoe
635
652
  puts "#{sign} #{file}"
636
653
  end
637
654
  end
638
-
655
+
639
656
  task :build_manifest => :manifest
640
-
657
+
641
658
  ### Testing
642
-
659
+
643
660
  if test_pattern.any?
644
-
661
+
645
662
  Rake::TestTask.new(:test_inner) do |t|
646
663
  t.libs = ['lib', 'ext', 'bin', 'test']
647
664
  t.test_files = test_pattern
648
665
  t.verbose = true
649
666
  end
650
-
667
+
651
668
  desc "Run the test suite"
652
669
  task :test do
653
- if File.exist? 'test/setup.rb'
670
+ if File.exist? 'test/setup.rb'
654
671
  Echoe.silence do
655
672
  puts "Setting up test environment"
656
673
  system("ruby test/setup.rb")
657
674
  end
658
675
  end
659
676
  begin
660
- test = Rake::Task[:test_inner]
677
+ test = Rake::Task[:test_inner]
661
678
  if test.respond_to? :already_invoked=
662
679
  # Method provided by MultiRails
663
680
  test.already_invoked = false
664
681
  end
665
682
  test.invoke
666
- ensure
667
- if File.exist? 'test/teardown.rb'
668
- Echoe.silence do
683
+ ensure
684
+ if File.exist? 'test/teardown.rb'
685
+ Echoe.silence do
669
686
  puts "Tearing down test environment"
670
687
  system("ruby test/teardown.rb")
671
688
  end
672
689
  end
673
- end
690
+ end
674
691
  end
675
-
692
+
676
693
  end
677
-
694
+
678
695
  task :default => :test
679
-
680
- if defined? Rcov
696
+
697
+ if defined? Rcov
681
698
  Rcov::RcovTask.new(:coverage) do |t|
682
699
  t.test_files = test_pattern
683
700
  t.rcov_opts << rcov_options if rcov_options
684
701
  t.verbose = true
685
- end
702
+ end
686
703
  task :rcov => :coverage
687
704
  end
688
-
705
+
689
706
  end
690
707
  end
691
708
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: echoe
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Weaver
@@ -30,7 +30,7 @@ cert_chain:
30
30
  yZ0=
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2008-09-28 00:00:00 -07:00
33
+ date: 2008-10-26 00:00:00 -07:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
@@ -80,6 +80,7 @@ extra_rdoc_files:
80
80
  - TODO
81
81
  files:
82
82
  - CHANGELOG
83
+ - echoe.gemspec
83
84
  - lib/echoe/client.rb
84
85
  - lib/echoe/extensions.rb
85
86
  - lib/echoe/platform.rb
@@ -90,7 +91,6 @@ files:
90
91
  - Rakefile
91
92
  - README
92
93
  - TODO
93
- - echoe.gemspec
94
94
  has_rdoc: true
95
95
  homepage: http://blog.evanweaver.com/files/doc/fauna/echoe/
96
96
  post_install_message:
metadata.gz.sig CHANGED
Binary file