restfully 0.6.2 → 0.6.3

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.6.3
@@ -0,0 +1,37 @@
1
+ m = MediaType.new('application/vnd.grid5000+json')
2
+ m.parser = JSON
3
+
4
+ class Grid5000MediaType < Restfully::MediaType
5
+
6
+ class << self
7
+ def supports?(given_type)
8
+ if given_type.kind_of?(Restfully::MediaType)
9
+ given_type = given_type.type
10
+ end
11
+ case given_type
12
+ when Regexp
13
+ given_type =~ type
14
+ else
15
+ given_type == type.to_s || given_type =~ Regexp.new(type.to_s)
16
+ end
17
+ end
18
+ end
19
+
20
+
21
+ end
22
+
23
+
24
+ get 'https://api.grid5000.fr/sid/grid5000'
25
+ type = 'application/vnd.grid5000+json'
26
+ m = MediaType.find(type)
27
+ if m.nil?
28
+ "does not know how to interpret #{type}"
29
+ else
30
+ grid5000 = Resource.new(uri, links, properties)
31
+ grid5000.sites[:rennes]
32
+
33
+ m.links
34
+ m.properties
35
+ end
36
+
37
+
data/lib/restfully.rb CHANGED
@@ -14,7 +14,7 @@ require 'restfully/collection'
14
14
 
15
15
  module Restfully
16
16
  # To be changed on version bump
17
- VERSION = "0.6.1"
17
+ VERSION = "0.6.3"
18
18
 
19
19
  class << self
20
20
  attr_accessor :adapter
data/restfully.gemspec CHANGED
@@ -1,95 +1,93 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{restfully}
8
- s.version = "0.6.2"
8
+ s.version = "0.6.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Cyril Rohr"]
12
- s.date = %q{2011-02-03}
12
+ s.date = %q{2011-04-14}
13
13
  s.default_executable = %q{restfully}
14
14
  s.description = %q{Experimental code for auto-generation of wrappers on top of RESTful APIs that follow HATEOAS principles and provide OPTIONS methods and/or Allow headers.}
15
15
  s.email = %q{cyril.rohr@gmail.com}
16
16
  s.executables = ["restfully"]
17
17
  s.extra_rdoc_files = [
18
18
  "LICENSE",
19
- "README.rdoc"
19
+ "README.rdoc"
20
20
  ]
21
21
  s.files = [
22
22
  ".document",
23
- ".gitignore",
24
- "CHANGELOG",
25
- "LICENSE",
26
- "README.rdoc",
27
- "Rakefile",
28
- "TODO.rdoc",
29
- "VERSION",
30
- "bin/restfully",
31
- "examples/grid5000.rb",
32
- "lib/restfully.rb",
33
- "lib/restfully/collection.rb",
34
- "lib/restfully/error.rb",
35
- "lib/restfully/extensions.rb",
36
- "lib/restfully/http.rb",
37
- "lib/restfully/http/adapters/abstract_adapter.rb",
38
- "lib/restfully/http/adapters/patron_adapter.rb",
39
- "lib/restfully/http/adapters/rest_client_adapter.rb",
40
- "lib/restfully/http/error.rb",
41
- "lib/restfully/http/headers.rb",
42
- "lib/restfully/http/request.rb",
43
- "lib/restfully/http/response.rb",
44
- "lib/restfully/link.rb",
45
- "lib/restfully/parsing.rb",
46
- "lib/restfully/resource.rb",
47
- "lib/restfully/session.rb",
48
- "lib/restfully/special_array.rb",
49
- "lib/restfully/special_hash.rb",
50
- "restfully.gemspec",
51
- "spec/collection_spec.rb",
52
- "spec/fixtures/configuration_file.yml",
53
- "spec/fixtures/grid5000-rennes-jobs.json",
54
- "spec/fixtures/grid5000-sites.json",
55
- "spec/http/error_spec.rb",
56
- "spec/http/headers_spec.rb",
57
- "spec/http/request_spec.rb",
58
- "spec/http/response_spec.rb",
59
- "spec/http/rest_client_adapter_spec.rb",
60
- "spec/link_spec.rb",
61
- "spec/parsing_spec.rb",
62
- "spec/resource_spec.rb",
63
- "spec/restfully_spec.rb",
64
- "spec/session_spec.rb",
65
- "spec/spec_helper.rb"
23
+ "CHANGELOG",
24
+ "LICENSE",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "TODO.rdoc",
28
+ "VERSION",
29
+ "bin/restfully",
30
+ "examples/grid5000.rb",
31
+ "lib/restfully.rb",
32
+ "lib/restfully/collection.rb",
33
+ "lib/restfully/error.rb",
34
+ "lib/restfully/extensions.rb",
35
+ "lib/restfully/http.rb",
36
+ "lib/restfully/http/adapters/abstract_adapter.rb",
37
+ "lib/restfully/http/adapters/patron_adapter.rb",
38
+ "lib/restfully/http/adapters/rest_client_adapter.rb",
39
+ "lib/restfully/http/error.rb",
40
+ "lib/restfully/http/headers.rb",
41
+ "lib/restfully/http/request.rb",
42
+ "lib/restfully/http/response.rb",
43
+ "lib/restfully/link.rb",
44
+ "lib/restfully/parsing.rb",
45
+ "lib/restfully/resource.rb",
46
+ "lib/restfully/session.rb",
47
+ "lib/restfully/special_array.rb",
48
+ "lib/restfully/special_hash.rb",
49
+ "restfully.gemspec",
50
+ "spec/collection_spec.rb",
51
+ "spec/fixtures/configuration_file.yml",
52
+ "spec/fixtures/grid5000-rennes-jobs.json",
53
+ "spec/fixtures/grid5000-sites.json",
54
+ "spec/http/error_spec.rb",
55
+ "spec/http/headers_spec.rb",
56
+ "spec/http/request_spec.rb",
57
+ "spec/http/response_spec.rb",
58
+ "spec/http/rest_client_adapter_spec.rb",
59
+ "spec/link_spec.rb",
60
+ "spec/parsing_spec.rb",
61
+ "spec/resource_spec.rb",
62
+ "spec/restfully_spec.rb",
63
+ "spec/session_spec.rb",
64
+ "spec/spec_helper.rb"
66
65
  ]
67
66
  s.homepage = %q{http://github.com/crohr/restfully}
68
- s.rdoc_options = ["--charset=UTF-8"]
69
67
  s.require_paths = ["lib"]
70
- s.rubygems_version = %q{1.3.6}
68
+ s.rubygems_version = %q{1.5.2}
71
69
  s.summary = %q{Experimental code for auto-generation of wrappers on top of RESTful APIs that follow some specific conventions.}
72
70
  s.test_files = [
71
+ "examples/grid5000.rb",
72
+ "examples/scratch.rb",
73
73
  "spec/collection_spec.rb",
74
- "spec/http/error_spec.rb",
75
- "spec/http/headers_spec.rb",
76
- "spec/http/request_spec.rb",
77
- "spec/http/response_spec.rb",
78
- "spec/http/rest_client_adapter_spec.rb",
79
- "spec/link_spec.rb",
80
- "spec/parsing_spec.rb",
81
- "spec/resource_spec.rb",
82
- "spec/restfully_spec.rb",
83
- "spec/session_spec.rb",
84
- "spec/spec_helper.rb",
85
- "examples/grid5000.rb"
74
+ "spec/http/error_spec.rb",
75
+ "spec/http/headers_spec.rb",
76
+ "spec/http/request_spec.rb",
77
+ "spec/http/response_spec.rb",
78
+ "spec/http/rest_client_adapter_spec.rb",
79
+ "spec/link_spec.rb",
80
+ "spec/parsing_spec.rb",
81
+ "spec/resource_spec.rb",
82
+ "spec/restfully_spec.rb",
83
+ "spec/session_spec.rb",
84
+ "spec/spec_helper.rb"
86
85
  ]
87
86
 
88
87
  if s.respond_to? :specification_version then
89
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
90
88
  s.specification_version = 3
91
89
 
92
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
90
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
93
91
  s.add_runtime_dependency(%q<rest-client>, [">= 1.4"])
94
92
  s.add_runtime_dependency(%q<json>, [">= 1.2.0"])
95
93
  s.add_runtime_dependency(%q<backports>, [">= 0"])
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restfully
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 1
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 6
8
- - 2
9
- version: 0.6.2
9
+ - 3
10
+ version: 0.6.3
10
11
  platform: ruby
11
12
  authors:
12
13
  - Cyril Rohr
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-02-03 00:00:00 +01:00
18
+ date: 2011-04-14 00:00:00 +02:00
18
19
  default_executable: restfully
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: rest-client
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 7
27
30
  segments:
28
31
  - 1
29
32
  - 4
@@ -34,9 +37,11 @@ dependencies:
34
37
  name: json
35
38
  prerelease: false
36
39
  requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
37
41
  requirements:
38
42
  - - ">="
39
43
  - !ruby/object:Gem::Version
44
+ hash: 31
40
45
  segments:
41
46
  - 1
42
47
  - 2
@@ -48,9 +53,11 @@ dependencies:
48
53
  name: backports
49
54
  prerelease: false
50
55
  requirement: &id003 !ruby/object:Gem::Requirement
56
+ none: false
51
57
  requirements:
52
58
  - - ">="
53
59
  - !ruby/object:Gem::Version
60
+ hash: 3
54
61
  segments:
55
62
  - 0
56
63
  version: "0"
@@ -60,9 +67,11 @@ dependencies:
60
67
  name: webmock
61
68
  prerelease: false
62
69
  requirement: &id004 !ruby/object:Gem::Requirement
70
+ none: false
63
71
  requirements:
64
72
  - - ">="
65
73
  - !ruby/object:Gem::Version
74
+ hash: 3
66
75
  segments:
67
76
  - 0
68
77
  version: "0"
@@ -72,9 +81,11 @@ dependencies:
72
81
  name: rspec
73
82
  prerelease: false
74
83
  requirement: &id005 !ruby/object:Gem::Requirement
84
+ none: false
75
85
  requirements:
76
86
  - - ">="
77
87
  - !ruby/object:Gem::Version
88
+ hash: 3
78
89
  segments:
79
90
  - 0
80
91
  version: "0"
@@ -84,9 +95,11 @@ dependencies:
84
95
  name: json
85
96
  prerelease: false
86
97
  requirement: &id006 !ruby/object:Gem::Requirement
98
+ none: false
87
99
  requirements:
88
100
  - - ">="
89
101
  - !ruby/object:Gem::Version
102
+ hash: 3
90
103
  segments:
91
104
  - 0
92
105
  version: "0"
@@ -103,7 +116,6 @@ extra_rdoc_files:
103
116
  - README.rdoc
104
117
  files:
105
118
  - .document
106
- - .gitignore
107
119
  - CHANGELOG
108
120
  - LICENSE
109
121
  - README.rdoc
@@ -146,37 +158,44 @@ files:
146
158
  - spec/restfully_spec.rb
147
159
  - spec/session_spec.rb
148
160
  - spec/spec_helper.rb
161
+ - examples/scratch.rb
149
162
  has_rdoc: true
150
163
  homepage: http://github.com/crohr/restfully
151
164
  licenses: []
152
165
 
153
166
  post_install_message:
154
- rdoc_options:
155
- - --charset=UTF-8
167
+ rdoc_options: []
168
+
156
169
  require_paths:
157
170
  - lib
158
171
  required_ruby_version: !ruby/object:Gem::Requirement
172
+ none: false
159
173
  requirements:
160
174
  - - ">="
161
175
  - !ruby/object:Gem::Version
176
+ hash: 3
162
177
  segments:
163
178
  - 0
164
179
  version: "0"
165
180
  required_rubygems_version: !ruby/object:Gem::Requirement
181
+ none: false
166
182
  requirements:
167
183
  - - ">="
168
184
  - !ruby/object:Gem::Version
185
+ hash: 3
169
186
  segments:
170
187
  - 0
171
188
  version: "0"
172
189
  requirements: []
173
190
 
174
191
  rubyforge_project:
175
- rubygems_version: 1.3.6
192
+ rubygems_version: 1.5.2
176
193
  signing_key:
177
194
  specification_version: 3
178
195
  summary: Experimental code for auto-generation of wrappers on top of RESTful APIs that follow some specific conventions.
179
196
  test_files:
197
+ - examples/grid5000.rb
198
+ - examples/scratch.rb
180
199
  - spec/collection_spec.rb
181
200
  - spec/http/error_spec.rb
182
201
  - spec/http/headers_spec.rb
@@ -189,4 +208,3 @@ test_files:
189
208
  - spec/restfully_spec.rb
190
209
  - spec/session_spec.rb
191
210
  - spec/spec_helper.rb
192
- - examples/grid5000.rb
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- *.sw?
2
- .DS_Store
3
- coverage
4
- rdoc
5
- pkg