rake-compiler 0.7.8 → 0.7.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,13 @@
1
+ === 0.7.9 / 2011-06-08
2
+
3
+ * Enhancements:
4
+ * Consistently use RubyGems features available since version 1.3.2 and avoid
5
+ deprecation warnings with Rake > 0.8.7.
6
+
7
+ * Bugfixes:
8
+ * Use correct platform in fake.rb. Pull #39 [kou]
9
+ * Workaround Gem::Specification and Gem::PackageTask limitations. Closes #43
10
+
1
11
  === 0.7.8 / 2011-04-26
2
12
 
3
13
  * Enhancements:
data/Isolate CHANGED
@@ -1,6 +1,6 @@
1
1
  gem 'rake'
2
- gem 'rspec', '~> 1.3.1'
3
- gem 'cucumber', '~> 0.9.4'
2
+ gem 'rspec', '~> 2.6.0'
3
+ gem 'cucumber', '~> 0.10.6'
4
4
 
5
5
  unless RUBY_PLATFORM =~ /java/
6
6
  gem 'rcov', '~> 0.9.9'
@@ -1,5 +1,5 @@
1
1
  require 'cucumber'
2
- require 'spec'
2
+ require 'rspec'
3
3
  require 'fileutils'
4
4
  require 'rbconfig'
5
5
 
@@ -14,18 +14,17 @@ EOF
14
14
 
15
15
  def template_rake_gemspec(gem_name)
16
16
  <<-EOF
17
- require 'rake/gempackagetask'
17
+ require 'rubygems/package_task'
18
18
  SPEC = Gem::Specification.new do |s|
19
19
  s.name = "#{gem_name}"
20
20
  s.version = "0.1.0"
21
21
  s.summary = "#{gem_name} test gem for rake-compiler"
22
+ s.description = "#{gem_name} is a fake gem for testing under rake-compiler"
22
23
 
23
24
  s.files = FileList["ext/**/*.{rb,c,h}", "Rakefile", "tasks/*.rake", "lib/**/*.rb"]
24
25
 
25
26
  s.extensions = FileList["ext/**/extconf.rb"]
26
27
 
27
- s.has_rdoc = true
28
-
29
28
  s.homepage = 'http://github.com/luislavena/rake-compiler'
30
29
  s.rubyforge_project = 'TODO'
31
30
 
@@ -33,7 +32,7 @@ SPEC = Gem::Specification.new do |s|
33
32
  s.email = ["luislavena@gmail.com"]
34
33
  end
35
34
 
36
- gem_package = Rake::GemPackageTask.new(SPEC) do |pkg|
35
+ Gem::PackageTask.new(SPEC) do |pkg|
37
36
  pkg.need_zip = false
38
37
  pkg.need_tar = false
39
38
  end
@@ -14,8 +14,6 @@ require 'yaml'
14
14
  require 'pathname'
15
15
 
16
16
  module Rake
17
- autoload :GemPackageTask, 'rake/gempackagetask'
18
-
19
17
  class BaseExtensionTask < TaskLib
20
18
 
21
19
  attr_accessor :name
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'rake/baseextensiontask'
4
+ require "rubygems/package_task"
4
5
 
5
6
  # Define a series of tasks to aid in the compilation of C extensions for
6
7
  # gem developer/creators.
@@ -186,9 +187,10 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/native compile.
186
187
  # create 'native:gem_name' and chain it to 'native' task
187
188
  unless Rake::Task.task_defined?("native:#{@gem_spec.name}:#{platf}")
188
189
  task "native:#{@gem_spec.name}:#{platf}" do |t|
189
- # FIXME: truly duplicate the Gem::Specification
190
- # workaround the lack of #dup for Gem::Specification
190
+ # FIXME: workaround Gem::Specification limitation around cache_file:
191
+ # http://github.com/rubygems/rubygems/issues/78
191
192
  spec = gem_spec.dup
193
+ spec.instance_variable_set(:"@cache_file", nil) if spec.respond_to?(:cache_file)
192
194
 
193
195
  # adjust to specified platform
194
196
  spec.platform = Gem::Platform.new(platf)
@@ -213,7 +215,7 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/native compile.
213
215
  end
214
216
 
215
217
  # Generate a package for this gem
216
- gem_package = Rake::GemPackageTask.new(spec) do |pkg|
218
+ Gem::PackageTask.new(spec) do |pkg|
217
219
  pkg.need_zip = false
218
220
  pkg.need_tar = false
219
221
  end
@@ -311,7 +313,7 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/native compile.
311
313
  # genearte fake.rb for different ruby versions
312
314
  file "#{tmp_path}/fake.rb" do |t|
313
315
  File.open(t.name, 'w') do |f|
314
- f.write fake_rb(ruby_ver)
316
+ f.write fake_rb(for_platform, ruby_ver)
315
317
  end
316
318
  end
317
319
 
@@ -381,13 +383,13 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/native compile.
381
383
  [*@cross_platform].map { |p| "native:#{p}" }
382
384
  end
383
385
 
384
- def fake_rb(version)
386
+ def fake_rb(platform, version)
385
387
  <<-FAKE_RB
386
388
  class Object
387
389
  remove_const :RUBY_PLATFORM
388
390
  remove_const :RUBY_VERSION
389
391
  remove_const :RUBY_DESCRIPTION if defined?(RUBY_DESCRIPTION)
390
- RUBY_PLATFORM = "i386-mingw32"
392
+ RUBY_PLATFORM = "#{platform}"
391
393
  RUBY_VERSION = "#{version}"
392
394
  RUBY_DESCRIPTION = "ruby \#{RUBY_VERSION} (\#{RUBY_RELEASE_DATE}) [\#{RUBY_PLATFORM}]"
393
395
  end
@@ -134,9 +134,10 @@ execute the Rake compilation task using the JRuby interpreter.
134
134
 
135
135
  if @gem_spec && !Rake::Task.task_defined?("java:#{@gem_spec.name}")
136
136
  task "java:#{@gem_spec.name}" do |t|
137
-
138
- # FIXME: truly duplicate the Gem::Specification
137
+ # FIXME: workaround Gem::Specification limitation around cache_file:
138
+ # http://github.com/rubygems/rubygems/issues/78
139
139
  spec = gem_spec.dup
140
+ spec.instance_variable_set(:"@cache_file", nil) if spec.respond_to?(:cache_file)
140
141
 
141
142
  # adjust to specified platform
142
143
  spec.platform = Gem::Platform.new('java')
@@ -161,7 +162,7 @@ execute the Rake compilation task using the JRuby interpreter.
161
162
  end
162
163
 
163
164
  # Generate a package for this gem
164
- gem_package = Rake::GemPackageTask.new(spec) do |pkg|
165
+ Gem::PackageTask.new(spec) do |pkg|
165
166
  pkg.need_zip = false
166
167
  pkg.need_tar = false
167
168
  end
@@ -1,19 +1,14 @@
1
- # add lib directory to the search path
2
- libdir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
3
- $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
4
-
5
- require 'rubygems'
6
- require 'spec'
1
+ require 'rspec'
7
2
 
8
3
  # Console redirection helper
9
- require File.expand_path(File.join(File.dirname(__FILE__), 'support/capture_output_helper'))
4
+ require File.expand_path('../support/capture_output_helper', __FILE__)
10
5
 
11
- Spec::Runner.configure do |config|
12
- include CaptureOutputHelper
6
+ RSpec.configure do |config|
7
+ config.include CaptureOutputHelper
13
8
  end
14
9
 
15
10
  # Rake::Task matcher helper
16
- Spec::Matchers.define :have_defined do |task|
11
+ RSpec::Matchers.define :have_defined do |task|
17
12
  match do |tasks|
18
13
  tasks.task_defined?(task)
19
14
  end
@@ -1,7 +1,7 @@
1
1
  require 'rake/clean'
2
2
 
3
3
  # common pattern cleanup
4
- CLEAN.include('tmp')
4
+ CLOBBER.include('tmp')
5
5
 
6
6
  # set default task
7
7
  task :default => [:spec, :features]
@@ -3,7 +3,7 @@ require 'rubygems/package_task'
3
3
  GEM_SPEC = Gem::Specification.new do |s|
4
4
  # basic information
5
5
  s.name = "rake-compiler"
6
- s.version = "0.7.8"
6
+ s.version = "0.7.9"
7
7
  s.platform = Gem::Platform::RUBY
8
8
 
9
9
  # description and details
@@ -18,8 +18,8 @@ GEM_SPEC = Gem::Specification.new do |s|
18
18
  s.add_dependency 'rake'
19
19
 
20
20
  # development dependencies
21
- s.add_development_dependency 'rspec', '~> 1.3.1'
22
- s.add_development_dependency 'cucumber', '~> 0.9.4'
21
+ s.add_development_dependency 'rspec', '~> 2.6.0'
22
+ s.add_development_dependency 'cucumber', '~> 0.10.6'
23
23
  #s.add_development_dependency 'rcov', '~> 0.9.9'
24
24
 
25
25
  # components, files and paths
@@ -1,5 +1,5 @@
1
1
  desc 'Package gems and upload to RubyGems'
2
- task :release, :version, :needs => [:package] do |t, args|
2
+ task :release, [:version] => [:package] do |t, args|
3
3
  args.with_defaults(:version => "")
4
4
  ver = args.version
5
5
 
@@ -1,5 +1,5 @@
1
1
  begin
2
- require 'spec/rake/spectask'
2
+ require "rspec/core/rake_task"
3
3
 
4
4
  begin
5
5
  require 'rcov'
@@ -11,21 +11,16 @@ rescue LoadError
11
11
  warn "RSpec gem is required, please install it (gem install rspec)."
12
12
  end
13
13
 
14
- if defined?(Spec)
15
- Spec::Rake::SpecTask.new(:spec) do |t|
16
- t.spec_opts = ["--options", "spec/spec.opts"]
17
- t.spec_files = FileList["spec/**/*_spec.rb"]
18
- end
14
+ if defined?(RSpec::Core::RakeTask)
15
+ RSpec::Core::RakeTask.new(:spec)
19
16
 
20
17
  if defined?(Rcov)
21
18
  CLOBBER.include('coverage')
22
19
 
23
20
  namespace :spec do
24
21
  desc "Run all specs in spec directory with RCov"
25
- Spec::Rake::SpecTask.new(:rcov) do |t|
26
- t.spec_opts = ["--options", "spec/spec.opts"]
27
- t.spec_files = FileList["spec/**/*_spec.rb"]
28
- t.rcov = true
22
+ RSpec::Core::RakeTask.new(:rcov) do |t|
23
+ t.rcov = true
29
24
  t.rcov_opts = ["--exclude", "spec/*,features/*,gems/*"]
30
25
  end
31
26
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-compiler
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 8
10
- version: 0.7.8
9
+ - 9
10
+ version: 0.7.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Luis Lavena
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-26 00:00:00 Z
18
+ date: 2011-06-08 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rake
@@ -39,12 +39,12 @@ dependencies:
39
39
  requirements:
40
40
  - - ~>
41
41
  - !ruby/object:Gem::Version
42
- hash: 25
42
+ hash: 23
43
43
  segments:
44
- - 1
45
- - 3
46
- - 1
47
- version: 1.3.1
44
+ - 2
45
+ - 6
46
+ - 0
47
+ version: 2.6.0
48
48
  type: :development
49
49
  version_requirements: *id002
50
50
  - !ruby/object:Gem::Dependency
@@ -55,12 +55,12 @@ dependencies:
55
55
  requirements:
56
56
  - - ~>
57
57
  - !ruby/object:Gem::Version
58
- hash: 51
58
+ hash: 59
59
59
  segments:
60
60
  - 0
61
- - 9
62
- - 4
63
- version: 0.9.4
61
+ - 10
62
+ - 6
63
+ version: 0.10.6
64
64
  type: :development
65
65
  version_requirements: *id003
66
66
  description: |-
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  requirements: []
155
155
 
156
156
  rubyforge_project: rake-compiler
157
- rubygems_version: 1.7.2
157
+ rubygems_version: 1.8.5
158
158
  signing_key:
159
159
  specification_version: 3
160
160
  summary: Rake-based Ruby Extension (C, Java) task generator.