incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@redhat.com
Subject [PATCH 2/2] Gem building: do not depend on thin/rerun
Date Thu, 21 Oct 2010 22:42:02 GMT
From: David Lutterkort <lutter@redhat.com>

Having thin/rerun should be developer conveniences resp. recommendations
for deployment. No need to hardcode this as gem dependencies.

  * server/Rakefile: only build one gem, which will work under MRI and
    JRuby
  * server/deltacloud-core.gemspec: remove dependencies on thin and rerun
  * tests/mock/99_rake.feature: only expect one gem file
---
 server/Rakefile                |   12 +++---------
 server/deltacloud-core.gemspec |    8 --------
 tests/mock/99_rake.feature     |    2 +-
 3 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/server/Rakefile b/server/Rakefile
index eb0b767..e562cb5 100644
--- a/server/Rakefile
+++ b/server/Rakefile
@@ -43,15 +43,9 @@ begin
 rescue LoadError
 end
 
-@specs = ['ruby', 'java'].inject({}) do |hash, spec_platform|
-  $platform = spec_platform
-  hash.update(spec_platform => Gem::Specification.load('deltacloud-core.gemspec'))
-end
-
-@specs.values.each do |spec|
-  Rake::GemPackageTask.new(spec) do |pkg|
-    pkg.need_tar = true
-  end
+spec = Gem::Specification.load('deltacloud-core.gemspec')
+Rake::GemPackageTask.new(spec) do |pkg|
+  pkg.need_tar = true
 end
 
 desc "Install API"
diff --git a/server/deltacloud-core.gemspec b/server/deltacloud-core.gemspec
index 5fc7c19..f6fc542 100644
--- a/server/deltacloud-core.gemspec
+++ b/server/deltacloud-core.gemspec
@@ -58,19 +58,11 @@ Gem::Specification.new do |s|
   s.extra_rdoc_files = Dir["COPYING"]
   s.required_ruby_version = '>= 1.8.1'
 
-  # Rakefile needs to create spec for both platforms (ruby and java), using the
-  # $platform global variable. In all other cases, we figure it out from
-  # RUBY_PLATFORM.
-  s.platform = $platform || RUBY_PLATFORM[/java/] || 'ruby'
-
   s.add_dependency('rake', '>= 0.8.7')
-  s.add_dependency('eventmachine', '>= 0.12.10') if s.platform.to_s == 'ruby'
   s.add_dependency('haml', '>= 2.2.17')
   s.add_dependency('sinatra', '>= 0.9.4')
   s.add_dependency('rack', '>= 1.0.0')
   s.add_dependency('rack-accept', '~> 0.4.3')
-  s.add_dependency('thin', '>= 1.2.5') if s.platform.to_s == 'ruby'
-  s.add_dependency('rerun', '>= 0.5.2') if s.platform.to_s == 'ruby'
   s.add_dependency('json', '>= 1.1.9')
   s.add_development_dependency('compass', '>= 0.8.17')
   s.add_development_dependency('nokogiri', '>= 1.4.1')
diff --git a/tests/mock/99_rake.feature b/tests/mock/99_rake.feature
index 5d70b8a..d6b424a 100644
--- a/tests/mock/99_rake.feature
+++ b/tests/mock/99_rake.feature
@@ -3,5 +3,5 @@ Feature: Running rake tasks
   Scenario: I want to build Deltacloud API gem
     Given I have a clean /pkg directory
     When I run a 'package' task
-    Then I should see a 2 gem file inside pkg directory
+    Then I should see a 1 gem file inside pkg directory
     And I should see a 1 tgz file inside pkg directory
-- 
1.7.2.3


Mime
View raw message