rest-core 1.0.3 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +6 -7
- data/CHANGES.md +137 -0
- data/Gemfile +1 -1
- data/README.md +183 -191
- data/TODO.md +5 -8
- data/example/multi.rb +31 -24
- data/example/simple.rb +28 -0
- data/example/use-cases.rb +194 -0
- data/lib/rest-core.rb +26 -19
- data/lib/rest-core/builder.rb +2 -2
- data/lib/rest-core/client.rb +40 -27
- data/lib/rest-core/client/universal.rb +16 -13
- data/lib/rest-core/client_oauth1.rb +5 -5
- data/lib/rest-core/engine/auto.rb +25 -0
- data/lib/rest-core/{app → engine}/dry.rb +1 -2
- data/lib/rest-core/engine/em-http-request.rb +39 -0
- data/lib/rest-core/engine/future/future.rb +106 -0
- data/lib/rest-core/engine/future/future_fiber.rb +39 -0
- data/lib/rest-core/engine/future/future_thread.rb +29 -0
- data/lib/rest-core/engine/rest-client.rb +56 -0
- data/lib/rest-core/middleware.rb +27 -5
- data/lib/rest-core/middleware/auth_basic.rb +5 -5
- data/lib/rest-core/middleware/bypass.rb +2 -2
- data/lib/rest-core/middleware/cache.rb +67 -54
- data/lib/rest-core/middleware/common_logger.rb +5 -8
- data/lib/rest-core/middleware/default_headers.rb +2 -2
- data/lib/rest-core/middleware/default_payload.rb +26 -2
- data/lib/rest-core/middleware/default_query.rb +4 -2
- data/lib/rest-core/middleware/default_site.rb +8 -6
- data/lib/rest-core/middleware/error_detector.rb +9 -16
- data/lib/rest-core/middleware/error_handler.rb +25 -11
- data/lib/rest-core/middleware/follow_redirect.rb +11 -14
- data/lib/rest-core/middleware/json_request.rb +19 -0
- data/lib/rest-core/middleware/json_response.rb +28 -0
- data/lib/rest-core/middleware/oauth1_header.rb +2 -7
- data/lib/rest-core/middleware/oauth2_header.rb +4 -7
- data/lib/rest-core/middleware/oauth2_query.rb +2 -2
- data/lib/rest-core/middleware/timeout.rb +21 -65
- data/lib/rest-core/middleware/timeout/{eventmachine_timer.rb → timer_em.rb} +3 -1
- data/lib/rest-core/middleware/timeout/timer_thread.rb +36 -0
- data/lib/rest-core/patch/multi_json.rb +8 -0
- data/lib/rest-core/test.rb +3 -12
- data/lib/rest-core/util/json.rb +65 -0
- data/lib/rest-core/util/parse_query.rb +2 -2
- data/lib/rest-core/version.rb +1 -1
- data/lib/rest-core/wrapper.rb +16 -16
- data/rest-core.gemspec +28 -27
- data/test/test_auth_basic.rb +14 -10
- data/test/test_builder.rb +7 -7
- data/test/test_cache.rb +126 -37
- data/test/test_client.rb +3 -1
- data/test/test_client_oauth1.rb +2 -3
- data/test/test_default_query.rb +17 -23
- data/test/test_em_http_request.rb +146 -0
- data/test/test_error_detector.rb +0 -1
- data/test/test_error_handler.rb +44 -0
- data/test/test_follow_redirect.rb +17 -19
- data/test/test_json_request.rb +28 -0
- data/test/test_json_response.rb +51 -0
- data/test/test_oauth1_header.rb +4 -4
- data/test/test_payload.rb +20 -12
- data/test/test_simple.rb +14 -0
- data/test/test_timeout.rb +11 -19
- data/test/test_universal.rb +5 -5
- data/test/test_wrapper.rb +19 -13
- metadata +28 -29
- data/doc/ToC.md +0 -7
- data/doc/dependency.md +0 -4
- data/doc/design.md +0 -4
- data/example/auto.rb +0 -51
- data/example/coolio.rb +0 -21
- data/example/eventmachine.rb +0 -30
- data/example/rest-client.rb +0 -16
- data/lib/rest-core/app/abstract/async_fiber.rb +0 -13
- data/lib/rest-core/app/auto.rb +0 -23
- data/lib/rest-core/app/coolio-async.rb +0 -32
- data/lib/rest-core/app/coolio-fiber.rb +0 -30
- data/lib/rest-core/app/coolio.rb +0 -9
- data/lib/rest-core/app/em-http-request-async.rb +0 -37
- data/lib/rest-core/app/em-http-request-fiber.rb +0 -45
- data/lib/rest-core/app/em-http-request.rb +0 -9
- data/lib/rest-core/app/rest-client.rb +0 -41
- data/lib/rest-core/middleware/json_decode.rb +0 -93
- data/lib/rest-core/middleware/timeout/coolio_timer.rb +0 -10
- data/pending/test_multi.rb +0 -123
- data/pending/test_test_util.rb +0 -86
- data/test/test_json_decode.rb +0 -24
data/test/test_error_detector.rb
CHANGED
@@ -0,0 +1,44 @@
|
|
1
|
+
|
2
|
+
require 'rest-core/test'
|
3
|
+
|
4
|
+
describe RC::ErrorHandler do
|
5
|
+
client = RC::Builder.client do
|
6
|
+
use RC::ErrorHandler
|
7
|
+
run RC::Dry
|
8
|
+
end
|
9
|
+
|
10
|
+
exp = Class.new(Exception)
|
11
|
+
|
12
|
+
describe 'there is an exception' do
|
13
|
+
should 'raise an error with future' do
|
14
|
+
lambda{
|
15
|
+
client.new.get('/', {}, RC::FAIL => [exp.new('fail')])
|
16
|
+
}.should.raise(exp)
|
17
|
+
end
|
18
|
+
|
19
|
+
should 'give an error with callback' do
|
20
|
+
client.new.get('/', {}, RC::FAIL => [exp.new('fail')]){ |res|
|
21
|
+
res.should.kind_of?(exp)
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe 'error_handler gives an exception' do
|
27
|
+
should 'raise an error with future' do
|
28
|
+
lambda{
|
29
|
+
client.new(:error_handler => lambda{ |res| exp.new }).
|
30
|
+
get('/', {}, RC::FAIL => [true])
|
31
|
+
}.should.raise(exp)
|
32
|
+
end
|
33
|
+
|
34
|
+
should 'give an error with callback' do
|
35
|
+
client.new(:error_handler => lambda{ |res| exp.new }).
|
36
|
+
get('/', {}, RC::FAIL => [true]){ |res| res.should.kind_of?(exp) }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
should 'no exception but errors' do
|
41
|
+
client.new(:error_handler => lambda{ |res| 1 }).
|
42
|
+
request({RC::FAIL => [0]}, RC::FAIL).should.eq [0, 1]
|
43
|
+
end
|
44
|
+
end
|
@@ -3,7 +3,13 @@ require 'rest-core/test'
|
|
3
3
|
|
4
4
|
describe RC::FollowRedirect do
|
5
5
|
before do
|
6
|
-
@dry =
|
6
|
+
@dry = Class.new do
|
7
|
+
attr_accessor :status
|
8
|
+
def call env
|
9
|
+
yield(env.merge(RC::RESPONSE_STATUS => status,
|
10
|
+
RC::RESPONSE_HEADERS => {'LOCATION' => 'location'}))
|
11
|
+
end
|
12
|
+
end.new
|
7
13
|
@app = RC::FollowRedirect.new(dry, 1)
|
8
14
|
end
|
9
15
|
after do
|
@@ -14,34 +20,26 @@ describe RC::FollowRedirect do
|
|
14
20
|
|
15
21
|
[301, 302, 303, 307].each do |status|
|
16
22
|
should "not follow redirect if reached max_redirects: #{status}" do
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
dry.status = status
|
24
|
+
app.call(RC::REQUEST_METHOD => :get, 'max_redirects' => 0){ |res|
|
25
|
+
res[RC::RESPONSE_HEADERS]['LOCATION'].should.eq 'location'
|
20
26
|
}
|
21
|
-
app.call(RC::REQUEST_METHOD => :get,
|
22
|
-
'max_redirects' => 0)[RC::RESPONSE_HEADERS]['LOCATION'].
|
23
|
-
should.eq 'location'
|
24
27
|
end
|
25
28
|
|
26
29
|
should "follow once: #{status}" do
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
}
|
31
|
-
app.call(RC::REQUEST_METHOD => :get)[RC::RESPONSE_HEADERS]['LOCATION'].
|
32
|
-
should.eq 'location'
|
30
|
+
dry.status = status
|
31
|
+
app.call(RC::REQUEST_METHOD => :get){ |res|
|
32
|
+
res[RC::RESPONSE_HEADERS]['LOCATION'].should.eq 'location'
|
33
|
+
}
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
36
37
|
[200, 201, 404, 500].each do |status|
|
37
38
|
should "not follow redirect if it's not a redirect status: #{status}" do
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
dry.status = status
|
40
|
+
app.call(RC::REQUEST_METHOD => :get, 'max_redirects' => 9){ |res|
|
41
|
+
res[RC::RESPONSE_HEADERS]['LOCATION'].should.eq 'location'
|
41
42
|
}
|
42
|
-
app.call(RC::REQUEST_METHOD => :get,
|
43
|
-
'max_redirects' => 9)[RC::RESPONSE_HEADERS]['LOCATION'].
|
44
|
-
should.eq 'location'
|
45
43
|
end
|
46
44
|
end
|
47
45
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
require 'rest-core/test'
|
3
|
+
|
4
|
+
describe RC::JsonRequest do
|
5
|
+
app = RC::JsonRequest.new(RC::Dry.new, true)
|
6
|
+
env = {RC::REQUEST_HEADERS => {}}
|
7
|
+
request_params = {
|
8
|
+
'key' => 'value',
|
9
|
+
'array' => [1, 2, 3],
|
10
|
+
'nested' => {'k' => 'v', 'a' => [4, 5, 6]}
|
11
|
+
}
|
12
|
+
|
13
|
+
should 'encode payload as json' do
|
14
|
+
e = env.merge(RC::REQUEST_METHOD => :post,
|
15
|
+
RC::REQUEST_PAYLOAD => request_params)
|
16
|
+
|
17
|
+
app.call(e){ |res|
|
18
|
+
res.should.eq(
|
19
|
+
RC::REQUEST_METHOD => :post,
|
20
|
+
RC::REQUEST_HEADERS => {'Content-Type' => 'application/json'},
|
21
|
+
RC::REQUEST_PAYLOAD => RC::Json.encode(request_params))}
|
22
|
+
end
|
23
|
+
|
24
|
+
should 'do nothing if json_request is false' do
|
25
|
+
app = RC::JsonRequest.new(RC::Dry.new, false)
|
26
|
+
app.call(env){ |res| res.should.eq res }
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
|
2
|
+
require 'rest-core/test'
|
3
|
+
|
4
|
+
describe RC::JsonResponse do
|
5
|
+
describe 'app' do
|
6
|
+
def app
|
7
|
+
@app ||= RC::JsonResponse.new(RC::Dry.new, true)
|
8
|
+
end
|
9
|
+
|
10
|
+
should 'do nothing' do
|
11
|
+
expected = {RC::RESPONSE_BODY => nil,
|
12
|
+
RC::REQUEST_HEADERS => {'Accept' => 'application/json'}}
|
13
|
+
app.call({}){ |response| response.should.eq(expected) }
|
14
|
+
end
|
15
|
+
|
16
|
+
should 'decode' do
|
17
|
+
expected = {RC::RESPONSE_BODY => {},
|
18
|
+
RC::REQUEST_HEADERS => {'Accept' => 'application/json'}}
|
19
|
+
app.call(RC::RESPONSE_BODY => '{}'){ |response|
|
20
|
+
response.should.eq(expected)
|
21
|
+
}
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe 'client' do
|
26
|
+
def client
|
27
|
+
@client ||= RC::Builder.client do
|
28
|
+
use RC::JsonResponse, true
|
29
|
+
run Class.new{
|
30
|
+
def call env
|
31
|
+
yield(env.merge(RC::RESPONSE_BODY => '{}'))
|
32
|
+
end
|
33
|
+
}
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
should 'do nothing' do
|
38
|
+
expected = '{}'
|
39
|
+
client.new(:json_response => false).get(''){ |response|
|
40
|
+
response.should.eq(expected)
|
41
|
+
}.get('').should.eq(expected)
|
42
|
+
end
|
43
|
+
|
44
|
+
should 'decode' do
|
45
|
+
expected = {}
|
46
|
+
client.new.get(''){ |response|
|
47
|
+
response.should.eq(expected)
|
48
|
+
}.get('').should.eq(expected)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/test/test_oauth1_header.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
2
|
require 'rest-core/test'
|
3
3
|
|
4
|
-
describe
|
4
|
+
describe RC::Oauth1Header do
|
5
5
|
before do
|
6
|
-
@env = {
|
7
|
-
|
6
|
+
@env = {RC::REQUEST_METHOD => :post,
|
7
|
+
RC::REQUEST_PATH =>
|
8
8
|
'https://api.twitter.com/oauth/request_token'}
|
9
9
|
|
10
10
|
callback =
|
@@ -18,7 +18,7 @@ describe RestCore::Oauth1Header do
|
|
18
18
|
'oauth_version' => '1.0' ,
|
19
19
|
'oauth_signature_method' => 'HMAC-SHA1'}
|
20
20
|
|
21
|
-
@auth =
|
21
|
+
@auth = RC::Oauth1Header.new(RC::Dry.new,
|
22
22
|
nil, nil, nil,
|
23
23
|
'GDdmIQH6jhtmLUypg82g',
|
24
24
|
'MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98')
|
data/test/test_payload.rb
CHANGED
@@ -2,28 +2,36 @@
|
|
2
2
|
require 'rest-core/test'
|
3
3
|
|
4
4
|
describe RC::DefaultPayload do
|
5
|
-
|
6
|
-
@app = RC::DefaultPayload.new(RC::Dry.new, {})
|
7
|
-
end
|
8
|
-
|
9
|
-
def app
|
10
|
-
@app
|
11
|
-
end
|
5
|
+
app = RC::DefaultPayload.new(RC::Dry.new, {})
|
12
6
|
|
13
7
|
should 'do nothing' do
|
14
|
-
app.call({})[RC::REQUEST_PAYLOAD].should.eq({})
|
8
|
+
app.call({}){ |r| r[RC::REQUEST_PAYLOAD].should.eq({}) }
|
15
9
|
end
|
16
10
|
|
17
11
|
should 'merge payload' do
|
18
12
|
app.instance_eval{@payload = {'pay' => 'load'}}
|
19
13
|
|
20
|
-
app.call({}).should.eq({RC::REQUEST_PAYLOAD =>
|
21
|
-
{'pay' => 'load'}})
|
14
|
+
app.call({}){ |r| r.should.eq({RC::REQUEST_PAYLOAD =>
|
15
|
+
{'pay' => 'load'}}) }
|
22
16
|
|
23
17
|
format = {'format' => 'json'}
|
24
18
|
env = {RC::REQUEST_PAYLOAD => format}
|
25
19
|
|
26
|
-
app.call(env).should.eq({RC::REQUEST_PAYLOAD =>
|
27
|
-
{'pay' => 'load'}.merge(format)})
|
20
|
+
app.call(env){ |r| r.should.eq({RC::REQUEST_PAYLOAD =>
|
21
|
+
{'pay' => 'load'}.merge(format)})}
|
22
|
+
end
|
23
|
+
|
24
|
+
should 'accept non-hash payload' do
|
25
|
+
u = RC::Universal.new(:log_method => false)
|
26
|
+
env = {RC::REQUEST_PAYLOAD => 'payload'}
|
27
|
+
u.request_full(env, u.dry)[RC::REQUEST_PAYLOAD].should.eq('payload')
|
28
|
+
|
29
|
+
u.payload = 'default'
|
30
|
+
u.request_full(env, u.dry)[RC::REQUEST_PAYLOAD].should.eq('payload')
|
31
|
+
u.request_full({} , u.dry)[RC::REQUEST_PAYLOAD].should.eq('default')
|
32
|
+
|
33
|
+
u = RC::Builder.client{use RC::DefaultPayload, 'maylord'}.new
|
34
|
+
u.request_full({} , u.dry)[RC::REQUEST_PAYLOAD].should.eq('maylord')
|
35
|
+
u.request_full(env, u.dry)[RC::REQUEST_PAYLOAD].should.eq('payload')
|
28
36
|
end
|
29
37
|
end
|
data/test/test_simple.rb
ADDED
data/test/test_timeout.rb
CHANGED
@@ -2,33 +2,25 @@
|
|
2
2
|
require 'rest-core/test'
|
3
3
|
|
4
4
|
describe RC::Timeout do
|
5
|
-
before do
|
6
|
-
@app = RC::Timeout.new(RC::Dry.new, 0)
|
7
|
-
end
|
8
|
-
|
9
5
|
after do
|
10
6
|
WebMock.reset!
|
7
|
+
RR.verify
|
8
|
+
end
|
9
|
+
|
10
|
+
def setup_app
|
11
|
+
RC::Timeout.new(RC::Dry.new, 0)
|
11
12
|
end
|
12
13
|
|
13
14
|
should 'bypass timeout if timeout is 0' do
|
14
|
-
|
15
|
-
|
15
|
+
app = setup_app
|
16
|
+
mock(app).monitor.times(0)
|
17
|
+
app.call({}){ |e| e.should.eq({}) }
|
16
18
|
end
|
17
19
|
|
18
20
|
should 'run the monitor to setup timeout' do
|
21
|
+
app = setup_app
|
19
22
|
env = {'timeout' => 2}
|
20
|
-
mock.proxy(
|
21
|
-
|
23
|
+
mock.proxy(app).monitor(env).times(1)
|
24
|
+
app.call(env){|e| e[RC::TIMER].should.kind_of?(RC::Timeout::TimerThread)}
|
22
25
|
end
|
23
|
-
|
24
|
-
should 'return correct result under fibers' do
|
25
|
-
path = 'http://example.com/'
|
26
|
-
stub_request(:get, path).to_return(:body => 'response')
|
27
|
-
|
28
|
-
c = RC::Builder.client do
|
29
|
-
use RC::Timeout, 10
|
30
|
-
run RC::EmHttpRequestFiber
|
31
|
-
end.new
|
32
|
-
EM.run{Fiber.new{c.get(path).should.eq('response');EM.stop}.resume}
|
33
|
-
end if defined?(Fiber)
|
34
26
|
end
|
data/test/test_universal.rb
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
|
2
2
|
require 'rest-core/test'
|
3
3
|
|
4
|
-
describe
|
4
|
+
describe RC::Universal do
|
5
5
|
should 'send Authorization header' do
|
6
|
-
u =
|
6
|
+
u = RC::Universal.new(:log_method => false)
|
7
7
|
u.username = 'Aladdin'
|
8
8
|
u.password = 'open sesame'
|
9
9
|
|
10
|
-
u.request_full({}, u.dry)[
|
10
|
+
u.request_full({}, u.dry)[RC::REQUEST_HEADERS].should.eq(
|
11
11
|
{'Authorization' => 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='})
|
12
12
|
|
13
13
|
acc = {'Accept' => 'text/plain'}
|
14
|
-
env = {
|
14
|
+
env = {RC::REQUEST_HEADERS => acc}
|
15
15
|
|
16
|
-
u.request_full(env, u.dry)[
|
16
|
+
u.request_full(env, u.dry)[RC::REQUEST_HEADERS].should.eq(
|
17
17
|
{'Authorization' => 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='}.merge(acc))
|
18
18
|
end
|
19
19
|
end
|
data/test/test_wrapper.rb
CHANGED
@@ -1,30 +1,36 @@
|
|
1
1
|
|
2
2
|
require 'rest-core/test'
|
3
3
|
|
4
|
-
describe
|
4
|
+
describe RC::Wrapper do
|
5
5
|
should 'wrap around simple middleware' do
|
6
|
-
wrapper =
|
7
|
-
wrapper.send(:include,
|
8
|
-
client =
|
6
|
+
wrapper = RC::Bypass.dup
|
7
|
+
wrapper.send(:include, RC::Wrapper)
|
8
|
+
client = RC::Builder.client do
|
9
9
|
use wrapper do
|
10
|
-
use
|
10
|
+
use RC::Bypass
|
11
11
|
end
|
12
|
-
run
|
12
|
+
run RC::Dry
|
13
13
|
end
|
14
14
|
|
15
|
-
client.new.app.call(
|
15
|
+
client.new.app.call(1=>2){ |res| res.should.eq(1=>2) }
|
16
16
|
end
|
17
17
|
|
18
18
|
should 'default app is RestCore::Dry' do
|
19
19
|
wrapper = Class.new
|
20
|
-
wrapper.send(:include,
|
21
|
-
wrapper.new.wrapped.class.should.eq
|
20
|
+
wrapper.send(:include, RC::Wrapper)
|
21
|
+
wrapper.new.wrapped.class.should.eq RC::Dry
|
22
22
|
end
|
23
23
|
|
24
|
-
should 'switch
|
24
|
+
should 'switch default_engine to RestCore::RestClient' do
|
25
25
|
wrapper = Class.new
|
26
|
-
wrapper.send(:include,
|
27
|
-
wrapper.
|
28
|
-
wrapper.new.wrapped.class.should.eq
|
26
|
+
wrapper.send(:include, RC::Wrapper)
|
27
|
+
wrapper.default_engine = RC::RestClient
|
28
|
+
wrapper.new.wrapped.class.should.eq RC::RestClient
|
29
|
+
end
|
30
|
+
|
31
|
+
should 'accept middlewares without a member' do
|
32
|
+
Class.new.send(:include, RC::Wrapper).new{
|
33
|
+
use Class.new.send(:include, RC::Middleware)
|
34
|
+
}.members.should.eq []
|
29
35
|
end
|
30
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-10-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rest-client
|
@@ -35,7 +35,7 @@ description: ! 'Modular Ruby clients interface for REST APIs
|
|
35
35
|
|
36
36
|
To address the need for a way to access these APIs easily and elegantly,
|
37
37
|
|
38
|
-
we have developed
|
38
|
+
we have developed rest-core, which consists of composable middleware
|
39
39
|
|
40
40
|
that allows you to build a REST client for any REST API. Or in the case of
|
41
41
|
|
@@ -44,8 +44,6 @@ description: ! 'Modular Ruby clients interface for REST APIs
|
|
44
44
|
dedicated clients provided by [rest-more][].
|
45
45
|
|
46
46
|
|
47
|
-
[rest-core]: https://github.com/cardinalblue/rest-core
|
48
|
-
|
49
47
|
[rest-more]: https://github.com/cardinalblue/rest-more'
|
50
48
|
email:
|
51
49
|
- dev (XD) cardinalblue.com
|
@@ -63,30 +61,22 @@ files:
|
|
63
61
|
- README.md
|
64
62
|
- Rakefile
|
65
63
|
- TODO.md
|
66
|
-
- doc/ToC.md
|
67
|
-
- doc/dependency.md
|
68
|
-
- doc/design.md
|
69
|
-
- example/auto.rb
|
70
|
-
- example/coolio.rb
|
71
|
-
- example/eventmachine.rb
|
72
64
|
- example/multi.rb
|
73
|
-
- example/
|
65
|
+
- example/simple.rb
|
66
|
+
- example/use-cases.rb
|
74
67
|
- lib/rest-core.rb
|
75
|
-
- lib/rest-core/app/abstract/async_fiber.rb
|
76
|
-
- lib/rest-core/app/auto.rb
|
77
|
-
- lib/rest-core/app/coolio-async.rb
|
78
|
-
- lib/rest-core/app/coolio-fiber.rb
|
79
|
-
- lib/rest-core/app/coolio.rb
|
80
|
-
- lib/rest-core/app/dry.rb
|
81
|
-
- lib/rest-core/app/em-http-request-async.rb
|
82
|
-
- lib/rest-core/app/em-http-request-fiber.rb
|
83
|
-
- lib/rest-core/app/em-http-request.rb
|
84
|
-
- lib/rest-core/app/rest-client.rb
|
85
68
|
- lib/rest-core/builder.rb
|
86
69
|
- lib/rest-core/client.rb
|
87
70
|
- lib/rest-core/client/simple.rb
|
88
71
|
- lib/rest-core/client/universal.rb
|
89
72
|
- lib/rest-core/client_oauth1.rb
|
73
|
+
- lib/rest-core/engine/auto.rb
|
74
|
+
- lib/rest-core/engine/dry.rb
|
75
|
+
- lib/rest-core/engine/em-http-request.rb
|
76
|
+
- lib/rest-core/engine/future/future.rb
|
77
|
+
- lib/rest-core/engine/future/future_fiber.rb
|
78
|
+
- lib/rest-core/engine/future/future_thread.rb
|
79
|
+
- lib/rest-core/engine/rest-client.rb
|
90
80
|
- lib/rest-core/error.rb
|
91
81
|
- lib/rest-core/event.rb
|
92
82
|
- lib/rest-core/middleware.rb
|
@@ -103,21 +93,22 @@ files:
|
|
103
93
|
- lib/rest-core/middleware/error_detector_http.rb
|
104
94
|
- lib/rest-core/middleware/error_handler.rb
|
105
95
|
- lib/rest-core/middleware/follow_redirect.rb
|
106
|
-
- lib/rest-core/middleware/
|
96
|
+
- lib/rest-core/middleware/json_request.rb
|
97
|
+
- lib/rest-core/middleware/json_response.rb
|
107
98
|
- lib/rest-core/middleware/oauth1_header.rb
|
108
99
|
- lib/rest-core/middleware/oauth2_header.rb
|
109
100
|
- lib/rest-core/middleware/oauth2_query.rb
|
110
101
|
- lib/rest-core/middleware/timeout.rb
|
111
|
-
- lib/rest-core/middleware/timeout/
|
112
|
-
- lib/rest-core/middleware/timeout/
|
102
|
+
- lib/rest-core/middleware/timeout/timer_em.rb
|
103
|
+
- lib/rest-core/middleware/timeout/timer_thread.rb
|
104
|
+
- lib/rest-core/patch/multi_json.rb
|
113
105
|
- lib/rest-core/patch/rest-client.rb
|
114
106
|
- lib/rest-core/test.rb
|
115
107
|
- lib/rest-core/util/hmac.rb
|
108
|
+
- lib/rest-core/util/json.rb
|
116
109
|
- lib/rest-core/util/parse_query.rb
|
117
110
|
- lib/rest-core/version.rb
|
118
111
|
- lib/rest-core/wrapper.rb
|
119
|
-
- pending/test_multi.rb
|
120
|
-
- pending/test_test_util.rb
|
121
112
|
- rest-core.gemspec
|
122
113
|
- test/test_auth_basic.rb
|
123
114
|
- test/test_builder.rb
|
@@ -125,12 +116,16 @@ files:
|
|
125
116
|
- test/test_client.rb
|
126
117
|
- test/test_client_oauth1.rb
|
127
118
|
- test/test_default_query.rb
|
119
|
+
- test/test_em_http_request.rb
|
128
120
|
- test/test_error_detector.rb
|
129
121
|
- test/test_error_detector_http.rb
|
122
|
+
- test/test_error_handler.rb
|
130
123
|
- test/test_follow_redirect.rb
|
131
|
-
- test/
|
124
|
+
- test/test_json_request.rb
|
125
|
+
- test/test_json_response.rb
|
132
126
|
- test/test_oauth1_header.rb
|
133
127
|
- test/test_payload.rb
|
128
|
+
- test/test_simple.rb
|
134
129
|
- test/test_timeout.rb
|
135
130
|
- test/test_universal.rb
|
136
131
|
- test/test_wrapper.rb
|
@@ -165,12 +160,16 @@ test_files:
|
|
165
160
|
- test/test_client.rb
|
166
161
|
- test/test_client_oauth1.rb
|
167
162
|
- test/test_default_query.rb
|
163
|
+
- test/test_em_http_request.rb
|
168
164
|
- test/test_error_detector.rb
|
169
165
|
- test/test_error_detector_http.rb
|
166
|
+
- test/test_error_handler.rb
|
170
167
|
- test/test_follow_redirect.rb
|
171
|
-
- test/
|
168
|
+
- test/test_json_request.rb
|
169
|
+
- test/test_json_response.rb
|
172
170
|
- test/test_oauth1_header.rb
|
173
171
|
- test/test_payload.rb
|
172
|
+
- test/test_simple.rb
|
174
173
|
- test/test_timeout.rb
|
175
174
|
- test/test_universal.rb
|
176
175
|
- test/test_wrapper.rb
|