restfully 1.0.8 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +28 -25
- data/lib/restfully/collection.rb +6 -2
- data/lib/restfully/http/request.rb +1 -1
- data/lib/restfully/media_type/abstract_media_type.rb +7 -0
- data/lib/restfully/media_type/application_vnd_bonfire_xml.rb +1 -1
- data/lib/restfully/media_type/grid5000.rb +6 -0
- data/lib/restfully/session.rb +7 -1
- data/lib/restfully/version.rb +1 -1
- data/spec/restfully/collection_spec.rb +2 -2
- data/spec/restfully/http/request_spec.rb +3 -2
- data/spec/restfully/session_spec.rb +14 -3
- metadata +61 -97
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 76c01493eaf0c7ad7925079ec8f066edf49c9304
|
4
|
+
data.tar.gz: 9f3a14d5933d3930427763b2d192da89718b7899
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e47004cc066f383e4461453ebc093b27b75cbf52e8376eabe6745c8d70ea204eb1898ecf920d3f012fc2c03e039a20a49b4ae474997924a4d397a52639ce9b2b
|
7
|
+
data.tar.gz: 5711c64d0bd71bbef233f067dbc602f0ab83faf917fe59ce0f4f40b16e921005c122aff71b60f6cc6910f1f0a244900892e3cbd1a1915445f872e703dd1f8d64
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
# Restfully
|
1
|
+
# Restfully [![Build Status](https://travis-ci.org/crohr/restfully.svg?branch=master)](https://travis-ci.org/crohr/restfully)
|
2
|
+
|
2
3
|
Restfully is a general-purpose client library for RESTful APIs. It is written in Ruby. Its goal is to abstract the nitty-gritty details of exchanging HTTP requests between the user-agent and the server. It also discovers resources at runtime, which means should the API change and add a new functionality, the client will automatically discover it.
|
3
4
|
|
4
5
|
It works on simple concepts:
|
@@ -34,40 +35,43 @@ If you require media-types that need an XML parser, you must also install the `l
|
|
34
35
|
|
35
36
|
$ export RUBYOPT="-rubygems"
|
36
37
|
$ restfully --uri URI [-u username] [-p password]
|
37
|
-
|
38
|
+
|
38
39
|
e.g., for the [Grid'5000 API](https://www.grid5000.fr/mediawiki/index.php/API):
|
39
40
|
|
40
|
-
$ restfully --uri https://api.grid5000.fr/sid
|
41
|
+
$ restfully --uri https://api.grid5000.fr/sid -u username -p password
|
41
42
|
|
42
43
|
If the connection was successful, you should get a prompt. You may enter:
|
43
44
|
|
44
45
|
ruby-1.8.7-p249 > pp root
|
45
|
-
#<Resource:
|
46
|
+
#<Resource:0x3fe42a129ba4 uri="/sid"
|
46
47
|
RELATIONSHIPS
|
47
|
-
environments, self, sites, version, versions
|
48
|
+
environments, network_equipments, notifications, parent, self, sites, users, version, versions
|
48
49
|
PROPERTIES
|
49
|
-
"uid"=>"grid5000"
|
50
50
|
"type"=>"grid"
|
51
|
-
"
|
52
|
-
|
51
|
+
"uid"=>"grid5000"
|
52
|
+
"version"=>"b754a5a0d09480dac1662eea3bf096238d9f3530"
|
53
|
+
"release"=>"3.1.9"
|
54
|
+
"timestamp"=>1423434089>
|
55
|
+
=> nil
|
53
56
|
|
54
57
|
And then follow the links advertised under the `RELATIONSHIPS` header to discover the other API resources. For instance, the `sites` resource can be accessed as follows:
|
55
58
|
|
56
59
|
ruby-1.8.7-p249 > pp root.sites
|
57
|
-
#<Collection:
|
60
|
+
#<Collection:0x3fe42a195890 uri="/sid/sites"
|
58
61
|
RELATIONSHIPS
|
59
|
-
self
|
60
|
-
ITEMS (0..
|
61
|
-
#<Resource:
|
62
|
-
#<Resource:
|
63
|
-
#<Resource:
|
64
|
-
#<Resource:
|
65
|
-
#<Resource:
|
66
|
-
#<Resource:
|
67
|
-
#<Resource:
|
68
|
-
#<Resource:
|
69
|
-
#<Resource:
|
70
|
-
|
62
|
+
self
|
63
|
+
ITEMS (0..10)/10
|
64
|
+
#<Resource:0x3fe42a1c4fc8 uri="/sid/sites/grenoble">
|
65
|
+
#<Resource:0x3fe42a1d4b80 uri="/sid/sites/lille">
|
66
|
+
#<Resource:0x3fe42a1e6bb4 uri="/sid/sites/luxembourg">
|
67
|
+
#<Resource:0x3fe42a1f487c uri="/sid/sites/lyon">
|
68
|
+
#<Resource:0x3fe428c6b8d4 uri="/sid/sites/nancy">
|
69
|
+
#<Resource:0x3fe42906bd94 uri="/sid/sites/nantes">
|
70
|
+
#<Resource:0x3fe4290900a4 uri="/sid/sites/reims">
|
71
|
+
#<Resource:0x3fe4291eea40 uri="/sid/sites/rennes">
|
72
|
+
#<Resource:0x3fe429226954 uri="/sid/sites/sophia">
|
73
|
+
#<Resource:0x3fe42925e714 uri="/sid/sites/toulouse">>
|
74
|
+
=> nil
|
71
75
|
|
72
76
|
Note that we're using `pp` to pretty-print the output, but it's not required.
|
73
77
|
|
@@ -76,7 +80,7 @@ A Collection is a specific kind of Resource, and it has access to all the method
|
|
76
80
|
For ease of use and better security, you may prefer to use a configuration file to avoid re-entering the Restfully options every time:
|
77
81
|
|
78
82
|
$ echo '
|
79
|
-
uri: https://api.grid5000.fr/sid
|
83
|
+
uri: https://api.grid5000.fr/sid
|
80
84
|
username: MYLOGIN
|
81
85
|
password: MYPASSWORD
|
82
86
|
' > ~/.restfully/api.grid5000.fr.yml && chmod 600 ~/.restfully/api.grid5000.fr.yml
|
@@ -128,7 +132,6 @@ See the `examples` directory for examples.
|
|
128
132
|
|
129
133
|
* `rake spec`; or
|
130
134
|
* run `autotest` in the project directory.
|
131
|
-
* we use [Travis CI](http://travis-ci.org/) on every push: [![Build Status](https://secure.travis-ci.org/crohr/restfully.png)](http://travis-ci.org/crohr/restfully)
|
132
135
|
|
133
136
|
### Note on Patches/Pull Requests
|
134
137
|
|
@@ -141,8 +144,8 @@ See the `examples` directory for examples.
|
|
141
144
|
|
142
145
|
## Copyright
|
143
146
|
|
144
|
-
Copyright (c) 2009-
|
147
|
+
Copyright (c) 2009-2015 [Cyril Rohr](http://crohr.me), INRIA Rennes - Bretagne Atlantique.
|
145
148
|
|
146
149
|
See LICENSE for details ([CeCILL-B] [cecillb], a BSD style license).
|
147
150
|
|
148
|
-
[cecillb]: http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
|
151
|
+
[cecillb]: http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
|
data/lib/restfully/collection.rb
CHANGED
@@ -16,7 +16,11 @@ module Restfully
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def find_by_uid(symbol)
|
19
|
-
|
19
|
+
direct_uri = media_type.direct_fetch_uri(symbol)
|
20
|
+
# Attempt to make a direct fetch if possible (in case of large collections)
|
21
|
+
found = session.get(direct_uri) if direct_uri
|
22
|
+
# Fall back to collection traversal if direct fetch was not possible, or was not found
|
23
|
+
found = find{ |i| i.media_type.represents?(symbol) } if found.nil?
|
20
24
|
found.expand unless found.nil?
|
21
25
|
found
|
22
26
|
end
|
@@ -82,4 +86,4 @@ module Restfully
|
|
82
86
|
end
|
83
87
|
end
|
84
88
|
|
85
|
-
end
|
89
|
+
end
|
@@ -86,6 +86,13 @@ module Restfully
|
|
86
86
|
@session = session
|
87
87
|
end
|
88
88
|
|
89
|
+
# Returns a direct URI to a specific resource identified by <tt>symbol</tt>.
|
90
|
+
# Only called from collections, when doing collection[:'some-resource-id'].
|
91
|
+
# Either return a path if the media type supports direct fetching, or nil (default).
|
92
|
+
def direct_fetch_uri(symbol)
|
93
|
+
nil
|
94
|
+
end
|
95
|
+
|
89
96
|
# Returns an array of Link objects.
|
90
97
|
# Do not overwrite directly. Overwrite #extract_links instead.
|
91
98
|
def links
|
@@ -121,7 +121,7 @@ module Restfully
|
|
121
121
|
else
|
122
122
|
h[key] = [h[key], value]
|
123
123
|
end
|
124
|
-
elsif ["disk", "nic", "link", "computes", "networks", "storages", "endpoint", "site_link", "interface", "network_link"].include?(key)
|
124
|
+
elsif ["disk", "nic", "link", "computes", "networks", "storages", "endpoint", "site_link", "interface", "network_link", "reservations"].include?(key)
|
125
125
|
h[key] = [value]
|
126
126
|
else
|
127
127
|
h[key] = value
|
@@ -46,6 +46,12 @@ module Restfully
|
|
46
46
|
!!(property("items") && property("total") && property("offset"))
|
47
47
|
end
|
48
48
|
|
49
|
+
def direct_fetch_uri(symbol)
|
50
|
+
self_link = links.find{|l| l.self?}
|
51
|
+
return nil if self_link.nil?
|
52
|
+
URI.parse([self_link.href, symbol.to_s].join("/"))
|
53
|
+
end
|
54
|
+
|
49
55
|
def meta
|
50
56
|
if collection?
|
51
57
|
property("items")
|
data/lib/restfully/session.rb
CHANGED
@@ -15,6 +15,7 @@ module Restfully
|
|
15
15
|
attr_accessor :uri
|
16
16
|
attr_reader :config
|
17
17
|
attr_writer :default_headers
|
18
|
+
attr_reader :ssl_options
|
18
19
|
|
19
20
|
def logger
|
20
21
|
@config.logger
|
@@ -49,7 +50,12 @@ module Restfully
|
|
49
50
|
end
|
50
51
|
|
51
52
|
setup
|
52
|
-
|
53
|
+
|
54
|
+
#similar to
|
55
|
+
# @ssl_options=config.to_hash.select{|k,v| k =~ /^ssl/ || k =~ /verify_ssl/}
|
56
|
+
#but supporting the retarded ruby 1.8.7 of select (output an Array)
|
57
|
+
@ssl_options=Hash[*config.to_hash.select{|k,v| k =~ /^ssl/ || k =~ /verify_ssl/}.flatten]
|
58
|
+
|
53
59
|
yield root, self if block_given?
|
54
60
|
end
|
55
61
|
|
data/lib/restfully/version.rb
CHANGED
@@ -5,7 +5,7 @@ describe Restfully::Collection do
|
|
5
5
|
Restfully::MediaType.register Restfully::MediaType::ApplicationVndBonfireXml
|
6
6
|
|
7
7
|
@session = Restfully::Session.new(
|
8
|
-
:uri => "https://api.
|
8
|
+
:uri => "https://api.project.net"
|
9
9
|
)
|
10
10
|
@request = Restfully::HTTP::Request.new(
|
11
11
|
@session, :get, "/grid5000/sites/rennes/jobs",
|
@@ -51,7 +51,7 @@ describe Restfully::Collection do
|
|
51
51
|
)
|
52
52
|
@resource = Restfully::Resource.new(@session, @response, @request).load
|
53
53
|
@resource.all?{|i| i.complete?}.should be_false
|
54
|
-
stub_request(:get, "https://api.
|
54
|
+
stub_request(:get, "https://api.project.net/locations/de-hlrs/networks/29").
|
55
55
|
with(:headers => {'Accept'=>'application/vnd.bonfire+xml', 'Accept-Encoding'=>'gzip, deflate', 'Cache-Control'=>'no-cache'}).
|
56
56
|
to_return(:status => 200, :body => fixture("bonfire-network-existing.xml"), :headers => {'Content-Type' => 'application/vnd.bonfire+xml'})
|
57
57
|
@resource.expand
|
@@ -12,7 +12,8 @@ describe Restfully::HTTP::Request do
|
|
12
12
|
:config => {
|
13
13
|
:retry_on_error => 5,
|
14
14
|
:wait_before_retry => 5
|
15
|
-
}
|
15
|
+
},
|
16
|
+
:ssl_options => {}
|
16
17
|
)
|
17
18
|
|
18
19
|
@options = {
|
@@ -135,4 +136,4 @@ describe Restfully::HTTP::Request do
|
|
135
136
|
end
|
136
137
|
end
|
137
138
|
|
138
|
-
end
|
139
|
+
end
|
@@ -4,7 +4,7 @@ describe Restfully::Session do
|
|
4
4
|
before do
|
5
5
|
RestClient.components.clear
|
6
6
|
@logger = Logger.new(STDERR)
|
7
|
-
@uri = "https://api.
|
7
|
+
@uri = "https://api.project.net"
|
8
8
|
@config = {
|
9
9
|
:uri => @uri,
|
10
10
|
:logger => @logger
|
@@ -24,6 +24,17 @@ describe Restfully::Session do
|
|
24
24
|
session.uri.to_s.should == Restfully::DEFAULT_URI
|
25
25
|
end
|
26
26
|
|
27
|
+
it "should set en empty hash for ssl_options if none given" do
|
28
|
+
session = Restfully::Session.new(@config.merge("key" => "value"))
|
29
|
+
session.ssl_options.should == {}
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should keep ssl_options if some given" do
|
33
|
+
ssl_options={:verify_ssl => true, :ssl_option => 3}
|
34
|
+
session = Restfully::Session.new(@config.merge(ssl_options))
|
35
|
+
session.ssl_options.should == ssl_options
|
36
|
+
end
|
37
|
+
|
27
38
|
it "should add or replace additional headers to the default set" do
|
28
39
|
session = Restfully::Session.new(
|
29
40
|
@config.merge(:default_headers => {
|
@@ -78,7 +89,7 @@ describe Restfully::Session do
|
|
78
89
|
|
79
90
|
it "should fetch the root path [URI path present]" do
|
80
91
|
session = Restfully::Session.new(
|
81
|
-
@config.merge(:uri => "https://api.
|
92
|
+
@config.merge(:uri => "https://api.project.net/resource/path")
|
82
93
|
)
|
83
94
|
session.should_receive(:get).with("/resource/path").
|
84
95
|
and_return(res = mock(Restfully::Resource))
|
@@ -144,7 +155,7 @@ describe Restfully::Session do
|
|
144
155
|
end
|
145
156
|
|
146
157
|
it "should make an authenticated get request" do
|
147
|
-
stub_request(:get, "https://crohr:p4ssw0rd@api.
|
158
|
+
stub_request(:get, "https://crohr:p4ssw0rd@api.project.net"+@path+"?k1=v1&k2=v2").with(
|
148
159
|
:headers => @default_headers.merge({
|
149
160
|
'Accept' => '*/*',
|
150
161
|
'X-Header' => 'value'
|
metadata
CHANGED
@@ -1,116 +1,102 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restfully
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Cyril Rohr
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-02-13 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: json
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '1.5'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '1.5'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rest-client
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '1.6'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '1.6'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rest-client-components
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rack-cache
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: backports
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :runtime
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ">="
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: addressable
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - ">="
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :runtime
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - ">="
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '0'
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: ripl
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
101
|
- - '='
|
116
102
|
- !ruby/object:Gem::Version
|
@@ -118,7 +104,6 @@ dependencies:
|
|
118
104
|
type: :runtime
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
108
|
- - '='
|
124
109
|
- !ruby/object:Gem::Version
|
@@ -126,161 +111,141 @@ dependencies:
|
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: ripl-multi_line
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
|
-
- -
|
115
|
+
- - ">="
|
132
116
|
- !ruby/object:Gem::Version
|
133
117
|
version: '0'
|
134
118
|
type: :runtime
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
|
-
- -
|
122
|
+
- - ">="
|
140
123
|
- !ruby/object:Gem::Version
|
141
124
|
version: '0'
|
142
125
|
- !ruby/object:Gem::Dependency
|
143
126
|
name: ripl-color_streams
|
144
127
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
128
|
requirements:
|
147
|
-
- -
|
129
|
+
- - ">="
|
148
130
|
- !ruby/object:Gem::Version
|
149
131
|
version: '0'
|
150
132
|
type: :runtime
|
151
133
|
prerelease: false
|
152
134
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
135
|
requirements:
|
155
|
-
- -
|
136
|
+
- - ">="
|
156
137
|
- !ruby/object:Gem::Version
|
157
138
|
version: '0'
|
158
139
|
- !ruby/object:Gem::Dependency
|
159
140
|
name: ripl-short_errors
|
160
141
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
142
|
requirements:
|
163
|
-
- -
|
143
|
+
- - ">="
|
164
144
|
- !ruby/object:Gem::Version
|
165
145
|
version: '0'
|
166
146
|
type: :runtime
|
167
147
|
prerelease: false
|
168
148
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
149
|
requirements:
|
171
|
-
- -
|
150
|
+
- - ">="
|
172
151
|
- !ruby/object:Gem::Version
|
173
152
|
version: '0'
|
174
153
|
- !ruby/object:Gem::Dependency
|
175
154
|
name: ripl-play
|
176
155
|
requirement: !ruby/object:Gem::Requirement
|
177
|
-
none: false
|
178
156
|
requirements:
|
179
|
-
- - ~>
|
157
|
+
- - "~>"
|
180
158
|
- !ruby/object:Gem::Version
|
181
159
|
version: 0.2.1
|
182
160
|
type: :runtime
|
183
161
|
prerelease: false
|
184
162
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
-
none: false
|
186
163
|
requirements:
|
187
|
-
- - ~>
|
164
|
+
- - "~>"
|
188
165
|
- !ruby/object:Gem::Version
|
189
166
|
version: 0.2.1
|
190
167
|
- !ruby/object:Gem::Dependency
|
191
168
|
name: rb-readline
|
192
169
|
requirement: !ruby/object:Gem::Requirement
|
193
|
-
none: false
|
194
170
|
requirements:
|
195
|
-
- -
|
171
|
+
- - ">="
|
196
172
|
- !ruby/object:Gem::Version
|
197
173
|
version: '0'
|
198
174
|
type: :runtime
|
199
175
|
prerelease: false
|
200
176
|
version_requirements: !ruby/object:Gem::Requirement
|
201
|
-
none: false
|
202
177
|
requirements:
|
203
|
-
- -
|
178
|
+
- - ">="
|
204
179
|
- !ruby/object:Gem::Version
|
205
180
|
version: '0'
|
206
181
|
- !ruby/object:Gem::Dependency
|
207
182
|
name: rake
|
208
183
|
requirement: !ruby/object:Gem::Requirement
|
209
|
-
none: false
|
210
184
|
requirements:
|
211
|
-
- - ~>
|
185
|
+
- - "~>"
|
212
186
|
- !ruby/object:Gem::Version
|
213
187
|
version: '0.8'
|
214
188
|
type: :development
|
215
189
|
prerelease: false
|
216
190
|
version_requirements: !ruby/object:Gem::Requirement
|
217
|
-
none: false
|
218
191
|
requirements:
|
219
|
-
- - ~>
|
192
|
+
- - "~>"
|
220
193
|
- !ruby/object:Gem::Version
|
221
194
|
version: '0.8'
|
222
195
|
- !ruby/object:Gem::Dependency
|
223
196
|
name: rspec
|
224
197
|
requirement: !ruby/object:Gem::Requirement
|
225
|
-
none: false
|
226
198
|
requirements:
|
227
|
-
- - ~>
|
199
|
+
- - "~>"
|
228
200
|
- !ruby/object:Gem::Version
|
229
201
|
version: '2'
|
230
202
|
type: :development
|
231
203
|
prerelease: false
|
232
204
|
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
none: false
|
234
205
|
requirements:
|
235
|
-
- - ~>
|
206
|
+
- - "~>"
|
236
207
|
- !ruby/object:Gem::Version
|
237
208
|
version: '2'
|
238
209
|
- !ruby/object:Gem::Dependency
|
239
210
|
name: webmock
|
240
211
|
requirement: !ruby/object:Gem::Requirement
|
241
|
-
none: false
|
242
212
|
requirements:
|
243
|
-
- -
|
213
|
+
- - ">="
|
244
214
|
- !ruby/object:Gem::Version
|
245
215
|
version: '0'
|
246
216
|
type: :development
|
247
217
|
prerelease: false
|
248
218
|
version_requirements: !ruby/object:Gem::Requirement
|
249
|
-
none: false
|
250
219
|
requirements:
|
251
|
-
- -
|
220
|
+
- - ">="
|
252
221
|
- !ruby/object:Gem::Version
|
253
222
|
version: '0'
|
254
223
|
- !ruby/object:Gem::Dependency
|
255
224
|
name: autotest
|
256
225
|
requirement: !ruby/object:Gem::Requirement
|
257
|
-
none: false
|
258
226
|
requirements:
|
259
|
-
- -
|
227
|
+
- - ">="
|
260
228
|
- !ruby/object:Gem::Version
|
261
229
|
version: '0'
|
262
230
|
type: :development
|
263
231
|
prerelease: false
|
264
232
|
version_requirements: !ruby/object:Gem::Requirement
|
265
|
-
none: false
|
266
233
|
requirements:
|
267
|
-
- -
|
234
|
+
- - ">="
|
268
235
|
- !ruby/object:Gem::Version
|
269
236
|
version: '0'
|
270
237
|
- !ruby/object:Gem::Dependency
|
271
238
|
name: autotest-growl
|
272
239
|
requirement: !ruby/object:Gem::Requirement
|
273
|
-
none: false
|
274
240
|
requirements:
|
275
|
-
- -
|
241
|
+
- - ">="
|
276
242
|
- !ruby/object:Gem::Version
|
277
243
|
version: '0'
|
278
244
|
type: :development
|
279
245
|
prerelease: false
|
280
246
|
version_requirements: !ruby/object:Gem::Requirement
|
281
|
-
none: false
|
282
247
|
requirements:
|
283
|
-
- -
|
248
|
+
- - ">="
|
284
249
|
- !ruby/object:Gem::Version
|
285
250
|
version: '0'
|
286
251
|
description: Consume RESTful APIs effortlessly
|
@@ -293,30 +258,33 @@ extra_rdoc_files:
|
|
293
258
|
- LICENSE
|
294
259
|
- README.md
|
295
260
|
files:
|
261
|
+
- LICENSE
|
262
|
+
- README.md
|
263
|
+
- Rakefile
|
296
264
|
- bin/restfully
|
265
|
+
- lib/restfully.rb
|
297
266
|
- lib/restfully/collection.rb
|
298
267
|
- lib/restfully/configuration.rb
|
299
268
|
- lib/restfully/error.rb
|
269
|
+
- lib/restfully/http.rb
|
300
270
|
- lib/restfully/http/error.rb
|
301
271
|
- lib/restfully/http/helper.rb
|
302
272
|
- lib/restfully/http/request.rb
|
303
273
|
- lib/restfully/http/response.rb
|
304
|
-
- lib/restfully/http.rb
|
305
274
|
- lib/restfully/link.rb
|
275
|
+
- lib/restfully/media_type.rb
|
306
276
|
- lib/restfully/media_type/abstract_media_type.rb
|
307
277
|
- lib/restfully/media_type/application_json.rb
|
308
278
|
- lib/restfully/media_type/application_vnd_bonfire_xml.rb
|
309
279
|
- lib/restfully/media_type/application_x_www_form_urlencoded.rb
|
310
280
|
- lib/restfully/media_type/grid5000.rb
|
311
281
|
- lib/restfully/media_type/wildcard.rb
|
312
|
-
- lib/restfully/media_type.rb
|
313
|
-
- lib/restfully/rack/basic_auth.rb
|
314
282
|
- lib/restfully/rack.rb
|
283
|
+
- lib/restfully/rack/basic_auth.rb
|
315
284
|
- lib/restfully/resource.rb
|
316
285
|
- lib/restfully/sandbox.rb
|
317
286
|
- lib/restfully/session.rb
|
318
287
|
- lib/restfully/version.rb
|
319
|
-
- lib/restfully.rb
|
320
288
|
- spec/fixtures/bonfire-collection-with-fragments.xml
|
321
289
|
- spec/fixtures/bonfire-compute-existing.xml
|
322
290
|
- spec/fixtures/bonfire-empty-collection.xml
|
@@ -341,57 +309,53 @@ files:
|
|
341
309
|
- spec/restfully/resource_spec.rb
|
342
310
|
- spec/restfully/session_spec.rb
|
343
311
|
- spec/spec_helper.rb
|
344
|
-
- Rakefile
|
345
|
-
- LICENSE
|
346
|
-
- README.md
|
347
312
|
homepage: http://github.com/crohr/restfully
|
348
313
|
licenses: []
|
314
|
+
metadata: {}
|
349
315
|
post_install_message:
|
350
316
|
rdoc_options:
|
351
|
-
- --charset=UTF-8
|
317
|
+
- "--charset=UTF-8"
|
352
318
|
require_paths:
|
353
319
|
- lib
|
354
320
|
required_ruby_version: !ruby/object:Gem::Requirement
|
355
|
-
none: false
|
356
321
|
requirements:
|
357
|
-
- -
|
322
|
+
- - ">="
|
358
323
|
- !ruby/object:Gem::Version
|
359
324
|
version: '1.8'
|
360
325
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
361
|
-
none: false
|
362
326
|
requirements:
|
363
|
-
- -
|
327
|
+
- - ">="
|
364
328
|
- !ruby/object:Gem::Version
|
365
329
|
version: '1.3'
|
366
330
|
requirements: []
|
367
331
|
rubyforge_project:
|
368
|
-
rubygems_version:
|
332
|
+
rubygems_version: 2.2.2
|
369
333
|
signing_key:
|
370
|
-
specification_version:
|
334
|
+
specification_version: 4
|
371
335
|
summary: Consume RESTful APIs effortlessly
|
372
336
|
test_files:
|
373
|
-
- spec/fixtures/bonfire-collection-with-fragments.xml
|
374
|
-
- spec/fixtures/bonfire-compute-existing.xml
|
375
|
-
- spec/fixtures/bonfire-empty-collection.xml
|
376
|
-
- spec/fixtures/bonfire-experiment-collection.xml
|
377
337
|
- spec/fixtures/bonfire-experiment.xml
|
378
|
-
- spec/fixtures/bonfire-
|
338
|
+
- spec/fixtures/bonfire-collection-with-fragments.xml
|
379
339
|
- spec/fixtures/bonfire-network-collection.xml
|
380
|
-
- spec/fixtures/bonfire-
|
340
|
+
- spec/fixtures/bonfire-compute-existing.xml
|
341
|
+
- spec/fixtures/grid5000-rennes.json
|
381
342
|
- spec/fixtures/bonfire-root.xml
|
343
|
+
- spec/fixtures/bonfire-network-existing.xml
|
344
|
+
- spec/fixtures/grid5000-rennes-jobs.json
|
382
345
|
- spec/fixtures/config.yml
|
346
|
+
- spec/fixtures/bonfire-empty-collection.xml
|
347
|
+
- spec/fixtures/bonfire-location-collection.xml
|
383
348
|
- spec/fixtures/grid5000-rennes-job.json
|
384
|
-
- spec/fixtures/
|
385
|
-
- spec/
|
386
|
-
- spec/restfully/collection_spec.rb
|
349
|
+
- spec/fixtures/bonfire-experiment-collection.xml
|
350
|
+
- spec/spec_helper.rb
|
387
351
|
- spec/restfully/configuration_spec.rb
|
388
|
-
- spec/restfully/
|
352
|
+
- spec/restfully/resource_spec.rb
|
389
353
|
- spec/restfully/http/request_spec.rb
|
354
|
+
- spec/restfully/http/helper_spec.rb
|
390
355
|
- spec/restfully/http/response_spec.rb
|
391
|
-
- spec/restfully/
|
392
|
-
- spec/restfully/media_type/application_vnd_bonfire_xml_spec.rb
|
356
|
+
- spec/restfully/collection_spec.rb
|
393
357
|
- spec/restfully/media_type_spec.rb
|
394
|
-
- spec/restfully/
|
358
|
+
- spec/restfully/media_type/application_vnd_bonfire_xml_spec.rb
|
359
|
+
- spec/restfully/link_spec.rb
|
395
360
|
- spec/restfully/session_spec.rb
|
396
|
-
- spec/spec_helper.rb
|
397
361
|
has_rdoc:
|