rest-core 3.5.3 → 3.5.4

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: fe0c761a5d6c0bc856f35b558c9f70a74ac36815
4
- data.tar.gz: 27c1295dc0082285072cfcd618afca9f5bf3b39f
3
+ metadata.gz: c924d022a2e6884c045b8d70ad7c1a30d86a5ca5
4
+ data.tar.gz: 29232062eafc2a9f2dc6619da8470c79cf475dab
5
5
  SHA512:
6
- metadata.gz: c771af63c6cbc5b9ab95043aafedf83aa1e56c56e0179696a828a03b41dcf61cfb7f934db1e40a9e31632ae263e29ad62cdc87223d759603b1be6ac7b9e29154
7
- data.tar.gz: ae1f3a83d67d4790a0805fd77261d2eee610eb62680b076ff754691ce6cbf64b3a86871b84ebcf1f6a0b2d4247eb174784a65c7b0f8c76e5acd83008a3353050
6
+ metadata.gz: b9b3a2c2fd0c54d3406988ded11b4954a7f620f3209a8fec4187e013a39b039be17a8ce68186365ed6c7d0a740130b177ab06f9323cea5b87bd88746235c3351
7
+ data.tar.gz: 87b917cd53b4f80ed97d7ed172b5ad54063d5db868b525ca0501297f85c2f413d1c88d43ee80a8e59cda2179f5c0600156f4d36b0e85eca8169bfba210fe2d75
data/CHANGES.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # CHANGES
2
2
 
3
+ ## rest-core 3.5.4 -- 2015-01-17
4
+
5
+ ### Bugs fixed
6
+
7
+ * Fixed a regression where callback is not called for `RC::Cache` when cache
8
+ is available.
9
+
3
10
  ## rest-core 3.5.3 -- 2015-01-11
4
11
 
5
12
  ### Bugs fixed
data/README.md CHANGED
@@ -4,10 +4,11 @@ by Lin Jen-Shin ([godfat](http://godfat.org))
4
4
 
5
5
  Lin Jen-Shin ([godfat][]) had given a talk about rest-core on
6
6
  [RubyConf Taiwan 2011][talk]. The slide is in English, but the
7
- talk is in Mandarin.
7
+ talk is in Mandarin. There's another talk about [The Promise of rest-core][]
8
8
 
9
9
  [godfat]: https://github.com/godfat
10
10
  [talk]: http://rubyconf.tw/2011/#6
11
+ [The Promise of rest-core]: http://godfat.org/slide/2015-01-13-rest-core-promise/
11
12
 
12
13
  ## LINKS:
13
14
 
@@ -100,7 +100,7 @@ class RestCore::Cache
100
100
 
101
101
  def data_extract data, res, k
102
102
  _, status, headers, body =
103
- data.match(/\A(\d+)\n((?:[^\n]+\n)*)\n\n(.*)\Z/m).to_a
103
+ data.match(/\A(\d*)\n((?:[^\n]+\n)*)\n\n(.*)\Z/m).to_a
104
104
 
105
105
  Promise.claim(res, k, body, status.to_i,
106
106
  Hash[(headers||'').scan(/([^:]+): ([^\n]+)\n/)]).future_response
@@ -16,7 +16,7 @@ class RestCore::Promise
16
16
  end
17
17
 
18
18
  def self.claim env, k=RC.id, body, status, headers
19
- promise = new(env, k)
19
+ promise = new(env, k, env[ASYNC])
20
20
  promise.fulfill(body, status, headers)
21
21
  promise
22
22
  end
@@ -1,4 +1,4 @@
1
1
 
2
2
  module RestCore
3
- VERSION = '3.5.3'
3
+ VERSION = '3.5.4'
4
4
  end
data/rest-core.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: rest-core 3.5.3 ruby lib
2
+ # stub: rest-core 3.5.4 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "rest-core"
6
- s.version = "3.5.3"
6
+ s.version = "3.5.4"
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 = "2015-01-11"
11
+ s.date = "2015-01-17"
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_cache.rb CHANGED
@@ -68,6 +68,15 @@ describe RC::Cache do
68
68
  should.eq('OK')
69
69
  end
70
70
 
71
+ would 'still call callback for cached response' do
72
+ client = RC::Builder.client{ use RC::Cache, {}, nil; run RC::Dry }.new
73
+ client.get('', {}, RC::RESPONSE_BODY => 'nnf') do |a|
74
+ client.get('') do |res|
75
+ res.should.eq 'nnf'
76
+ end
77
+ end.wait
78
+ end
79
+
71
80
  would 'not raise error if headers is nil' do
72
81
  path = 'http://a'
73
82
  stub_request(:get , path).to_return(:body => 'OK', :headers => nil)
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.3
4
+ version: 3.5.4
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: 2015-01-11 00:00:00.000000000 Z
11
+ date: 2015-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient