echoe 2.6.4 → 2.7.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.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,4 +1,8 @@
1
1
 
2
+ vSVN. support compiling without extension registration for win32 and java targets.
3
+
4
+ v2.7.0. Add coverage task; change default test pattern; Rubygems 0.9.4.5 compatibility and requirement. Cross-packaging hacks for same. Add rubygems_version accessor. Manifest alerts about removed files now as well as added. Allow targeting of every platform on RubyGems 0.9.5.
5
+
2
6
  v2.6.4. Fix related issue.
3
7
 
4
8
  v2.6.3. Fix issue with shared object paths in :compile task.
data/Manifest CHANGED
@@ -1,4 +1,5 @@
1
1
  CHANGELOG
2
+ lib/echoe/platform.rb
2
3
  lib/echoe.rb
3
4
  LICENSE
4
5
  Manifest
data/README CHANGED
@@ -70,13 +70,14 @@ The following tasks are made available to your gem.
70
70
 
71
71
  Packaging:
72
72
 
73
- * <tt>manifest</tt> - Build a manifest list.
73
+ * <tt>manifest</tt> - Build a manifest list. Shows added and removed files.
74
74
  * <tt>docs</tt> - Build the documentation.
75
75
  * <tt>package</tt> - Build all the packages.
76
76
 
77
77
  Testing:
78
78
 
79
79
  * <tt>test</tt> - Run the test suite.
80
+ * <tt>coverage</tt> - Generate a coverage report.
80
81
  * <tt>compile</tt> - Compile C extensions, if available.
81
82
  * <tt>clean</tt> - Clean up generated documentation, packaging, and build files.
82
83
  * <tt>install</tt> - Install the gem locally.
data/Rakefile CHANGED
@@ -7,8 +7,9 @@ Echoe.new('echoe') do |p|
7
7
  p.summary = 'A tool for packaging Ruby gems.'
8
8
  p.url = 'http://blog.evanweaver.com/files/doc/fauna/echoe/'
9
9
  p.docs_host = 'blog.evanweaver.com:~/www/bax/public/files/doc/'
10
- p.dependencies = ['rake', 'rubyforge >=0.4.3', 'highline']
10
+ p.dependencies = ['rake', 'rubyforge >=0.4.3', 'highline', 'rcov']
11
11
  p.require_signed = true
12
+ p.rubygems_version = '>= 0.9.4.5'
12
13
 
13
14
  # Echoe is self-dependent
14
15
  p.include_gemspec = false
@@ -9,9 +9,14 @@ require 'rake/testtask'
9
9
  require 'rbconfig'
10
10
  require 'open-uri'
11
11
  require 'highline/import'
12
+ require 'rcov/rcovtask'
13
+
12
14
  gem 'rubyforge', '>=0.4.0'
13
15
  require 'rubyforge'
14
16
 
17
+ $LOAD_PATH << File.dirname(__FILE__)
18
+ require 'echoe/platform'
19
+
15
20
  =begin rdoc
16
21
 
17
22
  Echoe includes some optional accessors for more advanced gem configuration.
@@ -56,6 +61,14 @@ Echoe does not force packages to depend on Echoe itself. Instead, it generates a
56
61
 
57
62
  If you do want metadependencies, add <tt>'echoe'</tt> to the <tt>p.dependencies</tt> array, and set <tt>p.include_rakefile = true</tt> and <tt>p.include_gemspec = false</tt>.
58
63
 
64
+ == Cross-packaging
65
+
66
+ 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.
67
+
68
+ 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.
69
+
70
+ This way you can run <tt>rake java package</tt>, <tt>rake aix install</tt>, or whatever task you need and Echoe will behave just like you're packaging from within the target platform.
71
+
59
72
  == Accessor options
60
73
 
61
74
  Descriptive options:
@@ -76,8 +89,12 @@ Common packaging options:
76
89
 
77
90
  * <tt>dependencies</tt> - An array of dependencies for this gem. For example, <tt>['mongrel', 'rake >=0.7.1']</tt>.
78
91
  * <tt>extension_pattern</tt> - A filename array, glob array, or regex for extension files that need to be run at install time. Defaults to <tt>"ext/**/extconf.rb"</tt>.
92
+
93
+ Testing options:
94
+
79
95
  * <tt>clean_pattern</tt> - A filename array, glob array, or regex for files that should be removed when <tt>rake clean</tt> is run.
80
96
  * <tt>test_pattern</tt> - A filename array, glob array, or regex for test runners. Overridden by <tt>"test/test_all.rb"</tt>, if it exists.
97
+ * <tt>rcov_options</tt> - Any extra flags to pass to RCov when coverage reports are run.
81
98
 
82
99
  Uncommon packaging options:
83
100
  * <tt>platform</tt> - What platform this gem is for.
@@ -126,13 +143,12 @@ class Echoe
126
143
  RUBY_FLAGS = ENV['RUBY_FLAGS'] ||
127
144
  "-w -I#{%w(lib ext bin test).join(File::PATH_SEPARATOR)}" +
128
145
  (RUBY_DEBUG ? " #{RUBY_DEBUG}" : '')
129
- FILTER = ENV['FILTER'] # for tests (eg FILTER="-n test_blah")
130
146
 
131
147
  # user-configurable
132
- attr_accessor :author, :changes, :clean_pattern, :description, :email, :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
148
+ attr_accessor :author, :changes, :clean_pattern, :description, :email, :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
133
149
 
134
150
  # best left alone
135
- 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
151
+ 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
136
152
 
137
153
  # legacy
138
154
  attr_accessor :extra_deps, :rdoc_files, :extensions
@@ -147,8 +163,8 @@ class Echoe
147
163
  self.author = ""
148
164
  self.email = ""
149
165
  self.clean_pattern = ["pkg", "doc", 'build/*', '**/*.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"]
150
- self.test_pattern = ['test/**/test_*.rb']
151
- self.ignore_pattern = /^(pkg|doc)|\.svn|CVS|\.bzr|\.DS|\.git/
166
+ self.test_pattern = File.exist?("test/test_all.rb") ? "test/test_all.rb" : ['test/**/test_*.rb']
167
+ self.ignore_pattern = /^(pkg|doc)|\.svn|CVS|\.bzr|\.DS|\.git/
152
168
 
153
169
  self.changelog_patterns = {
154
170
  :version => [
@@ -164,9 +180,9 @@ class Echoe
164
180
  self.description = ""
165
181
  self.summary = ""
166
182
  self.install_message = nil
183
+ self.executable_pattern = /^bin\//
167
184
  self.has_rdoc = true
168
185
  self.rdoc_pattern = /^(lib|bin|tasks|ext)|^README|^CHANGELOG|^TODO|^LICENSE|^COPYING$/
169
- self.executable_pattern = /^bin\//
170
186
  self.rdoc_options = ['--line-numbers', '--inline-source']
171
187
  self.dependencies = []
172
188
  self.manifest_name = "Manifest"
@@ -179,6 +195,7 @@ class Echoe
179
195
  self.need_tar_gz = true
180
196
  self.need_tgz = false
181
197
  self.need_zip = false
198
+ self.platform = $platform
182
199
 
183
200
  self.include_rakefile = false
184
201
  self.include_gemspec = true
@@ -279,7 +296,8 @@ class Echoe
279
296
  s.post_install_message = install_message if install_message
280
297
  s.description = description
281
298
  s.required_ruby_version = ruby_version
282
- s.platform = platform if platform
299
+ s.required_rubygems_version = rubygems_version if rubygems_version
300
+ s.platform = platform
283
301
 
284
302
  if private_key and File.exist? private_key
285
303
  s.signing_key = private_key
@@ -370,11 +388,12 @@ class Echoe
370
388
  else
371
389
  raise "Key required, but not found. Maybe you forget to set ENV['GEM_PRIVATE_KEY']?" if require_signed
372
390
  puts "Private key not found; gem will not be signed."
373
- end
391
+ end
392
+ puts "Targeting \"#{platform}\" platform."
374
393
  end
375
394
 
376
395
  desc 'Install the gem'
377
- task :install => [:clean, :package] do
396
+ task :install => [:clean, :package, :uninstall] do
378
397
  system "sudo gem install pkg/*.gem -P MediumSecurity"
379
398
  end
380
399
 
@@ -445,6 +464,14 @@ class Echoe
445
464
 
446
465
  end
447
466
 
467
+ ### Cross-platform targets
468
+
469
+ Gem::Specification::PLATFORM_CROSS_TARGETS.each do |target|
470
+ task target do
471
+ reset_target target
472
+ end
473
+ end
474
+
448
475
  ### Documentation
449
476
 
450
477
  Rake::RDocTask.new(:docs) do |rd|
@@ -577,29 +604,40 @@ class Echoe
577
604
  files.uniq!
578
605
 
579
606
  File.open(manifest_name, 'w').puts(files)
580
- puts(files.map do |file|
581
- (old_files.include?(file) ? " " : "+") + " " + file
582
- end)
607
+
608
+ (files | old_files).sort.each do |file|
609
+ sign = " "
610
+ if old_files.include?(file) and !files.include?(file)
611
+ sign = "-"
612
+ elsif files.include?(file) and !old_files.include?(file)
613
+ sign = "+"
614
+ end
615
+ puts "#{sign} #{file}"
616
+ end
583
617
  end
584
618
 
585
- task :build_manifest => [:manifest]
619
+ task :build_manifest => :manifest
586
620
 
587
- ### Tests
621
+ ### Testing
588
622
 
589
- # XXX unreadable
590
623
  desc 'Run the test suite'
591
624
  task :test do
592
- ruby(if File.exist? 'test/test_all.rb'
593
- "#{RUBY_FLAGS} test/test_all.rb #{FILTER}"
594
- else
595
- tests = test_pattern << 'test/unit'
596
- tests.map! {|f| %Q(require "#{f}")}
597
- "#{RUBY_FLAGS} -e '#{tests.join("; ")}' #{FILTER}"
598
- end)
625
+ tests = test_pattern.map do |file|
626
+ "require \"#{file}\"; "
627
+ end
628
+ ruby "#{RUBY_FLAGS} -e '#{tests}'"
599
629
  end
600
630
 
601
631
  task :default => :test
602
632
 
633
+ Rcov::RcovTask.new(:coverage) do |t|
634
+ t.test_files = test_pattern
635
+ t.rcov_options << rcov_options if rcov_options
636
+ t.verbose = true
637
+ end
638
+
639
+ task :rcov => :coverage
640
+
603
641
  end
604
642
  end
605
643
 
@@ -0,0 +1,40 @@
1
+
2
+ module Gem
3
+
4
+ # Overrides for cross packaging, which Rubygems 0.9.5 doesn't do
5
+ class Specification
6
+
7
+ alias :old_validate :validate
8
+
9
+ PLATFORM_CROSS_TARGETS = ["aix", "cygwin", "darwin", "freebsd", "hpux", "java", "linux", "mingw", "mswin", "netbsdelf", "openbsd", "solaris", "test", "_platform", "jruby"]
10
+
11
+ def validate
12
+ begin
13
+ old_validate
14
+ rescue Gem::InvalidSpecificationException
15
+ if platform =~ /(#{PLATFORM_CROSS_TARGETS.join("|")})/i
16
+ true
17
+ else
18
+ raise Gem::InvalidSpecificationException, "Unknown package target \"#{platform}\"."
19
+ end
20
+ end
21
+ end
22
+
23
+ end
24
+ end
25
+
26
+ $platform = "ruby"
27
+
28
+ def reset_target target #:nodoc:
29
+ $platform = target
30
+ Object.send(:remove_const, "RUBY_PLATFORM")
31
+ Object.send(:const_set, "RUBY_PLATFORM", target)
32
+ end
33
+
34
+ if target = ARGV.detect do |arg|
35
+ # Hack to get the platform set before the Rakefile evaluates
36
+ Gem::Specification::PLATFORM_CROSS_TARGETS.include? arg
37
+ end
38
+ reset_target target
39
+ end
40
+
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
2
+ rubygems_version: 0.9.4.5
3
+ specification_version: 2
4
4
  name: echoe
5
5
  version: !ruby/object:Gem::Version
6
- version: 2.6.4
7
- date: 2007-10-11 00:00:00 -04:00
6
+ version: 2.7.0
7
+ date: 2007-10-25 00:00:00 -04:00
8
8
  summary: A tool for packaging Ruby gems.
9
9
  require_paths:
10
10
  - lib
@@ -16,11 +16,17 @@ autorequire:
16
16
  default_executable:
17
17
  bindir: bin
18
18
  has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
19
+ required_ruby_version: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - ">"
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.0.0
23
+ version: "0"
24
+ version:
25
+ required_rubygems_version: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.9.4.5
24
30
  version:
25
31
  platform: ruby
26
32
  signing_key:
@@ -52,6 +58,7 @@ authors:
52
58
  - Evan Weaver
53
59
  files:
54
60
  - CHANGELOG
61
+ - lib/echoe/platform.rb
55
62
  - lib/echoe.rb
56
63
  - LICENSE
57
64
  - Manifest
@@ -75,16 +82,16 @@ dependencies:
75
82
  - !ruby/object:Gem::Dependency
76
83
  name: rake
77
84
  version_requirement:
78
- version_requirements: !ruby/object:Gem::Version::Requirement
85
+ version_requirements: !ruby/object:Gem::Requirement
79
86
  requirements:
80
- - - ">"
87
+ - - ">="
81
88
  - !ruby/object:Gem::Version
82
- version: 0.0.0
89
+ version: "0"
83
90
  version:
84
91
  - !ruby/object:Gem::Dependency
85
92
  name: rubyforge
86
93
  version_requirement:
87
- version_requirements: !ruby/object:Gem::Version::Requirement
94
+ version_requirements: !ruby/object:Gem::Requirement
88
95
  requirements:
89
96
  - - ">="
90
97
  - !ruby/object:Gem::Version
@@ -93,9 +100,18 @@ dependencies:
93
100
  - !ruby/object:Gem::Dependency
94
101
  name: highline
95
102
  version_requirement:
96
- version_requirements: !ruby/object:Gem::Version::Requirement
103
+ version_requirements: !ruby/object:Gem::Requirement
97
104
  requirements:
98
- - - ">"
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: "0"
108
+ version:
109
+ - !ruby/object:Gem::Dependency
110
+ name: rcov
111
+ version_requirement:
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
99
115
  - !ruby/object:Gem::Version
100
- version: 0.0.0
116
+ version: "0"
101
117
  version:
metadata.gz.sig CHANGED
Binary file