rest-core 3.6.0 → 4.0.0
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/.gitmodules +3 -0
- data/.travis.yml +0 -1
- data/CHANGES.md +28 -0
- data/Gemfile +0 -2
- data/README.md +14 -95
- data/Rakefile +16 -3
- data/example/simple.rb +1 -0
- data/example/use-cases.rb +15 -3
- data/lib/rest-core.rb +38 -75
- data/lib/rest-core/client/universal.rb +3 -1
- data/lib/rest-core/client_oauth1.rb +64 -59
- data/lib/rest-core/event.rb +9 -11
- data/lib/rest-core/middleware/auth_basic.rb +21 -21
- data/lib/rest-core/middleware/bypass.rb +8 -8
- data/lib/rest-core/middleware/cache.rb +94 -90
- data/lib/rest-core/middleware/clash_response.rb +15 -14
- data/lib/rest-core/middleware/common_logger.rb +27 -26
- data/lib/rest-core/middleware/default_headers.rb +8 -8
- data/lib/rest-core/middleware/default_payload.rb +8 -8
- data/lib/rest-core/middleware/default_query.rb +8 -8
- data/lib/rest-core/middleware/default_site.rb +12 -12
- data/lib/rest-core/middleware/defaults.rb +38 -38
- data/lib/rest-core/middleware/error_detector.rb +10 -10
- data/lib/rest-core/middleware/error_detector_http.rb +6 -4
- data/lib/rest-core/middleware/error_handler.rb +14 -14
- data/lib/rest-core/middleware/follow_redirect.rb +28 -27
- data/lib/rest-core/middleware/json_request.rb +13 -11
- data/lib/rest-core/middleware/json_response.rb +29 -28
- data/lib/rest-core/middleware/oauth1_header.rb +84 -83
- data/lib/rest-core/middleware/oauth2_header.rb +27 -25
- data/lib/rest-core/middleware/oauth2_query.rb +15 -15
- data/lib/rest-core/middleware/query_response.rb +14 -14
- data/lib/rest-core/middleware/retry.rb +25 -23
- data/lib/rest-core/middleware/smash_response.rb +15 -14
- data/lib/rest-core/middleware/timeout.rb +18 -19
- data/lib/rest-core/test.rb +1 -18
- data/lib/rest-core/util/clash.rb +38 -37
- data/lib/rest-core/util/config.rb +40 -39
- data/lib/rest-core/util/dalli_extension.rb +11 -10
- data/lib/rest-core/util/hmac.rb +9 -8
- data/lib/rest-core/util/json.rb +55 -54
- data/lib/rest-core/util/parse_link.rb +13 -12
- data/lib/rest-core/util/parse_query.rb +24 -22
- data/lib/rest-core/version.rb +1 -1
- data/rest-core.gemspec +121 -158
- data/test/test_cache.rb +2 -0
- data/test/test_default_payload.rb +1 -1
- data/test/test_error_handler.rb +5 -4
- data/test/test_timeout.rb +9 -8
- data/test/test_universal.rb +8 -0
- metadata +9 -73
- data/lib/rest-core/builder.rb +0 -162
- data/lib/rest-core/client.rb +0 -277
- data/lib/rest-core/client/simple.rb +0 -2
- data/lib/rest-core/engine.rb +0 -36
- data/lib/rest-core/engine/dry.rb +0 -9
- data/lib/rest-core/engine/http-client.rb +0 -41
- data/lib/rest-core/error.rb +0 -5
- data/lib/rest-core/event_source.rb +0 -137
- data/lib/rest-core/middleware.rb +0 -151
- data/lib/rest-core/promise.rb +0 -249
- data/lib/rest-core/thread_pool.rb +0 -131
- data/lib/rest-core/timer.rb +0 -58
- data/lib/rest-core/util/payload.rb +0 -173
- data/test/test_builder.rb +0 -40
- data/test/test_client.rb +0 -177
- data/test/test_event_source.rb +0 -159
- data/test/test_future.rb +0 -16
- data/test/test_httpclient.rb +0 -118
- data/test/test_payload.rb +0 -204
- data/test/test_promise.rb +0 -146
- data/test/test_simple.rb +0 -38
- data/test/test_thread_pool.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 457863f961696936393b0a9cdfece4b4d2316b3c
|
4
|
+
data.tar.gz: 6c4c5f3ae1079f425fd463fb617fab97c3641237
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05f689fdc1a13a629fc2f82190bae7804533fd06cc2c3c5f625f666e695541a826717ead8f97de5a2fdb4834b2f1a55deec798a45ed407e00e13531c348ef1ca
|
7
|
+
data.tar.gz: 3906077d07d6ed8a64782ca78278adbd2a152b71420ad956248def24ed53554751d8e7e84231d8f36549f23cf8672463ba906bde39ba299b41bcc125badebfa8
|
data/.gitmodules
CHANGED
data/.travis.yml
CHANGED
data/CHANGES.md
CHANGED
@@ -1,5 +1,33 @@
|
|
1
1
|
# CHANGES
|
2
2
|
|
3
|
+
## rest-core 4.0.0 -- 2016-02-04
|
4
|
+
|
5
|
+
Now the core functionality was extracted to a new gem, rest-builder.
|
6
|
+
rest-core from now on would just bundle middleware and some utilities.
|
7
|
+
Things like `RC::Builder` should still work for the sake of compatibility,
|
8
|
+
but it's actually `RestBuilder::Builder` underneath. Note that the core
|
9
|
+
concurrency facility was extracted to another new gem, promise_pool.
|
10
|
+
Since some parts were also rewritten, things might change somehow.
|
11
|
+
At least no public APIs were changed. It's completely compatible.
|
12
|
+
|
13
|
+
### Incompatible changes
|
14
|
+
|
15
|
+
* `RC::Simple` was removed. There's no point for that.
|
16
|
+
* `RC.id` was removed, in favour of `:itself.to_proc`.
|
17
|
+
* Include `RC::Middleware` would no longer include `RC` as well.
|
18
|
+
|
19
|
+
### Enhancements
|
20
|
+
|
21
|
+
* We no longer `autoload` a lot of stuffs, rather, we just load it.
|
22
|
+
* Previously, only when you try to _peek_ the future, the callback would be
|
23
|
+
called. From now on, whenever the request is done, it would call the
|
24
|
+
callback regardless. However, if there's an exception, it won't be raised.
|
25
|
+
It would only raise whenever you _peek_ it. An obvious difference for this
|
26
|
+
is the `RC::CommonLogger`. Previously since callback would only be called
|
27
|
+
when you _peek_ it, the time would be the difference from request done to
|
28
|
+
you _peeked_ it. From now on, it would just be how much time the request
|
29
|
+
has been taken, regardless when you _peek_ it.
|
30
|
+
|
3
31
|
## rest-core 3.6.0 -- 2016-01-27
|
4
32
|
|
5
33
|
### Incompatible changes
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -21,22 +21,18 @@ talk is in Mandarin. There's another talk about [The Promise of rest-core][]
|
|
21
21
|
|
22
22
|
## DESCRIPTION:
|
23
23
|
|
24
|
-
|
24
|
+
Various [rest-builder](https://github.com/godfat/rest-builder) middleware
|
25
|
+
for building REST clients.
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
we have developed rest-core, which consists of composable middleware
|
29
|
-
that allows you to build a REST client for any REST API. Or in the case of
|
30
|
-
common APIs such as Facebook, Github, and Twitter, you can simply use the
|
31
|
-
dedicated clients provided by [rest-more][].
|
32
|
-
|
33
|
-
[rest-more]: https://github.com/godfat/rest-more
|
27
|
+
Checkout [rest-more](https://github.com/godfat/rest-more) for pre-built
|
28
|
+
clients.
|
34
29
|
|
35
30
|
## FEATURES:
|
36
31
|
|
37
|
-
* Modular interface for REST clients similar to WSGI/Rack for servers
|
32
|
+
* Modular interface for REST clients similar to WSGI/Rack for servers
|
33
|
+
via [rest-builder][].
|
38
34
|
* Concurrent requests with synchronous or asynchronous interfaces with
|
39
|
-
threads.
|
35
|
+
threads via [promise_pool][].
|
40
36
|
|
41
37
|
## WHY?
|
42
38
|
|
@@ -48,13 +44,17 @@ less memory, less conflicts, and run faster.
|
|
48
44
|
### Mandatory:
|
49
45
|
|
50
46
|
* Tested with MRI (official CRuby), Rubinius and JRuby.
|
47
|
+
* gem [rest-builder][]
|
48
|
+
* gem [promise_pool][]
|
49
|
+
* gem [timers][]
|
51
50
|
* gem [httpclient][]
|
52
51
|
* gem [mime-types][]
|
53
|
-
* gem [timers][]
|
54
52
|
|
53
|
+
[rest-builder]: https://github.com/godfat/rest-builder
|
54
|
+
[promise_pool]: https://github.com/godfat/promise_pool
|
55
|
+
[timers]: https://github.com/celluloid/timers
|
55
56
|
[httpclient]: https://github.com/nahi/httpclient
|
56
57
|
[mime-types]: https://github.com/halostatue/mime-types
|
57
|
-
[timers]: https://github.com/celluloid/timers
|
58
58
|
|
59
59
|
### Optional:
|
60
60
|
|
@@ -553,88 +553,6 @@ simply ignore `:expires_in`.
|
|
553
553
|
[RC::Timeout]: lib/rest-core/middleware/timeout.rb
|
554
554
|
[moneta]: https://github.com/minad/moneta#expiration
|
555
555
|
|
556
|
-
## Build Your Own Middleware:
|
557
|
-
|
558
|
-
### How We Pick the Default Value:
|
559
|
-
|
560
|
-
There are a number of ways to specify a default value, each with different
|
561
|
-
priorities. Suppose we have a middleware which remembers an integer:
|
562
|
-
|
563
|
-
``` ruby
|
564
|
-
class HP
|
565
|
-
def self.members; [:hp]; end
|
566
|
-
include RC::Middleware
|
567
|
-
def call env, &k
|
568
|
-
puts "HP: #{hp(env)}"
|
569
|
-
app.call(env, &k)
|
570
|
-
end
|
571
|
-
end
|
572
|
-
Mage = RC::Builder.client do
|
573
|
-
use HP, 5 # the very last default
|
574
|
-
end
|
575
|
-
mage = Mage.new
|
576
|
-
```
|
577
|
-
|
578
|
-
1. The one passed to the request directly gets the first priority, e.g.
|
579
|
-
|
580
|
-
``` ruby
|
581
|
-
mage.get('http://example.com/', {}, :hp => 1) # prints HP: 1
|
582
|
-
```
|
583
|
-
|
584
|
-
2. The one saved as an instance variable in the client gets the 2nd place.
|
585
|
-
|
586
|
-
``` ruby
|
587
|
-
mage.hp = 2
|
588
|
-
mage.get('http://example.com/') # prints HP: 2
|
589
|
-
mage.get('http://example.com/', {}, :hp => 1) # prints HP: 1
|
590
|
-
mage.hp # still 2
|
591
|
-
mage.hp = false # disable hp
|
592
|
-
mage.hp = nil # reset to default
|
593
|
-
```
|
594
|
-
|
595
|
-
3. The method defined in the client instance named `default_hp` gets the 3rd.
|
596
|
-
|
597
|
-
``` ruby
|
598
|
-
class Mage
|
599
|
-
def default_hp
|
600
|
-
3
|
601
|
-
end
|
602
|
-
end
|
603
|
-
mage.get('http://example.com/') # prints HP: 3
|
604
|
-
mage.hp # 3
|
605
|
-
mage.hp = nil # reset default
|
606
|
-
Mage.send(:remove_method, :default_hp)
|
607
|
-
```
|
608
|
-
|
609
|
-
4. The method defined in the client class named `default_hp` gets the 4rd.
|
610
|
-
P.S. In [rest-more][], with `RestCore::Config` it would generate a
|
611
|
-
`DefaultAttributes` module which defines this kind of default method and
|
612
|
-
then is extended into the client class. You could still define this method
|
613
|
-
to override the default though.
|
614
|
-
|
615
|
-
``` ruby
|
616
|
-
class Mage
|
617
|
-
def self.default_hp
|
618
|
-
4
|
619
|
-
end
|
620
|
-
end
|
621
|
-
mage.get('http://example.com/') # prints HP: 4
|
622
|
-
mage.hp # 4
|
623
|
-
mage.hp = nil # reset to default
|
624
|
-
Mage.singleton_class.send(:remove_method, :default_hp)
|
625
|
-
```
|
626
|
-
|
627
|
-
5. The one defined in the middleware gets the last place.
|
628
|
-
|
629
|
-
``` ruby
|
630
|
-
mage.get('http://example.com/') # prints HP: 5
|
631
|
-
mage.hp # 5
|
632
|
-
mage.hp = nil # reset to default
|
633
|
-
```
|
634
|
-
|
635
|
-
You can find all the details in client.rb and middleware.rb. See the
|
636
|
-
included method hooks.
|
637
|
-
|
638
556
|
## Advanced Concurrent HTTP Requests -- Embrace the Future
|
639
557
|
|
640
558
|
### The Interface
|
@@ -773,6 +691,7 @@ the priority here is:
|
|
773
691
|
|
774
692
|
* [Codementor](https://www.codementor.io/)
|
775
693
|
* [PicCollage](http://pic-collage.com/)
|
694
|
+
* [GW2 Account Viewer](https://www.godfat.org/gw2)
|
776
695
|
|
777
696
|
## CHANGES:
|
778
697
|
|
data/Rakefile
CHANGED
@@ -2,14 +2,27 @@
|
|
2
2
|
begin
|
3
3
|
require "#{dir = File.dirname(__FILE__)}/task/gemgem"
|
4
4
|
rescue LoadError
|
5
|
-
sh 'git submodule update --init'
|
5
|
+
sh 'git submodule update --init --recursive'
|
6
6
|
exec Gem.ruby, '-S', $PROGRAM_NAME, *ARGV
|
7
7
|
end
|
8
8
|
|
9
|
+
$LOAD_PATH.unshift(File.expand_path("#{dir}/rest-builder/lib"))
|
10
|
+
$LOAD_PATH.unshift(File.expand_path("#{dir}/rest-builder/promise_pool/lib"))
|
11
|
+
|
9
12
|
Gemgem.init(dir) do |s|
|
10
13
|
require 'rest-core/version'
|
11
14
|
s.name = 'rest-core'
|
12
15
|
s.version = RestCore::VERSION
|
13
|
-
%w[
|
14
|
-
|
16
|
+
%w[rest-builder].each do |g|
|
17
|
+
s.add_runtime_dependency(g)
|
18
|
+
end
|
19
|
+
|
20
|
+
# exclude rest-builder
|
21
|
+
s.files.reject!{ |f| f.start_with?('rest-builder/') }
|
22
|
+
end
|
23
|
+
|
24
|
+
desc 'Run console'
|
25
|
+
task 'console' do
|
26
|
+
ARGV.shift
|
27
|
+
load `which rib`.chomp
|
15
28
|
end
|
data/example/simple.rb
CHANGED
data/example/use-cases.rb
CHANGED
@@ -4,6 +4,16 @@ RC.eagerload
|
|
4
4
|
|
5
5
|
RC::Universal.pool_size = 0 # default to no thread pool
|
6
6
|
|
7
|
+
RC::Universal.module_eval do
|
8
|
+
def default_query
|
9
|
+
{:access_token => ENV['FACEBOOK_ACCESS_TOKEN']}
|
10
|
+
end
|
11
|
+
|
12
|
+
def default_timeout
|
13
|
+
10
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
7
17
|
def def_use_case name, &block
|
8
18
|
singleton_class.send(:define_method, "#{name}_") do
|
9
19
|
begin
|
@@ -23,8 +33,10 @@ def def_use_case name, &block
|
|
23
33
|
end
|
24
34
|
end
|
25
35
|
|
36
|
+
@mutex = Mutex.new
|
37
|
+
|
26
38
|
def q str
|
27
|
-
|
39
|
+
@mutex.synchronize{ puts "\e[33m=> #{str.inspect}\e[0m" }
|
28
40
|
end
|
29
41
|
|
30
42
|
# ----------------------------------------------------------------------
|
@@ -49,7 +61,7 @@ def_use_case 'pure_ruby_callback_requests' do
|
|
49
61
|
RC::Universal.new(:json_response => true ,
|
50
62
|
:site => 'https://graph.facebook.com/' ,
|
51
63
|
:log_method => lambda{|str|
|
52
|
-
|
64
|
+
@mutex.synchronize{puts(str)}}).
|
53
65
|
get('4'){ |res|
|
54
66
|
if res.kind_of?(Exception)
|
55
67
|
q "Encountering: #{res}"
|
@@ -70,7 +82,7 @@ def_use_case 'pure_ruby_nested_concurrent_requests' do
|
|
70
82
|
c = RC::Universal.new(:json_response => true ,
|
71
83
|
:site => 'https://graph.facebook.com/' ,
|
72
84
|
:log_method => lambda{ |str|
|
73
|
-
|
85
|
+
@mutex.synchronize{puts(str)}})
|
74
86
|
|
75
87
|
%w[4 5].each{ |user|
|
76
88
|
c.get(user, :fields => 'cover'){ |data|
|
data/lib/rest-core.rb
CHANGED
@@ -1,84 +1,52 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
REQUEST_METHOD = 'REQUEST_METHOD'
|
4
|
-
REQUEST_PATH = 'REQUEST_PATH'
|
5
|
-
REQUEST_QUERY = 'REQUEST_QUERY'
|
6
|
-
REQUEST_PAYLOAD = 'REQUEST_PAYLOAD'
|
7
|
-
REQUEST_HEADERS = 'REQUEST_HEADERS'
|
8
|
-
REQUEST_URI = 'REQUEST_URI'
|
9
|
-
|
10
|
-
RESPONSE_BODY = 'RESPONSE_BODY'
|
11
|
-
RESPONSE_STATUS = 'RESPONSE_STATUS'
|
12
|
-
RESPONSE_HEADERS = 'RESPONSE_HEADERS'
|
13
|
-
RESPONSE_SOCKET = 'RESPONSE_SOCKET'
|
14
|
-
RESPONSE_KEY = 'RESPONSE_KEY'
|
15
|
-
|
16
|
-
DRY = 'core.dry'
|
17
|
-
FAIL = 'core.fail'
|
18
|
-
LOG = 'core.log'
|
19
|
-
CLIENT = 'core.client'
|
2
|
+
require 'rest-builder'
|
20
3
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
# core utilities
|
27
|
-
autoload :Builder , 'rest-core/builder'
|
28
|
-
autoload :Client , 'rest-core/client'
|
29
|
-
autoload :Error , 'rest-core/error'
|
30
|
-
autoload :Event , 'rest-core/event'
|
31
|
-
autoload :Middleware , 'rest-core/middleware'
|
32
|
-
autoload :Promise , 'rest-core/promise'
|
33
|
-
autoload :ThreadPool , 'rest-core/thread_pool'
|
34
|
-
autoload :EventSource , 'rest-core/event_source'
|
4
|
+
module RestCore
|
5
|
+
# for backward compatibility
|
6
|
+
RestBuilder.constants.each do |const|
|
7
|
+
const_set(const, RestBuilder.const_get(const))
|
8
|
+
end
|
35
9
|
|
36
10
|
# oauth1 utilities
|
37
|
-
autoload :ClientOauth1
|
11
|
+
autoload :ClientOauth1 , 'rest-core/client_oauth1'
|
38
12
|
|
39
13
|
# misc utilities
|
40
|
-
autoload :Hmac
|
41
|
-
autoload :Json
|
42
|
-
autoload :ParseLink
|
43
|
-
autoload :ParseQuery
|
44
|
-
autoload :
|
45
|
-
autoload :
|
46
|
-
autoload :
|
47
|
-
autoload :
|
48
|
-
autoload :DalliExtension, 'rest-core/util/dalli_extension'
|
14
|
+
autoload :Hmac , 'rest-core/util/hmac'
|
15
|
+
autoload :Json , 'rest-core/util/json'
|
16
|
+
autoload :ParseLink , 'rest-core/util/parse_link'
|
17
|
+
autoload :ParseQuery , 'rest-core/util/parse_query'
|
18
|
+
autoload :Config , 'rest-core/util/config'
|
19
|
+
autoload :Clash , 'rest-core/util/clash'
|
20
|
+
autoload :Smash , 'rest-core/util/smash'
|
21
|
+
autoload :DalliExtension , 'rest-core/util/dalli_extension'
|
49
22
|
|
50
23
|
# middlewares
|
51
|
-
autoload :AuthBasic
|
52
|
-
autoload :Bypass
|
53
|
-
autoload :Cache
|
54
|
-
autoload :ClashResponse
|
55
|
-
autoload :SmashResponse
|
56
|
-
autoload :CommonLogger
|
57
|
-
autoload :DefaultHeaders, 'rest-core/middleware/default_headers'
|
58
|
-
autoload :DefaultQuery
|
59
|
-
autoload :DefaultPayload, 'rest-core/middleware/default_payload'
|
60
|
-
autoload :DefaultSite
|
61
|
-
autoload :Defaults
|
62
|
-
autoload :ErrorDetector
|
24
|
+
autoload :AuthBasic , 'rest-core/middleware/auth_basic'
|
25
|
+
autoload :Bypass , 'rest-core/middleware/bypass'
|
26
|
+
autoload :Cache , 'rest-core/middleware/cache'
|
27
|
+
autoload :ClashResponse , 'rest-core/middleware/clash_response'
|
28
|
+
autoload :SmashResponse , 'rest-core/middleware/smash_response'
|
29
|
+
autoload :CommonLogger , 'rest-core/middleware/common_logger'
|
30
|
+
autoload :DefaultHeaders , 'rest-core/middleware/default_headers'
|
31
|
+
autoload :DefaultQuery , 'rest-core/middleware/default_query'
|
32
|
+
autoload :DefaultPayload , 'rest-core/middleware/default_payload'
|
33
|
+
autoload :DefaultSite , 'rest-core/middleware/default_site'
|
34
|
+
autoload :Defaults , 'rest-core/middleware/defaults'
|
35
|
+
autoload :ErrorDetector , 'rest-core/middleware/error_detector'
|
63
36
|
autoload :ErrorDetectorHttp, 'rest-core/middleware/error_detector_http'
|
64
|
-
autoload :ErrorHandler
|
65
|
-
autoload :FollowRedirect, 'rest-core/middleware/follow_redirect'
|
66
|
-
autoload :JsonRequest
|
67
|
-
autoload :JsonResponse
|
68
|
-
autoload :QueryResponse
|
69
|
-
autoload :Oauth1Header
|
70
|
-
autoload :Oauth2Header
|
71
|
-
autoload :Oauth2Query
|
72
|
-
autoload :Retry
|
73
|
-
autoload :Timeout
|
74
|
-
|
75
|
-
# engines
|
76
|
-
autoload :Dry , 'rest-core/engine/dry'
|
77
|
-
autoload :HttpClient , 'rest-core/engine/http-client'
|
37
|
+
autoload :ErrorHandler , 'rest-core/middleware/error_handler'
|
38
|
+
autoload :FollowRedirect , 'rest-core/middleware/follow_redirect'
|
39
|
+
autoload :JsonRequest , 'rest-core/middleware/json_request'
|
40
|
+
autoload :JsonResponse , 'rest-core/middleware/json_response'
|
41
|
+
autoload :QueryResponse , 'rest-core/middleware/query_response'
|
42
|
+
autoload :Oauth1Header , 'rest-core/middleware/oauth1_header'
|
43
|
+
autoload :Oauth2Header , 'rest-core/middleware/oauth2_header'
|
44
|
+
autoload :Oauth2Query , 'rest-core/middleware/oauth2_query'
|
45
|
+
autoload :Retry , 'rest-core/middleware/retry'
|
46
|
+
autoload :Timeout , 'rest-core/middleware/timeout'
|
78
47
|
|
79
48
|
# clients
|
80
|
-
autoload :
|
81
|
-
autoload :Universal , 'rest-core/client/universal'
|
49
|
+
autoload :Universal , 'rest-core/client/universal'
|
82
50
|
|
83
51
|
# You might want to call this before launching your application in a
|
84
52
|
# threaded environment to avoid thread-safety issue in autoload.
|
@@ -95,11 +63,6 @@ module RestCore
|
|
95
63
|
eagerload(c, loaded) if c.respond_to?(:constants) && !loaded[n]
|
96
64
|
}
|
97
65
|
end
|
98
|
-
|
99
|
-
# identity function
|
100
|
-
def self.id
|
101
|
-
@id ||= lambda{ |a| a }
|
102
|
-
end
|
103
66
|
end
|
104
67
|
|
105
68
|
RC = RestCore unless Object.const_defined?(:RC)
|