rest-core 3.5.0 → 3.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4cd61e7344e03258e5ef9482bf9270e29115ee2
4
- data.tar.gz: fbc1f00dcb47c15daec112ea4cf6a7397331bc74
3
+ metadata.gz: 0deea3c56ae01f19f5d7f7d6b32a6ea35259846b
4
+ data.tar.gz: ce45a4ddcadda96dfecec4ad2ad24079f5fedcb9
5
5
  SHA512:
6
- metadata.gz: ffc882cb23b1e1b9017d910c4fb34c77258f4c4afd93eceb6cfb96ef1068fb8afd356c330fdb36ea5bfc8345d985cacfedb72eb374422368d8b573c85220b93c
7
- data.tar.gz: aeb92a57d45711993ed90d561b9f4d39e780d5715c3d97acf5310d8089445a071ec0593958ecb7d024c147b3cb8e326153bbc64885e2b0fa89de10ff3c67b736
6
+ metadata.gz: 6b1f3bd1b3b254cd7c922dddebe618f134c4cf2d328b018584b0390410adc1218b8bf6333f163ddd9698a54d88347ef5d3fdb850e7b50c3cc7ba63b7a0797457
7
+ data.tar.gz: 0314d2a3658e30486a13d7e9ffbb9fd8d63d8fd1f5711fb38cd5c99b26576bb9af4698b337e1f97320b9ab35c51c0bffe556da73f6837483518971cfc414a9b8
data/.travis.yml CHANGED
@@ -1,11 +1,13 @@
1
-
2
1
  language: ruby
2
+
3
3
  rvm:
4
- - 1.9
5
4
  - 2.0
6
5
  - 2.1
6
+ - 2.2
7
7
  - rbx-2
8
8
  - jruby
9
9
 
10
10
  install: 'bundle install --retry=3'
11
11
  script: 'ruby -r bundler/setup -S rake test'
12
+
13
+ sudo: false
data/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGES
2
2
 
3
+ ## rest-core 3.5.1 -- 2014-12-27
4
+
5
+ * Ruby 2.2 compatibility.
6
+
3
7
  ## rest-core 3.5.0 -- 2014-12-09
4
8
 
5
9
  ### Incompatible changes
@@ -20,13 +20,13 @@ module RestCore::Client
20
20
  end
21
21
  end
22
22
 
23
- def default_#{name} app=app
23
+ def default_#{name} a=app
24
24
  if self.class.respond_to?("default_#{name}")
25
25
  self.class.default_#{name} # old class default style
26
- elsif app.respond_to?(:#{name})
27
- app.#{name}({}) # middleware instance value
28
- elsif app.respond_to?(:app)
29
- default_#{name}(app.app) # walk into next app
26
+ elsif a.respond_to?(:#{name})
27
+ a.#{name}({}) # middleware instance value
28
+ elsif a.respond_to?(:app)
29
+ default_#{name}(a.app) # walk into next app
30
30
  else
31
31
  nil
32
32
  end
@@ -154,16 +154,16 @@ module RestCore::Client
154
154
  self.class.event_source_class.new(self, path, query, opts)
155
155
  end
156
156
 
157
- def request env, app=app
157
+ def request env, a=app
158
158
  if block_given?
159
- request_full(env, app){ |response| yield(response[response_key(env)]) }
159
+ request_full(env, a){ |response| yield(response[response_key(env)]) }
160
160
  else
161
- request_full(env, app)[response_key(env)]
161
+ request_full(env, a)[response_key(env)]
162
162
  end
163
163
  end
164
164
 
165
- def request_full env, app=app, &k
166
- response = app.call(build_env({ASYNC => !!k}.merge(env))) do |res|
165
+ def request_full env, a=app, &k
166
+ response = a.call(build_env({ASYNC => !!k}.merge(env))) do |res|
167
167
  (k || RC.id).call(request_complete(res))
168
168
  end
169
169
 
@@ -50,11 +50,11 @@ module RestCore::Middleware
50
50
  env
51
51
  end
52
52
  end
53
- def run app=app
54
- if app.respond_to?(:app) && app.app
55
- run(app.app)
53
+ def run a=app
54
+ if a.respond_to?(:app) && a.app
55
+ run(a.app)
56
56
  else
57
- app
57
+ a
58
58
  end
59
59
  end
60
60
  def error_callback res, err
@@ -1,4 +1,4 @@
1
1
 
2
2
  module RestCore
3
- VERSION = '3.5.0'
3
+ VERSION = '3.5.1'
4
4
  end
data/rest-core.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: rest-core 3.5.0 ruby lib
2
+ # stub: rest-core 3.5.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "rest-core"
6
- s.version = "3.5.0"
6
+ s.version = "3.5.1"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib"]
10
10
  s.authors = ["Lin Jen-Shin (godfat)"]
11
- s.date = "2014-12-09"
11
+ s.date = "2014-12-27"
12
12
  s.description = "Modular Ruby clients interface for REST APIs.\n\nThere has been an explosion in the number of REST APIs available today.\nTo address the need for a way to access these APIs easily and elegantly,\nwe have developed rest-core, which consists of composable middleware\nthat allows you to build a REST client for any REST API. Or in the case of\ncommon APIs such as Facebook, Github, and Twitter, you can simply use the\ndedicated clients provided by [rest-more][].\n\n[rest-more]: https://github.com/godfat/rest-more"
13
13
  s.email = ["godfat (XD) godfat.org"]
14
14
  s.files = [
data/test/test_client.rb CHANGED
@@ -170,7 +170,7 @@ describe RC::Simple do
170
170
  error_callback = lambda{ |e| error = e }
171
171
  should.raise(Errno::ECONNREFUSED) do
172
172
  RC::Simple.new(:error_callback => error_callback).
173
- get('http://localhost/').tap{}
173
+ get('http://localhost:1').tap{}
174
174
  end
175
175
  error.should.kind_of?(Errno::ECONNREFUSED)
176
176
  end
@@ -61,7 +61,7 @@ describe RC::ErrorHandler do
61
61
  called = false
62
62
  RC::Builder.client do
63
63
  use RC::ErrorHandler, lambda{ |_| called = true }
64
- end.new.get('http://localhost') do |error|
64
+ end.new.get('http://localhost:1') do |error|
65
65
  error.should.kind_of?(SystemCallError)
66
66
  end.wait
67
67
  called.should.eq false
data/test/test_promise.rb CHANGED
@@ -50,7 +50,7 @@ describe RC::Promise do
50
50
  msg.should.eq 'boom'
51
51
  end
52
52
 
53
- @client.new.get('http://localhost/') do |err|
53
+ @client.new.get('http://localhost:1') do |err|
54
54
  err.should.kind_of?(Errno::ECONNREFUSED)
55
55
  raise 'boom'
56
56
  end.wait
@@ -59,7 +59,7 @@ describe RC::Promise do
59
59
  would 'call error_callback on errors' do
60
60
  errors = []
61
61
  @client.new(:error_callback => lambda{ |e| errors << e }).
62
- get('http://localhost/') do |err|
62
+ get('http://localhost:1') do |err|
63
63
  err.should.kind_of?(Errno::ECONNREFUSED)
64
64
  raise 'boom'
65
65
  end.wait
@@ -2,7 +2,7 @@
2
2
  require 'rest-core/test'
3
3
 
4
4
  describe RC::Universal do
5
- url = 'http://localhost/'
5
+ url = 'http://localhost:1'
6
6
 
7
7
  after do
8
8
  WebMock.reset!
@@ -34,8 +34,8 @@ describe RC::Universal do
34
34
  would 'follow redirect regardless response body' do
35
35
  called = []
36
36
  stub_request(:get, url).to_return(:body => 'bad json!',
37
- :status => 302, :headers => {'Location' => "#{url}a"})
38
- stub_request(:get, "#{url}a").to_return do
37
+ :status => 302, :headers => {'Location' => "#{url}/a"})
38
+ stub_request(:get, "#{url}/a").to_return do
39
39
  Thread.pass
40
40
  {:body => '{"good":"json!"}'}
41
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lin Jen-Shin (godfat)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-09 00:00:00.000000000 Z
11
+ date: 2014-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient