rest-core 3.5.3 → 3.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +7 -0
- data/README.md +2 -1
- data/lib/rest-core/middleware/cache.rb +1 -1
- data/lib/rest-core/promise.rb +1 -1
- data/lib/rest-core/version.rb +1 -1
- data/rest-core.gemspec +3 -3
- data/test/test_cache.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c924d022a2e6884c045b8d70ad7c1a30d86a5ca5
|
4
|
+
data.tar.gz: 29232062eafc2a9f2dc6619da8470c79cf475dab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9b3a2c2fd0c54d3406988ded11b4954a7f620f3209a8fec4187e013a39b039be17a8ce68186365ed6c7d0a740130b177ab06f9323cea5b87bd88746235c3351
|
7
|
+
data.tar.gz: 87b917cd53b4f80ed97d7ed172b5ad54063d5db868b525ca0501297f85c2f413d1c88d43ee80a8e59cda2179f5c0600156f4d36b0e85eca8169bfba210fe2d75
|
data/CHANGES.md
CHANGED
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
|
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
|
data/lib/rest-core/promise.rb
CHANGED
data/lib/rest-core/version.rb
CHANGED
data/rest-core.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: rest-core 3.5.
|
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.
|
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
|
+
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.
|
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
|
+
date: 2015-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|