Permalink
Browse files

Ruby 1.8 compatibility fixes

  • Loading branch information...
1 parent 0ae2ad8 commit 5ee5f20d746d2f804354b1e8dd1b9c45fd5d60c4 @rykov rykov committed Jan 10, 2012
Showing with 13 additions and 63 deletions.
  1. +2 −1 .gitignore
  2. +1 −0 CHANGELOG
  3. +0 −49 Gemfile.lock
  4. +2 −2 gemfury.gemspec
  5. +6 −6 lib/gemfury/command/app.rb
  6. +1 −2 spec/gemfury/app_spec.rb
  7. +1 −3 spec/gemfury/client_spec.rb
View
@@ -1 +1,2 @@
-gemfury-*.gem
+gemfury-*.gem
+Gemfile.lock
View
@@ -1,6 +1,7 @@
*0.4.3*
* Add 'migrate' command to mass-upload gems in a directory
+* Ruby 1.8 compatibility fixes
*0.4.2*
View
@@ -1,49 +0,0 @@
-PATH
- remote: .
- specs:
- gemfury (0.4.0)
- faraday (~> 0.7.4)
- faraday_middleware (~> 0.7.0)
- highline (~> 1.6.0)
- multi_json (~> 1.0.2)
- thor (~> 0.14.0)
-
-GEM
- remote: http://rubygems.org/
- specs:
- addressable (2.2.6)
- crack (0.3.1)
- diff-lcs (1.1.3)
- faraday (0.7.5)
- addressable (~> 2.2.6)
- multipart-post (~> 1.1.3)
- rack (>= 1.1.0, < 2)
- faraday_middleware (0.7.0)
- faraday (~> 0.7.3)
- highline (1.6.2)
- multi_json (1.0.3)
- multipart-post (1.1.3)
- rack (1.3.4)
- rake (0.8.7)
- rspec (2.6.0)
- rspec-core (~> 2.6.0)
- rspec-expectations (~> 2.6.0)
- rspec-mocks (~> 2.6.0)
- rspec-core (2.6.4)
- rspec-expectations (2.6.0)
- diff-lcs (~> 1.1.2)
- rspec-mocks (2.6.0)
- thor (0.14.6)
- webmock (1.7.6)
- addressable (~> 2.2, > 2.2.5)
- crack (>= 0.1.7)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- gemfury!
- multi_json
- rake (~> 0.8.7)
- rspec (~> 2.6.0)
- webmock (~> 1.7.4)
View
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.version = Gemfury::VERSION
s.date = Time.now.strftime('%Y-%m-%d')
s.summary = "Cloud Gem Server for your private RubyGems"
- s.homepage = "http://gemfury.com"
+ s.homepage = "http://www.gemfury.com"
s.email = "mrykov@gmail.com"
s.authors = [ "Michael Rykov" ]
s.has_rdoc = false
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
s.add_dependency "faraday_middleware", "~> 0.7.0"
s.description = <<DESCRIPTION
-Client library and command-line tool to manage your gems on http://gemfury.com
+Cloud Gem Server for your private RubyGems at http://gemfury.com
DESCRIPTION
s.post_install_message =<<POSTINSTALL
View
@@ -163,21 +163,21 @@ def with_checks_and_rescues(&block)
end
def push_files(command, gem_paths)
- gem_files = gem_paths.map do |g|
- File.exists?(g) ? File.new(g) : nil
+ files = gem_paths.map do |g|
+ g.is_a?(String) ? File.new(g) : g rescue nil
end.compact
- if gem_files.empty?
+ if files.empty?
shell.say "Problem: No valid gems found", :red
help(command)
return
end
# Let's get uploading
- gem_files.each do |gem_file|
+ files.each do |file|
begin
- shell.say "Uploading #{File.basename(gem_file)} "
- client.push_gem(gem_file)
+ shell.say "Uploading #{File.basename(file.path)} "
+ client.push_gem(file)
shell.say "- done"
rescue Gemfury::CorruptGemFile
shell.say "- problem processing this gem", :red
View
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'json'
describe Gemfury::Command::App do
MyApp = Gemfury::Command::App
@@ -55,7 +54,7 @@
out.should =~ /bar.*/
out.should =~ /fury.*/
end
-
+
it 'should upload gems after confirmation' do
stub_post("gems")
$stdin.should_receive(:gets).and_return('y')
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'json'
describe Gemfury::Client do
before do
@@ -88,8 +87,7 @@
end
it 'should upload valid gems' do
- gem_file = File.new(fixture('fury-0.0.2.gem'))
- @client.push_gem(gem_file)
+ @client.push_gem(fixture('fury-0.0.2.gem'))
a_post("gems").should have_been_made
end
end

0 comments on commit 5ee5f20

Please sign in to comment.