faraday 0.8.4 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ end
7
7
  group :test do
8
8
  gem 'em-http-request', '~> 1.0', :require => 'em-http'
9
9
  gem 'em-synchrony', '~> 1.0', :require => ['em-synchrony', 'em-synchrony/em-http'], :platforms => :ruby_19
10
- gem 'excon', '>= 0.14.1'
10
+ gem 'excon', '>= 0.16.1'
11
11
  gem 'net-http-persistent', '~> 2.5', :require => false
12
12
  gem 'leftright', '~> 0.9', :require => false
13
13
  gem 'rack-test', '~> 0.6', :require => 'rack/test'
data/Rakefile CHANGED
@@ -1,4 +1,6 @@
1
1
  require 'date'
2
+ require 'fileutils'
3
+ require 'openssl'
2
4
  require 'rake/testtask'
3
5
 
4
6
  task :default => :test
@@ -26,6 +28,23 @@ def replace_header(head, header_name)
26
28
  head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
27
29
  end
28
30
 
31
+ # Adapted from WEBrick::Utils. Skips cert extensions so it
32
+ # can be used as a CA bundle
33
+ def create_self_signed_cert(bits, cn, comment)
34
+ rsa = OpenSSL::PKey::RSA.new(bits)
35
+ cert = OpenSSL::X509::Certificate.new
36
+ cert.version = 2
37
+ cert.serial = 1
38
+ name = OpenSSL::X509::Name.new(cn)
39
+ cert.subject = name
40
+ cert.issuer = name
41
+ cert.not_before = Time.now
42
+ cert.not_after = Time.now + (365*24*60*60)
43
+ cert.public_key = rsa.public_key
44
+ cert.sign(rsa, OpenSSL::Digest::SHA1.new)
45
+ return [cert, rsa]
46
+ end
47
+
29
48
  ## standard tasks
30
49
 
31
50
  desc "Run all tests"
@@ -33,6 +52,17 @@ task :test do
33
52
  exec 'script/test'
34
53
  end
35
54
 
55
+ desc "Generate certificates for SSL tests"
56
+ task :'test:generate_certs' do
57
+ cert, key = create_self_signed_cert(1024, [['CN', 'localhost']], 'Faraday Test CA')
58
+ FileUtils.mkdir_p 'tmp'
59
+ File.open('tmp/faraday-cert.key', 'w') {|f| f.puts(key) }
60
+ File.open('tmp/faraday-cert.crt', 'w') {|f| f.puts(cert.to_s) }
61
+ end
62
+
63
+ file 'tmp/faraday-cert.key' => :'test:generate_certs'
64
+ file 'tmp/faraday-cert.crt' => :'test:generate_certs'
65
+
36
66
  desc "Open an irb session preloaded with this library"
37
67
  task :console do
38
68
  sh "irb -rubygems -r ./lib/#{name}.rb"
@@ -51,7 +81,7 @@ end
51
81
 
52
82
  desc "Build #{gem_file} into the pkg directory"
53
83
  task :build => :gemspec do
54
- sh "mkdir -p pkg"
84
+ FileUtils.mkdir_p 'pkg'
55
85
  sh "gem build #{gemspec_file}"
56
86
  sh "mv #{gem_file} pkg"
57
87
  end
@@ -1,5 +1,5 @@
1
1
  module Faraday
2
- VERSION = "0.8.4"
2
+ VERSION = "0.8.5"
3
3
 
4
4
  class << self
5
5
  attr_accessor :root_path, :lib_path
@@ -71,7 +71,9 @@ require 'faraday/adapter/em_synchrony/parallel_manager'
71
71
 
72
72
  # add missing patch(), options() methods
73
73
  EventMachine::HTTPMethods.module_eval do
74
- ([:patch, :options] - instance_methods).each do |type|
74
+ [:patch, :options].each do |type|
75
+ next if method_defined? :"a#{type}"
76
+ alias_method :"a#{type}", type if method_defined? type
75
77
  module_eval %[
76
78
  def #{type}(options = {}, &blk)
77
79
  f = Fiber.current
@@ -11,6 +11,10 @@ module Faraday
11
11
  opts[:ssl_verify_peer] = !!ssl.fetch(:verify, true)
12
12
  opts[:ssl_ca_path] = ssl[:ca_path] if ssl[:ca_path]
13
13
  opts[:ssl_ca_file] = ssl[:ca_file] if ssl[:ca_file]
14
+
15
+ # https://github.com/geemus/excon/issues/106
16
+ # https://github.com/jruby/jruby-ossl/issues/19
17
+ opts[:nonblock] = false
14
18
  end
15
19
 
16
20
  if ( req = env[:request] )
@@ -13,6 +13,7 @@ module Faraday
13
13
  EOFError,
14
14
  Errno::ECONNABORTED,
15
15
  Errno::ECONNREFUSED,
16
+ Errno::ENETUNREACH,
16
17
  Errno::ECONNRESET,
17
18
  Errno::EINVAL,
18
19
  Net::HTTPBadResponse,
@@ -53,6 +53,7 @@ module Faraday
53
53
 
54
54
  def create_session
55
55
  session = ::Patron::Session.new
56
+ session.insecure = true
56
57
  @block.call(session) if @block
57
58
  session
58
59
  end
@@ -31,7 +31,8 @@ module Faraday
31
31
  super
32
32
  rack_env = {
33
33
  :method => env[:method],
34
- :input => env[:body].respond_to?(:read) ? env[:body].read : env[:body]
34
+ :input => env[:body].respond_to?(:read) ? env[:body].read : env[:body],
35
+ 'rack.url_scheme' => env[:url].scheme
35
36
  }
36
37
 
37
38
  env[:request_headers].each do |name, value|
@@ -13,11 +13,22 @@ module Faraday
13
13
  attr_reader :params, :headers, :url_prefix, :builder, :options, :ssl, :parallel_manager
14
14
  attr_writer :default_parallel_manager
15
15
 
16
- # :url
17
- # :params
18
- # :headers
19
- # :request
20
- # :ssl
16
+ # Public: Initializes a new Faraday::Connection.
17
+ #
18
+ # url - URI or String base URL to use as a prefix for all
19
+ # requests (optional).
20
+ # options - Hash of settings that will be applied to every request made
21
+ # from this Connection (default: {}).
22
+ # :url - URI or String base URL (default: "http:/").
23
+ # :params - Hash of URI query unencoded key/value pairs.
24
+ # :headers - Hash of unencoded HTTP header key/value pairs.
25
+ # :request - Hash of request options.
26
+ # :ssl - Hash of SSL options.
27
+ # :proxy - URI, String or Hash of HTTP proxy options
28
+ # (default: "http_proxy" environment variable).
29
+ # :uri - URI or String
30
+ # :user - String (optional)
31
+ # :password - String (optional)
21
32
  def initialize(url = nil, options = {})
22
33
  if url.is_a?(Hash)
23
34
  options = url
@@ -154,11 +165,19 @@ module Faraday
154
165
  return @proxy if arg.nil?
155
166
 
156
167
  @proxy = if arg.is_a? Hash
157
- uri = arg.fetch(:uri) { raise ArgumentError, "no :uri option" }
158
- arg.merge :uri => self.class.URI(uri)
168
+ uri = self.class.URI arg.fetch(:uri) { raise ArgumentError, "missing :uri" }
169
+ arg.merge :uri => uri
159
170
  else
160
- {:uri => self.class.URI(arg)}
171
+ uri = self.class.URI(arg)
172
+ {:uri => uri}
173
+ end
174
+
175
+ with_uri_credentials(uri) do |user, password|
176
+ @proxy[:user] ||= user
177
+ @proxy[:password] ||= password
161
178
  end
179
+
180
+ @proxy
162
181
  end
163
182
 
164
183
  # normalize URI() behavior across Ruby versions
@@ -193,8 +212,8 @@ module Faraday
193
212
  params.merge_query(uri.query)
194
213
  uri.query = nil
195
214
 
196
- if uri.user && uri.password
197
- basic_auth(CGI.unescape(uri.user), CGI.unescape(uri.password))
215
+ with_uri_credentials(uri) do |user, password|
216
+ basic_auth user, password
198
217
  uri.user = uri.password = nil
199
218
  end
200
219
 
@@ -282,5 +301,12 @@ module Faraday
282
301
  def dup
283
302
  self.class.new(build_url(''), :headers => headers.dup, :params => params.dup, :builder => builder.dup, :ssl => ssl.dup)
284
303
  end
304
+
305
+ # Internal: Yields username and password extracted from a URI if they both exist.
306
+ def with_uri_credentials(uri)
307
+ if uri.user and uri.password
308
+ yield Utils.unescape(uri.user), Utils.unescape(uri.password)
309
+ end
310
+ end
285
311
  end
286
312
  end
@@ -126,7 +126,7 @@ module Faraday
126
126
 
127
127
  def merge_query(query)
128
128
  if query && !query.empty?
129
- update Utils.parse_query(query)
129
+ update Utils.parse_nested_query(query)
130
130
  end
131
131
  self
132
132
  end
@@ -170,7 +170,13 @@ module Faraday
170
170
  end
171
171
  end
172
172
 
173
- def escape(s) CGI.escape s.to_s end
173
+ ESCAPE_RE = /[^\w .~-]+/
174
+
175
+ def escape(s)
176
+ s.to_s.gsub(ESCAPE_RE) {
177
+ '%' + $&.unpack('H2' * $&.bytesize).join('%').upcase
178
+ }.tr(' ', '+')
179
+ end
174
180
 
175
181
  def unescape(s) CGI.unescape s.to_s end
176
182
 
@@ -10,6 +10,7 @@
10
10
  # $ script/test
11
11
  # $ script/test test/env_test.rb
12
12
  # $ script/test excon typhoeus
13
+ # $ SSL=yes script/test net_http -- -n /ssl/
13
14
 
14
15
  require 'rubygems'
15
16
  require 'bundler'
@@ -24,10 +25,19 @@ end
24
25
 
25
26
  $VERBOSE = true
26
27
 
27
- host = '127.0.0.1'
28
+ host = 'localhost'
28
29
  logfile = 'log/test.log'
29
30
  test_glob = 'test/**/*_test.rb'
30
31
 
32
+ if ssl_mode = ENV['SSL'] == 'yes'
33
+ unless ENV['SSL_KEY'] and ENV['SSL_FILE']
34
+ key_file = ENV['SSL_KEY'] = 'tmp/faraday-cert.key'
35
+ cert_file = ENV['SSL_FILE'] = 'tmp/faraday-cert.crt'
36
+ system 'rake', key_file, cert_file
37
+ abort unless $?.success?
38
+ end
39
+ end
40
+
31
41
  require 'fileutils'
32
42
  FileUtils.mkdir_p 'log'
33
43
 
@@ -42,6 +52,8 @@ end
42
52
 
43
53
  server = nil
44
54
 
55
+ Thread.abort_on_exception = true
56
+
45
57
  # start test server in a separate thread
46
58
  thread = Thread.new do
47
59
  old_verbose, $VERBOSE = $VERBOSE, nil
@@ -57,6 +69,14 @@ thread = Thread.new do
57
69
  :Port => port, :Logger => WEBrick::Log::new(log_io),
58
70
  :AccessLog => [[log_io, "[%{X-Faraday-Adapter}i] %m %U -> %s %b"]]
59
71
  }
72
+ if ssl_mode
73
+ require 'webrick/https'
74
+ webrick_opts.update \
75
+ :SSLEnable => true,
76
+ :SSLPrivateKey => OpenSSL::PKey::RSA.new(File.read(key_file)),
77
+ :SSLCertificate => OpenSSL::X509::Certificate.new(File.read(cert_file)),
78
+ :SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE
79
+ end
60
80
  Rack::Handler::WEBrick.run(Faraday::LiveServer, webrick_opts) {|serv| server = serv }
61
81
  end
62
82
 
@@ -76,28 +96,36 @@ if ARGV.any?
76
96
  test_files.concat extra_args
77
97
  end
78
98
 
79
- require 'net/http'
99
+ require 'net/https'
80
100
  conn = Net::HTTP.new host, port
81
- conn.open_timeout = conn.read_timeout = 0.05
101
+ conn.open_timeout = conn.read_timeout = 0.1
102
+ conn.use_ssl = ssl_mode
103
+ conn.verify_mode = OpenSSL::SSL::VERIFY_NONE
82
104
 
83
105
  # test if test server is accepting requests
84
106
  responsive = lambda { |path|
85
107
  begin
86
108
  res = conn.start { conn.get(path) }
87
109
  res.is_a?(Net::HTTPSuccess)
88
- rescue Errno::ECONNREFUSED, Errno::EBADF, Timeout::Error
110
+ rescue Errno::ECONNREFUSED, Errno::EBADF, Timeout::Error, Net::HTTPBadResponse
89
111
  false
90
112
  end
91
113
  }
92
114
 
93
- require 'timeout'
94
- Timeout.timeout 40 do
115
+ server_pings = 0
116
+ begin
95
117
  # block until test server is ready
96
- thread.join 0.05 until responsive.call('/echo')
97
- end
118
+ thread.join 0.05
119
+ server_pings += 1
120
+ abort "test server didn't manage to start" if server_pings >= 50
121
+ end until responsive.call('/echo')
98
122
 
99
- ENV['LIVE'] = "http://#{host}:#{port}"
100
- system 'ruby', '-Ilib:test', '-S', 'testrb', *test_files
123
+ ENV['LIVE'] = "http#{ssl_mode ? 's' : ''}://#{host}:#{port}"
124
+ ok = system 'ruby', '-Ilib:test',
125
+ '-e', 'load(ARGV.shift) while ARGV.first =~ /^[^-]/',
126
+ *test_files
101
127
 
102
128
  server.respond_to?(:stop!) ? server.stop! : server.stop
103
129
  thread.join
130
+
131
+ exit 1 unless ok
@@ -8,7 +8,8 @@ module Adapters
8
8
  Integration.apply(self, :Parallel) do
9
9
  # https://github.com/eventmachine/eventmachine/pull/289
10
10
  undef :test_timeout
11
- end
11
+ end unless jruby? and ssl_mode?
12
+ # https://github.com/eventmachine/eventmachine/issues/180
12
13
 
13
14
  end
14
15
  end
@@ -8,7 +8,7 @@ module Adapters
8
8
  Integration.apply(self, :Parallel) do
9
9
  # https://github.com/eventmachine/eventmachine/pull/289
10
10
  undef :test_timeout
11
- end
11
+ end unless RUBY_VERSION < '1.9' or jruby?
12
12
 
13
- end unless RUBY_VERSION < '1.9' or (defined? RUBY_ENGINE and 'jruby' == RUBY_ENGINE)
13
+ end
14
14
  end
@@ -5,6 +5,9 @@ module Adapters
5
5
 
6
6
  def adapter() :excon end
7
7
 
8
- Integration.apply(self, :NonParallel)
8
+ Integration.apply(self, :NonParallel) do
9
+ # https://github.com/geemus/excon/issues/126 ?
10
+ undef :test_timeout if ssl_mode?
11
+ end
9
12
  end
10
13
  end
@@ -7,9 +7,11 @@ module Adapters
7
7
  # `#adapter` required. returns a symbol for the adapter middleware name
8
8
  # `#adapter_options` optional. extra arguments for building an adapter
9
9
  module Integration
10
- def self.apply(base, *extras)
10
+ def self.apply(base, *extra_features)
11
11
  if base.live_server?
12
- ([:Common] + extras).each {|name| base.send(:include, self.const_get(name)) }
12
+ features = [:Common]
13
+ features.concat extra_features
14
+ features.each {|name| base.send(:include, self.const_get(name)) }
13
15
  yield if block_given?
14
16
  elsif !defined? @warned
15
17
  warn "Warning: Not running integration tests against a live server."
@@ -93,6 +95,11 @@ module Adapters
93
95
  assert_equal 'Agent Faraday', response.body
94
96
  end
95
97
 
98
+ def test_GET_ssl
99
+ expected = self.class.ssl_mode?.to_s
100
+ assert_equal expected, get('ssl').body
101
+ end
102
+
96
103
  def test_POST_send_url_encoded_params
97
104
  assert_equal %(post {"name"=>"zack"}), post('echo', :name => 'zack').body
98
105
  end
@@ -180,7 +187,10 @@ module Adapters
180
187
  end
181
188
 
182
189
  server = self.class.live_server
183
- url = 'http://%s:%d' % [server.host, server.port]
190
+ url = '%s://%s:%d' % [server.scheme, server.host, server.port]
191
+
192
+ options[:ssl] ||= {}
193
+ options[:ssl][:ca_file] ||= ENV['SSL_FILE']
184
194
 
185
195
  Faraday::Connection.new(url, options, &builder_block).tap do |conn|
186
196
  conn.headers['X-Faraday-Adapter'] = adapter.to_s
@@ -10,11 +10,5 @@ module Adapters
10
10
 
11
11
  Integration.apply(self, *behaviors)
12
12
 
13
- def test_configure_ssl
14
- http = Net::HTTP.new 'disney.com', 443
15
- # this should not raise an error
16
- Faraday::Adapter::NetHttp.new.configure_ssl(http, :ssl => {:verify => true})
17
- end
18
-
19
13
  end
20
14
  end
@@ -11,7 +11,7 @@ module Adapters
11
11
 
12
12
  # https://github.com/toland/patron/issues/52
13
13
  undef :test_GET_with_body
14
- end
14
+ end unless jruby?
15
15
 
16
- end unless defined? RUBY_ENGINE and 'jruby' == RUBY_ENGINE
16
+ end
17
17
  end
@@ -8,7 +8,7 @@ module Adapters
8
8
  Integration.apply(self, :Parallel) do
9
9
  # https://github.com/dbalatero/typhoeus/issues/75
10
10
  undef :test_GET_with_body
11
- end
11
+ end unless jruby?
12
12
 
13
- end unless defined? RUBY_ENGINE and 'jruby' == RUBY_ENGINE
13
+ end
14
14
  end
@@ -3,13 +3,17 @@ require 'uri'
3
3
 
4
4
  class TestConnection < Faraday::TestCase
5
5
 
6
- def with_proxy_env(proxy)
7
- old_proxy = ENV['http_proxy']
8
- ENV['http_proxy'] = proxy
6
+ def with_env(key, proxy)
7
+ old_value = ENV.fetch(key, false)
8
+ ENV[key] = proxy
9
9
  begin
10
10
  yield
11
11
  ensure
12
- ENV['http_proxy'] = old_proxy
12
+ if old_value == false
13
+ ENV.delete key
14
+ else
15
+ ENV[key] = old_value
16
+ end
13
17
  end
14
18
  end
15
19
 
@@ -175,6 +179,12 @@ class TestConnection < Faraday::TestCase
175
179
  assert_equal "a%5Bb%5D=1+%2B+2", uri.query
176
180
  end
177
181
 
182
+ def test_build_url_escapes_per_spec
183
+ conn = Faraday::Connection.new
184
+ uri = conn.build_url('http:/', 'a' => '1+2 foo~bar.-baz')
185
+ assert_equal "a=1%2B2+foo~bar.-baz", uri.query
186
+ end
187
+
178
188
  def test_build_url_bracketizes_nested_params_in_query
179
189
  conn = Faraday::Connection.new
180
190
  uri = conn.build_url("http://sushi.com/sake.html", 'a' => {'b' => 'c'})
@@ -203,7 +213,7 @@ class TestConnection < Faraday::TestCase
203
213
  end
204
214
 
205
215
  def test_proxy_accepts_string
206
- with_proxy_env "http://duncan.proxy.com:80" do
216
+ with_env 'http_proxy', "http://duncan.proxy.com:80" do
207
217
  conn = Faraday::Connection.new
208
218
  conn.proxy 'http://proxy.com'
209
219
  assert_equal 'proxy.com', conn.proxy[:uri].host
@@ -212,7 +222,7 @@ class TestConnection < Faraday::TestCase
212
222
  end
213
223
 
214
224
  def test_proxy_accepts_uri
215
- with_proxy_env "http://duncan.proxy.com:80" do
225
+ with_env 'http_proxy', "http://duncan.proxy.com:80" do
216
226
  conn = Faraday::Connection.new
217
227
  conn.proxy URI.parse('http://proxy.com')
218
228
  assert_equal 'proxy.com', conn.proxy[:uri].host
@@ -221,7 +231,7 @@ class TestConnection < Faraday::TestCase
221
231
  end
222
232
 
223
233
  def test_proxy_accepts_hash_with_string_uri
224
- with_proxy_env "http://duncan.proxy.com:80" do
234
+ with_env 'http_proxy', "http://duncan.proxy.com:80" do
225
235
  conn = Faraday::Connection.new
226
236
  conn.proxy :uri => 'http://proxy.com', :user => 'rick'
227
237
  assert_equal 'proxy.com', conn.proxy[:uri].host
@@ -230,7 +240,7 @@ class TestConnection < Faraday::TestCase
230
240
  end
231
241
 
232
242
  def test_proxy_accepts_hash
233
- with_proxy_env "http://duncan.proxy.com:80" do
243
+ with_env 'http_proxy', "http://duncan.proxy.com:80" do
234
244
  conn = Faraday::Connection.new
235
245
  conn.proxy :uri => URI.parse('http://proxy.com'), :user => 'rick'
236
246
  assert_equal 'proxy.com', conn.proxy[:uri].host
@@ -239,12 +249,20 @@ class TestConnection < Faraday::TestCase
239
249
  end
240
250
 
241
251
  def test_proxy_accepts_http_env
242
- with_proxy_env "http://duncan.proxy.com:80" do
252
+ with_env 'http_proxy', "http://duncan.proxy.com:80" do
243
253
  conn = Faraday::Connection.new
244
254
  assert_equal 'duncan.proxy.com', conn.proxy[:uri].host
245
255
  end
246
256
  end
247
257
 
258
+ def test_proxy_accepts_http_env_with_auth
259
+ with_env 'http_proxy', "http://a%40b:my%20pass@duncan.proxy.com:80" do
260
+ conn = Faraday::Connection.new
261
+ assert_equal 'a@b', conn.proxy[:user]
262
+ assert_equal 'my pass', conn.proxy[:password]
263
+ end
264
+ end
265
+
248
266
  def test_proxy_requires_uri
249
267
  conn = Faraday::Connection.new
250
268
  assert_raises ArgumentError do
@@ -252,12 +270,6 @@ class TestConnection < Faraday::TestCase
252
270
  end
253
271
  end
254
272
 
255
- def test_params_to_query_converts_hash_of_params_to_uri_escaped_query_string
256
- conn = Faraday::Connection.new
257
- url = conn.build_url('', 'a[b]' => '1 + 2')
258
- assert_equal "a%5Bb%5D=1+%2B+2", url.query
259
- end
260
-
261
273
  def test_dups_connection_object
262
274
  conn = Faraday::Connection.new 'http://sushi.com/foo',
263
275
  :ssl => { :verify => :none },
@@ -372,4 +384,16 @@ class TestRequestParams < Faraday::TestCase
372
384
  end
373
385
  assert_query_equal %w[b=b], query
374
386
  end
387
+
388
+ def test_array_params_in_url
389
+ create_connection 'http://a.co/page1?color[]=red&color[]=blue'
390
+ query = get
391
+ assert_equal "color%5B%5D=red&color%5B%5D=blue", query
392
+ end
393
+
394
+ def test_array_params_in_params
395
+ create_connection 'http://a.co/page1', :params => {:color => ['red', 'blue']}
396
+ query = get
397
+ assert_equal "color%5B%5D=red&color%5B%5D=blue", query
398
+ end
375
399
  end
@@ -69,5 +69,17 @@ module Faraday
69
69
  $stderr = old
70
70
  end
71
71
  end
72
+
73
+ def self.jruby?
74
+ defined? RUBY_ENGINE and 'jruby' == RUBY_ENGINE
75
+ end
76
+
77
+ def self.rbx?
78
+ defined? RUBY_ENGINE and 'rbx' == RUBY_ENGINE
79
+ end
80
+
81
+ def self.ssl_mode?
82
+ ENV['SSL'] == 'yes'
83
+ end
72
84
  end
73
85
  end
@@ -42,6 +42,10 @@ class LiveServer < Sinatra::Base
42
42
  [200, {}, 'ok']
43
43
  end
44
44
 
45
+ get '/ssl' do
46
+ request.secure?.to_s
47
+ end
48
+
45
49
  error do |e|
46
50
  "#{e.class}\n#{e.to_s}\n#{e.backtrace.join("\n")}"
47
51
  end
metadata CHANGED
@@ -1,80 +1,64 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
5
4
  prerelease:
5
+ version: 0.8.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Rick Olson
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-15 00:00:00.000000000 Z
12
+ date: 2013-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: multipart-post
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
15
+ version_requirements: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.1'
20
+ none: false
21
+ name: multipart-post
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
24
+ requirement: !ruby/object:Gem::Requirement
26
25
  requirements:
27
26
  - - ~>
28
27
  - !ruby/object:Gem::Version
29
28
  version: '1.1'
30
- - !ruby/object:Gem::Dependency
31
- name: rake
32
- requirement: !ruby/object:Gem::Requirement
33
29
  none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
38
- type: :development
39
- prerelease: false
30
+ - !ruby/object:Gem::Dependency
40
31
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
32
  requirements:
43
33
  - - ! '>='
44
34
  - !ruby/object:Gem::Version
45
35
  version: '0'
46
- - !ruby/object:Gem::Dependency
47
- name: simplecov
48
- requirement: !ruby/object:Gem::Requirement
49
36
  none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
37
+ name: rake
54
38
  type: :development
55
39
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
40
+ requirement: !ruby/object:Gem::Requirement
58
41
  requirements:
59
42
  - - ! '>='
60
43
  - !ruby/object:Gem::Version
61
44
  version: '0'
62
- - !ruby/object:Gem::Dependency
63
- name: test-unit
64
- requirement: !ruby/object:Gem::Requirement
65
45
  none: false
46
+ - !ruby/object:Gem::Dependency
47
+ version_requirements: !ruby/object:Gem::Requirement
66
48
  requirements:
67
49
  - - ! '>='
68
50
  - !ruby/object:Gem::Version
69
51
  version: '0'
52
+ none: false
53
+ name: simplecov
70
54
  type: :development
71
55
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
56
+ requirement: !ruby/object:Gem::Requirement
74
57
  requirements:
75
58
  - - ! '>='
76
59
  - !ruby/object:Gem::Version
77
60
  version: '0'
61
+ none: false
78
62
  description:
79
63
  email: technoweenie@gmail.com
80
64
  executables: []
@@ -85,12 +69,9 @@ files:
85
69
  - LICENSE.md
86
70
  - README.md
87
71
  - Rakefile
88
- - faraday.gemspec
89
- - lib/faraday.rb
90
- - lib/faraday/adapter.rb
91
72
  - lib/faraday/adapter/em_http.rb
92
- - lib/faraday/adapter/em_synchrony.rb
93
73
  - lib/faraday/adapter/em_synchrony/parallel_manager.rb
74
+ - lib/faraday/adapter/em_synchrony.rb
94
75
  - lib/faraday/adapter/excon.rb
95
76
  - lib/faraday/adapter/net_http.rb
96
77
  - lib/faraday/adapter/net_http_persistent.rb
@@ -98,23 +79,24 @@ files:
98
79
  - lib/faraday/adapter/rack.rb
99
80
  - lib/faraday/adapter/test.rb
100
81
  - lib/faraday/adapter/typhoeus.rb
82
+ - lib/faraday/adapter.rb
101
83
  - lib/faraday/builder.rb
102
84
  - lib/faraday/connection.rb
103
85
  - lib/faraday/error.rb
104
86
  - lib/faraday/middleware.rb
105
- - lib/faraday/request.rb
106
87
  - lib/faraday/request/authorization.rb
107
88
  - lib/faraday/request/basic_authentication.rb
108
89
  - lib/faraday/request/multipart.rb
109
90
  - lib/faraday/request/retry.rb
110
91
  - lib/faraday/request/token_authentication.rb
111
92
  - lib/faraday/request/url_encoded.rb
112
- - lib/faraday/response.rb
93
+ - lib/faraday/request.rb
113
94
  - lib/faraday/response/logger.rb
114
95
  - lib/faraday/response/raise_error.rb
96
+ - lib/faraday/response.rb
115
97
  - lib/faraday/upload_io.rb
116
98
  - lib/faraday/utils.rb
117
- - script/test
99
+ - lib/faraday.rb
118
100
  - test/adapters/default_test.rb
119
101
  - test/adapters/em_http_test.rb
120
102
  - test/adapters/em_synchrony_test.rb
@@ -136,49 +118,30 @@ files:
136
118
  - test/middleware_stack_test.rb
137
119
  - test/request_middleware_test.rb
138
120
  - test/response_middleware_test.rb
139
- homepage: https://github.com/technoweenie/faraday
140
- licenses: []
121
+ - script/test
122
+ homepage: https://github.com/lostisland/faraday
123
+ licenses:
124
+ - MIT
141
125
  post_install_message:
142
126
  rdoc_options: []
143
127
  require_paths:
144
128
  - lib
145
129
  required_ruby_version: !ruby/object:Gem::Requirement
146
- none: false
147
130
  requirements:
148
131
  - - ! '>='
149
132
  - !ruby/object:Gem::Version
150
133
  version: '0'
151
- required_rubygems_version: !ruby/object:Gem::Requirement
152
134
  none: false
135
+ required_rubygems_version: !ruby/object:Gem::Requirement
153
136
  requirements:
154
137
  - - ! '>='
155
138
  - !ruby/object:Gem::Version
156
- version: 1.3.5
139
+ version: 1.3.6
140
+ none: false
157
141
  requirements: []
158
142
  rubyforge_project:
159
143
  rubygems_version: 1.8.23
160
144
  signing_key:
161
145
  specification_version: 2
162
146
  summary: HTTP/REST API client library.
163
- test_files:
164
- - test/adapters/default_test.rb
165
- - test/adapters/em_http_test.rb
166
- - test/adapters/em_synchrony_test.rb
167
- - test/adapters/excon_test.rb
168
- - test/adapters/integration.rb
169
- - test/adapters/logger_test.rb
170
- - test/adapters/net_http_persistent_test.rb
171
- - test/adapters/net_http_test.rb
172
- - test/adapters/patron_test.rb
173
- - test/adapters/rack_test.rb
174
- - test/adapters/test_middleware_test.rb
175
- - test/adapters/typhoeus_test.rb
176
- - test/authentication_middleware_test.rb
177
- - test/connection_test.rb
178
- - test/env_test.rb
179
- - test/helper.rb
180
- - test/live_server.rb
181
- - test/middleware/retry_test.rb
182
- - test/middleware_stack_test.rb
183
- - test/request_middleware_test.rb
184
- - test/response_middleware_test.rb
147
+ test_files: []
@@ -1,81 +0,0 @@
1
- Gem::Specification.new do |s|
2
- s.specification_version = 2 if s.respond_to? :specification_version=
3
- s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if s.respond_to? :required_rubygems_version=
4
-
5
- s.name = 'faraday'
6
- s.version = '0.8.4'
7
-
8
- s.summary = "HTTP/REST API client library."
9
- # TODO: s.description
10
-
11
- s.authors = ["Rick Olson"]
12
- s.email = 'technoweenie@gmail.com'
13
- s.homepage = 'https://github.com/technoweenie/faraday'
14
-
15
- s.add_dependency 'multipart-post', '~> 1.1'
16
- s.add_development_dependency 'rake'
17
- s.add_development_dependency 'simplecov'
18
- s.add_development_dependency 'test-unit'
19
-
20
- # = MANIFEST =
21
- s.files = %w[
22
- Gemfile
23
- LICENSE.md
24
- README.md
25
- Rakefile
26
- faraday.gemspec
27
- lib/faraday.rb
28
- lib/faraday/adapter.rb
29
- lib/faraday/adapter/em_http.rb
30
- lib/faraday/adapter/em_synchrony.rb
31
- lib/faraday/adapter/em_synchrony/parallel_manager.rb
32
- lib/faraday/adapter/excon.rb
33
- lib/faraday/adapter/net_http.rb
34
- lib/faraday/adapter/net_http_persistent.rb
35
- lib/faraday/adapter/patron.rb
36
- lib/faraday/adapter/rack.rb
37
- lib/faraday/adapter/test.rb
38
- lib/faraday/adapter/typhoeus.rb
39
- lib/faraday/builder.rb
40
- lib/faraday/connection.rb
41
- lib/faraday/error.rb
42
- lib/faraday/middleware.rb
43
- lib/faraday/request.rb
44
- lib/faraday/request/authorization.rb
45
- lib/faraday/request/basic_authentication.rb
46
- lib/faraday/request/multipart.rb
47
- lib/faraday/request/retry.rb
48
- lib/faraday/request/token_authentication.rb
49
- lib/faraday/request/url_encoded.rb
50
- lib/faraday/response.rb
51
- lib/faraday/response/logger.rb
52
- lib/faraday/response/raise_error.rb
53
- lib/faraday/upload_io.rb
54
- lib/faraday/utils.rb
55
- script/test
56
- test/adapters/default_test.rb
57
- test/adapters/em_http_test.rb
58
- test/adapters/em_synchrony_test.rb
59
- test/adapters/excon_test.rb
60
- test/adapters/integration.rb
61
- test/adapters/logger_test.rb
62
- test/adapters/net_http_persistent_test.rb
63
- test/adapters/net_http_test.rb
64
- test/adapters/patron_test.rb
65
- test/adapters/rack_test.rb
66
- test/adapters/test_middleware_test.rb
67
- test/adapters/typhoeus_test.rb
68
- test/authentication_middleware_test.rb
69
- test/connection_test.rb
70
- test/env_test.rb
71
- test/helper.rb
72
- test/live_server.rb
73
- test/middleware/retry_test.rb
74
- test/middleware_stack_test.rb
75
- test/request_middleware_test.rb
76
- test/response_middleware_test.rb
77
- ]
78
- # = MANIFEST =
79
-
80
- s.test_files = s.files.select { |path| path =~ %r{^test/*/.+\.rb} }
81
- end