You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by lu...@redhat.com on 2010/10/23 00:52:55 UTC

Client: one gem for JRuby and MRI

Here is the complementary fix for building one gem for JRuby and MRI.

The second patch adds an error message to deltacloudc; the fatc that there
was none just sent me on a wild goose chase.

[PATCH 2/2] * client/bin/deltacloudc: print error if ID for show operation is missing

Posted by lu...@redhat.com.
From: David Lutterkort <lu...@redhat.com>

---
 client/bin/deltacloudc |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/client/bin/deltacloudc b/client/bin/deltacloudc
index 5153e35..9408f90 100755
--- a/client/bin/deltacloudc
+++ b/client/bin/deltacloudc
@@ -124,6 +124,7 @@ if options[:collection] and options[:operation]
   # If collection is set and requested operation is 'show' just 'singularize'
   # collection name and print item with specified id (-i parameter)
   if options[:operation].eql?('show')
+    invalid_usage("Missing ID, must be provided with --id") unless options[:id]
     puts format(client.send(options[:collection].gsub(/s$/, ''), options[:id]))
     exit(0)
   end
-- 
1.7.2.3


[PATCH 1/2] client: build only one gem for both JRuby and MRI

Posted by lu...@redhat.com.
From: David Lutterkort <lu...@redhat.com>

Bump the requirement for Nokogiri to one that also works under JRuby. Also
bump rest-client requirement, since tests fail with rest-client 1.4.2
---
 client/Rakefile                  |   12 +++---------
 client/deltacloud-client.gemspec |   12 +++---------
 2 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/client/Rakefile b/client/Rakefile
index 2f465be..947525e 100644
--- a/client/Rakefile
+++ b/client/Rakefile
@@ -25,15 +25,9 @@ task 'documentation' do
   load 'lib/documentation.rb'
 end
 
-@specs = ['ruby', 'java'].inject({}) do |hash, spec_platform|
-  $platform = spec_platform
-  hash.update(spec_platform => Gem::Specification.load('deltacloud-client.gemspec'))
-end
-
-@specs.values.each do |spec|
-  Rake::GemPackageTask.new(spec) do |pkg|
-    pkg.need_tar = true
-  end
+spec = Gem::Specification.load('deltacloud-client.gemspec')
+Rake::GemPackageTask.new(spec) do |pkg|
+  pkg.need_tar = true
 end
 
 if Gem.available?('rspec')
diff --git a/client/deltacloud-client.gemspec b/client/deltacloud-client.gemspec
index 110ad83..aba7769 100644
--- a/client/deltacloud-client.gemspec
+++ b/client/deltacloud-client.gemspec
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
   s.email = 'deltacloud-users@lists.fedorahosted.org'
   s.name = 'deltacloud-client'
   s.description = %q{Deltacloud REST Client for API}
-  s.version = '0.0.9.8'
+  s.version = '0.0.9.9'
   s.summary = %q{Deltacloud REST Client}
   s.files = Dir['Rakefile', 'lib/**/*.rb', 'init.rb', 'bin/deltacloudc']
   s.bindir = 'bin'
@@ -32,13 +32,7 @@ Gem::Specification.new do |s|
   s.test_files= Dir.glob("specs/**/**")
   s.extra_rdoc_files = Dir["COPYING"]
 
-  # 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('rest-client', '>= 1.4.2')
-  s.add_dependency('nokogiri', '>= 1.4.1') if s.platform.to_s == 'ruby'
-  s.add_dependency('nokogiri', '>= 1.5.0.beta.2') if s.platform.to_s == 'java'
+  s.add_dependency('rest-client', '>= 1.6.1')
+  s.add_dependency('nokogiri', '>= 1.4.3')
   s.add_development_dependency('rspec', '>= 1.3.0')
 end
-- 
1.7.2.3