From e415da13e430fed7d9e222a854a2115be9a5a631 Mon Sep 17 00:00:00 2001 From: Jacob Buys Date: Wed, 30 May 2012 22:34:16 +0200 Subject: [PATCH 1/2] Fix dependencies that break with ruby 1.9.3 Ruby 1.9.3 requires a recent version of RSpec 2, and simplecov supercedes rcov on ruby 1.9+. --- Gemfile | 8 ++++---- Gemfile.lock | 48 +++++++++++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/Gemfile b/Gemfile index d7fea8b..9f78bc7 100644 --- a/Gemfile +++ b/Gemfile @@ -6,10 +6,10 @@ gem "thor", ">= 0.14.0" # Add dependencies to develop your gem here. # Include everything needed to run rake, tests, features, etc. group :development do - gem "rake" - gem "rspec", "~> 2.1.0" + gem "rake", "~> 0.8.7" + gem "rspec", "~> 2.10" gem "jeweler", ">= 1.6.2" - gem "rcov", ">= 0" + gem "rcov", :platforms => :mri_18 + gem "simplecov", :platforms => :mri_19 gem "test-construct" - gem "ruby-debug" end diff --git a/Gemfile.lock b/Gemfile.lock index 2bee71a..1844d0e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,40 +1,42 @@ GEM remote: http://rubygems.org/ specs: - columnize (0.3.2) - diff-lcs (1.1.2) + diff-lcs (1.1.3) git (1.2.5) - jeweler (1.6.2) + jeweler (1.8.3) bundler (~> 1.0) git (>= 1.2.5) rake - linecache (0.43) - rake (0.9.2) - rcov (0.9.9) - rspec (2.1.0) - rspec-core (~> 2.1.0) - rspec-expectations (~> 2.1.0) - rspec-mocks (~> 2.1.0) - rspec-core (2.1.0) - rspec-expectations (2.1.0) - diff-lcs (~> 1.1.2) - rspec-mocks (2.1.0) - ruby-debug (0.10.4) - columnize (>= 0.1) - ruby-debug-base (~> 0.10.4.0) - ruby-debug-base (0.10.4) - linecache (>= 0.3) + rdoc + json (1.7.3) + multi_json (1.3.6) + rake (0.8.7) + rcov (1.0.0) + rdoc (3.12) + json (~> 1.4) + rspec (2.10.0) + rspec-core (~> 2.10.0) + rspec-expectations (~> 2.10.0) + rspec-mocks (~> 2.10.0) + rspec-core (2.10.1) + rspec-expectations (2.10.0) + diff-lcs (~> 1.1.3) + rspec-mocks (2.10.1) + simplecov (0.6.4) + multi_json (~> 1.0) + simplecov-html (~> 0.5.3) + simplecov-html (0.5.3) test-construct (1.2.0) - thor (0.14.6) + thor (0.15.2) PLATFORMS ruby DEPENDENCIES jeweler (>= 1.6.2) - rake + rake (~> 0.8.7) rcov - rspec (~> 2.1.0) - ruby-debug + rspec (~> 2.10) + simplecov test-construct thor (>= 0.14.0) From a141f9cbbdc92ce1ce4877878d0a2db9eed93e9e Mon Sep 17 00:00:00 2001 From: Jacob Buys Date: Wed, 30 May 2012 22:36:19 +0200 Subject: [PATCH 2/2] Fix test that fails on 1.9 due to behaviour of String#start_with? On ruby 1.9, the argument of String#start_with? does not automatically get coerced into a string. In Homesick#clone, we use start_with? with a Pathname instance, which now always returns false. --- lib/homesick.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/homesick.rb b/lib/homesick.rb index 09647f9..f19aca9 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -22,7 +22,7 @@ class Homesick < Thor destination = nil if File.exist?(uri) uri = Pathname.new(uri).expand_path - if uri.to_s.start_with?(repos_dir) + if uri.to_s.start_with?(repos_dir.to_s) raise "Castle already cloned to #{uri}" end