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.
@@ -12,7 +12,6 @@ require 'restfully/session'
12
12
  require 'restfully/media_type'
13
13
 
14
14
  module Restfully
15
- MediaType.register MediaType::Grid5000
16
- MediaType.register MediaType::ApplicationJson
17
- MediaType.register MediaType::Wildcard
15
+ # Include the default media-types
16
+ MediaType.reset
18
17
  end
@@ -62,6 +62,6 @@ module Restfully
62
62
  end
63
63
 
64
64
  end
65
-
65
+
66
66
  end
67
67
  end
@@ -86,12 +86,17 @@ module Restfully
86
86
  response.links.map(&:id).sort
87
87
  end
88
88
 
89
- # Returns the Hash of properties for this resource.
89
+ # Returns the properties for this resource.
90
90
  def properties
91
- media_type.property.reject{|k,v|
92
- # do not return keys used for internal use
93
- k.to_s =~ HIDDEN_PROPERTIES_REGEXP
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.
@@ -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..200]}" unless response.body.empty?
195
+ msg += " --- #{response.body[0..400]}" unless response.body.empty?
196
196
  end
197
197
 
198
198
  end
@@ -1,3 +1,3 @@
1
1
  module Restfully
2
- VERSION = "0.7.1.rc6"
2
+ VERSION = "0.8.0"
3
3
  end
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: 15424097
5
- prerelease: 6
4
+ hash: 63
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
- - 7
9
- - 1
10
- - rc
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-17 00:00:00 +02:00
18
+ date: 2011-05-18 00:00:00 +02:00
21
19
  default_executable:
22
20
  dependencies:
23
21
  - !ruby/object:Gem::Dependency