X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=lib%2Fosdn%2Fcli%2Foverrides.rb;fp=lib%2Fosdn%2Fcli%2Foverrides.rb;h=25fea5ca0ef34f940caf201e5b0fee0e4f2ae82a;hb=42a8d6a815ce33b175de7247e1ca61fb9db35e38;hp=6bb7b421498ad6a1dbddf904ed157b9d786c8aba;hpb=f3da320b249fec28845edd332779190e1449618d;p=osdn-codes%2Fosdn-cli.git diff --git a/lib/osdn/cli/overrides.rb b/lib/osdn/cli/overrides.rb index 6bb7b42..25fea5c 100644 --- a/lib/osdn/cli/overrides.rb +++ b/lib/osdn/cli/overrides.rb @@ -5,6 +5,7 @@ module Typhoeus alias_method :get_orig, :get def get(*args) easy = get_orig(*args) + if ENV['CURL_CA_BUNDLE'] Ethon::Curl.set_option(:cainfo, ENV['CURL_CA_BUNDLE'], easy.handle) else @@ -21,12 +22,18 @@ module Typhoeus Ethon::Curl.set_option(:cainfo, ca, easy.handle) end end + if OSDN::CLI._show_progress Ethon::Curl.set_option(:noprogress, false, easy.handle) - else Ethon::Curl.set_option(:noprogress, true, easy.handle) end + + if OSDN::CLI._rate_limit + Ethon::Curl.set_option(:max_send_speed_large, OSDN::CLI._rate_limit, easy.handle) + Ethon::Curl.set_option(:max_recv_speed_large, OSDN::CLI._rate_limit, easy.handle) + end + easy end end