Skip to content

Commit

Permalink
Be picky about the version of our dependencies
Browse files Browse the repository at this point in the history
Set the latest version as the minimum (because that's the one that was
used when developing and testing twingly-url), but allow for usage of
later non-major versions, to be able to update the version of these gems
in projects using twingly-url, without requiring a new twingly-url
release.

http://guides.rubygems.org/patterns/

Didn't touch idn-ruby because there's currently only one version, 0.1.0,
released: https://rubygems.org/gems/idn-ruby/versions
  • Loading branch information
dentarg committed Sep 13, 2016
1 parent 46a4175 commit b61f962
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions twingly-url.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Gem::Specification.new do |s|
s.license = "MIT"
s.required_ruby_version = "~> 2.2"

s.add_dependency "addressable", "~> 2"
s.add_dependency "public_suffix", "~> 2"
s.add_dependency "addressable", "~> 2.4", ">= 2.4.0"
s.add_dependency "public_suffix", "~> 2.0", ">= 2.0.2"
s.add_dependency "idn-ruby", "~> 0.1"

s.add_development_dependency "rake", "~> 10"
Expand Down

2 comments on commit b61f962

@dentarg
Copy link
Collaborator Author

@dentarg dentarg commented on b61f962 Nov 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EDIT: No, this is what we wanted, but we couldn't anticipate certain consequences. Continuing in #104

Oops, here we messed up. This should be

diff --git a/twingly-url.gemspec b/twingly-url.gemspec
index e5b5f6f..0034d19 100644
--- a/twingly-url.gemspec
+++ b/twingly-url.gemspec
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
   s.license     = "MIT"
   s.required_ruby_version = "~> 2.2"

-  s.add_dependency "addressable", "~> 2.4", ">= 2.4.0"
-  s.add_dependency "public_suffix", "~> 2.0", ">= 2.0.2"
+  s.add_dependency "addressable", "~> 2.4", "<= 2.4.0"
+  s.add_dependency "public_suffix", "~> 2.0", "<= 2.0.2"
   s.add_dependency "idn-ruby", "~> 0.1"

   s.add_development_dependency "rake", "~> 10"

@dentarg
Copy link
Collaborator Author

@dentarg dentarg commented on b61f962 Nov 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ rm Gemfile.lock

~/twingly/ruby/twingly-url master
$ bundle
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 10.5.0
Using coderay 1.1.1
Using diff-lcs 1.2.5
Using idn-ruby 0.1.0
Using method_source 0.8.2
Using slop 3.6.0
Using rspec-support 3.5.0
Using bundler 1.13.3
Using pry 0.10.4
Installing ruby-prof 0.16.2 with native extensions
Installing public_suffix 2.0.3
Installing rspec-core 3.5.4
Using rspec-expectations 3.5.0
Using rspec-mocks 3.5.0
Using rspec 3.5.0
Installing addressable 2.5.0
Using twingly-url 5.0.1 from source at `.`
Bundle complete! 5 Gemfile dependencies, 17 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
$ rm Gemfile.lock

~/twingly/ruby/twingly-url master*
$ git d
diff --git a/twingly-url.gemspec b/twingly-url.gemspec
index e5b5f6f..0034d19 100644
--- a/twingly-url.gemspec
+++ b/twingly-url.gemspec
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
   s.license     = "MIT"
   s.required_ruby_version = "~> 2.2"

-  s.add_dependency "addressable", "~> 2.4", ">= 2.4.0"
-  s.add_dependency "public_suffix", "~> 2.0", ">= 2.0.2"
+  s.add_dependency "addressable", "~> 2.4", "<= 2.4.0"
+  s.add_dependency "public_suffix", "~> 2.0", "<= 2.0.2"
   s.add_dependency "idn-ruby", "~> 0.1"

   s.add_development_dependency "rake", "~> 10"

~/twingly/ruby/twingly-url master*
$ bundle
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 10.5.0
Using addressable 2.4.0
Using coderay 1.1.1
Using diff-lcs 1.2.5
Using idn-ruby 0.1.0
Using method_source 0.8.2
Using slop 3.6.0
Using public_suffix 2.0.2
Using rspec-support 3.5.0
Using ruby-prof 0.16.2
Using bundler 1.13.3
Using pry 0.10.4
Using twingly-url 5.0.1 from source at `.`
Using rspec-core 3.5.4
Using rspec-expectations 3.5.0
Using rspec-mocks 3.5.0
Using rspec 3.5.0
Bundle complete! 5 Gemfile dependencies, 17 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

Please sign in to comment.