Skip to content
Merged
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
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ group :development, :spec do
gem 'faraday', '~> 2.0'
end

gem 'rest-client', '>= 1.8.0'

if RUBY_ENGINE == 'jruby'
gem 'jruby-openssl', platforms: :jruby
gem 'pry-nav', platforms: :jruby
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ All the calls this library makes to Trello require authentication using these ke

#### HTTP Client

By default, ruby-trello uses [rest-client](https://rubygems.org/gems/rest-client) for network calls. You can configure ruby-trello to use either rest-client or [faraday](https://rubygems.org/gems/faraday), depending on your project's needs. In the next major version, ruby-trello will not require either gem in the gemspec and will default to faraday if both are present.
ruby-trello requires either [rest-client](https://rubygems.org/gems/rest-client) or [faraday](https://rubygems.org/gems/faraday) to be present for network calls. You can configure ruby-trello to use either one, depending on your project's needs. If both are present, ruby-trello defaults to using faraday.

```ruby
Trello.configure do |config|
config.http_client = 'rest-client'
# OR
config.http_client = 'faraday'
# OR
config.http_client = 'rest-client'
end
```

Expand Down
4 changes: 2 additions & 2 deletions lib/trello.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def self.logger=(logger)
end

# The order in which we will try the http clients
HTTP_CLIENT_PRIORITY = %w(rest-client faraday)
HTTP_CLIENT_PRIORITY = %w(faraday rest-client)
HTTP_CLIENTS = {
'faraday' => Trello::TFaraday::TInternet,
'rest-client' => Trello::TRestClient::TInternet
Expand All @@ -141,7 +141,7 @@ def self.http_client
end
end

raise ConfigurationError, 'Trello requires either rest-client or faraday installed' unless client
raise ConfigurationError, 'Trello requires either faraday or rest-client installed' unless client

client
end
Expand Down
1 change: 0 additions & 1 deletion ruby-trello.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ Gem::Specification.new do |s|
s.add_dependency 'addressable', '~> 2.3'
s.add_dependency 'json', '>= 2.3.0'
s.add_dependency 'oauth', '>= 0.4.5'
s.add_dependency 'rest-client', '>= 1.8.0'
end
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def setup_trello
Trello.configure do |config|
config.developer_public_key = ENV['TRELLO_DEVELOPER_PUBLIC_KEY'] || 'developerpublickey'
config.member_token = ENV['TRELLO_MEMBER_TOKEN'] || 'membertoken'
config.http_client = ENV['HTTP_CLIENT_GEM'] || 'rest-client'
config.http_client = ENV['HTTP_CLIENT_GEM'] || 'faraday'
end
end
end
Expand Down