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

Remove runtime dependency on FFI #758

Merged
merged 3 commits into from
Sep 21, 2020
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
16 changes: 11 additions & 5 deletions lib/travis/cli/api_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ class ApiCommand < Command
c.enterprise_name = name || 'default'
end

on('--adapter ADAPTER', 'Faraday adapter to use for HTTP requests') do |c, adapter|
adapter.gsub! '-', '_'
require "faraday/adapter/#{adapter}"
require 'typhoeus/adapters/faraday' if adapter == 'typhoeus'
c.session.faraday_adapter = adapter.to_sym
on('--adapter ADAPTER', 'Faraday adapter to use for HTTP requests. If omitted, use Typhoeus if it is installed, ' \
'and Net::HTTP otherwise. See https://lostisland.github.io/faraday/adapters/ for more info') do |c, adapter|
begin
adapter.gsub! '-', '_'
require "faraday/adapter/#{adapter}"
require 'typhoeus/adapters/faraday' if adapter == 'typhoeus'
c.session.faraday_adapter = adapter.to_sym
rescue LoadError => e
warn "\`--adapter #{adapter}\` is given, but it is not installed. Run \`gem install #{adapter}\` and try again"
exit 1
end
end

def initialize(*)
Expand Down
3 changes: 1 addition & 2 deletions travis.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,7 @@ Gem::Specification.new do |s|
s.add_dependency "highline", "~> 2.0"
s.add_dependency "gh", "~> 0.13"
s.add_dependency "launchy", "~> 2.1", "< 2.5.0"
s.add_dependency "typhoeus", "~> 0.6", ">= 0.6.8"
s.add_dependency "json", "~> 2.3"
s.add_dependency "json_pure", "~> 2.3"
s.add_dependency "pusher-client", "~> 0.4"
s.add_development_dependency "rspec", "~> 2.12"
s.add_development_dependency "rspec-its"
Expand Down