restfully 0.7.1.rc6 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/restfully.rb +2 -3
- data/lib/restfully/media_type/grid5000.rb +1 -1
- data/lib/restfully/resource.rb +10 -5
- data/lib/restfully/session.rb +1 -1
- data/lib/restfully/version.rb +1 -1
- metadata +6 -8
data/lib/restfully.rb
CHANGED
@@ -12,7 +12,6 @@ require 'restfully/session'
|
|
12
12
|
require 'restfully/media_type'
|
13
13
|
|
14
14
|
module Restfully
|
15
|
-
|
16
|
-
MediaType.
|
17
|
-
MediaType.register MediaType::Wildcard
|
15
|
+
# Include the default media-types
|
16
|
+
MediaType.reset
|
18
17
|
end
|
data/lib/restfully/resource.rb
CHANGED
@@ -86,12 +86,17 @@ module Restfully
|
|
86
86
|
response.links.map(&:id).sort
|
87
87
|
end
|
88
88
|
|
89
|
-
# Returns the
|
89
|
+
# Returns the properties for this resource.
|
90
90
|
def properties
|
91
|
-
media_type.property
|
92
|
-
|
93
|
-
k
|
94
|
-
|
91
|
+
case props = media_type.property
|
92
|
+
when Hash
|
93
|
+
props.reject{|k,v|
|
94
|
+
# do not return keys used for internal use
|
95
|
+
k.to_s =~ HIDDEN_PROPERTIES_REGEXP
|
96
|
+
}
|
97
|
+
else
|
98
|
+
props
|
99
|
+
end
|
95
100
|
end
|
96
101
|
|
97
102
|
# Force reloading of the resource.
|
data/lib/restfully/session.rb
CHANGED
@@ -192,7 +192,7 @@ module Restfully
|
|
192
192
|
|
193
193
|
def error_message(request, response)
|
194
194
|
msg = "Encountered error #{response.code} on #{request.method.upcase} #{request.uri}"
|
195
|
-
msg += " --- #{response.body[0..
|
195
|
+
msg += " --- #{response.body[0..400]}" unless response.body.empty?
|
196
196
|
end
|
197
197
|
|
198
198
|
end
|
data/lib/restfully/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restfully
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 63
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
|
11
|
-
- 6
|
12
|
-
version: 0.7.1.rc6
|
8
|
+
- 8
|
9
|
+
- 0
|
10
|
+
version: 0.8.0
|
13
11
|
platform: ruby
|
14
12
|
authors:
|
15
13
|
- Cyril Rohr
|
@@ -17,7 +15,7 @@ autorequire:
|
|
17
15
|
bindir: bin
|
18
16
|
cert_chain: []
|
19
17
|
|
20
|
-
date: 2011-05-
|
18
|
+
date: 2011-05-18 00:00:00 +02:00
|
21
19
|
default_executable:
|
22
20
|
dependencies:
|
23
21
|
- !ruby/object:Gem::Dependency
|