Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error w/ Ruby 1.8.7 & Addressable >= 2.4.0 #570

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
Expand All @@ -9,14 +8,19 @@ rvm:
- 2.3.0
- rbx-2
- ruby-head
- ree
- jruby-9.0.0.0
- jruby-9.0.1.0
- jruby-18mode
- jruby-19mode
- jruby
- jruby-head
matrix:
include:
- rvm: 1.8.7
gemfile: ruby1.8.7.gemfile
- rvm: ree
gemfile: ruby1.8.7.gemfile
- rvm: jruby-18mode
gemfile: ruby1.8.7.gemfile
allow_failures:
- rvm: jruby-9.0.0.0
- rvm: jruby-18mode
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 1.22.6

* Fixes [issue](https://github.com/bblimke/webmock/issues/568) around
WebMock restricting [Addressable](https://github.com/sporkmonger/addressable)
version, based on Ruby 1.8.7 for all versions of Ruby.

This change inverts that, and forces Ruby 1.8.7 users to specify in thier
Gemfile an Addressable version < 2.4.0.

Thanks to [PikachuEXE](https://github.com/PikachuEXE) and
[Matthew Rudy Jacobs](https://github.com/matthewrudy).

## 1.22.5

* Fixes [bug](https://github.com/bblimke/webmock/issues/565) where WebMock tries
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
source 'http://rubygems.org/'

gemspec

gem 'addressable', '>= 2.3.6'

if ENV["EM_HTTP_REQUEST_0_X"]
gem 'em-http-request', '~> 0.3.0'
end
Expand Down
10 changes: 10 additions & 0 deletions lib/webmock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,14 @@

require 'webmock/webmock'

if RUBY_VERSION <= "1.8.7" && Addressable::VERSION::STRING >= "2.4.0"
raise StandardError,
<<-ERR
\n\e[31m
Addressable dropped support for Ruby 1.8.7 on version 2.4.0,

please add the following to your Gemfile to be able to use WebMock:

gem 'addressable', '< 2.4.0'\e[0m\n
ERR
end
22 changes: 22 additions & 0 deletions ruby1.8.7.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
source 'http://rubygems.org/'

gemspec

gem 'addressable', '< 2.4.0'

if ENV["EM_HTTP_REQUEST_0_X"]
gem 'em-http-request', '~> 0.3.0'
end

group :development do
gem 'rake'
end

group :test do
gem 'minitest_tu_shim', '1.3.2'
end

platforms :jruby do
gem 'jruby-openssl'
end

2 changes: 0 additions & 2 deletions webmock.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ Gem::Specification.new do |s|
s.rubyforge_project = 'webmock'

patron_version = (RUBY_VERSION <= '1.8.7') ? '0.4.18' : '>= 0.4.18'
addressable_version = (RUBY_VERSION) > '1.8.7' ? '>= 2.3.6' : '< 2.4.0'
manticore_version = (RUBY_VERSION) > '1.8.7' ? '>= 0.5.1' : '<= 0.5.1'
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if you want to remove the addressable limit completely,
before the recent change it was >= 2.3.6 right?


s.add_dependency 'addressable', addressable_version
s.add_dependency 'crack', '>=0.3.2'
s.add_dependency 'hashdiff'

Expand Down