grid_rest 0.0.4 → 0.0.6
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/CHANGELOG.rdoc +7 -0
- data/config/locales/grid_rest.en.yml +1 -0
- data/grid_rest.gemspec +1 -1
- data/lib/grid_rest.rb +5 -0
- metadata +22 -7
data/CHANGELOG.rdoc
CHANGED
@@ -1,4 +1,11 @@
|
|
1
1
|
= CHANGELOG
|
2
|
+
== 2011-10-11 v0.0.6
|
3
|
+
* Working upport for arrays with :json_data or :xml_data specification
|
4
|
+
* Fix namespacing issue
|
5
|
+
|
6
|
+
== 2011-10-02 v0.0.5
|
7
|
+
* Support for arrays with :json_data or :xml_data specification
|
8
|
+
|
2
9
|
== v0.0.4
|
3
10
|
* Better error message control
|
4
11
|
* Initialize some testing
|
@@ -7,6 +7,7 @@ en:
|
|
7
7
|
ECONNREFUSED: The connection to the server could not be established
|
8
8
|
RequestTimeout: De server timed out
|
9
9
|
ServerBrokeConnection: The server has disconnected
|
10
|
+
ResourceNotFound: Resource could not be found
|
10
11
|
|
11
12
|
Continue: Continue
|
12
13
|
SwitchProtocol: SwitchProtocol
|
data/grid_rest.gemspec
CHANGED
data/lib/grid_rest.rb
CHANGED
@@ -67,6 +67,7 @@ module GridRest
|
|
67
67
|
h[Rails.env].each do |k, v|
|
68
68
|
if v.is_a?(Hash)
|
69
69
|
self.grid_config.namespaces[k.to_sym] = HashWithIndifferentAccess.new(v)
|
70
|
+
self.additional_parameters[k.to_sym] = self.additional_parameters[:default].deep_dup # Copy default structure
|
70
71
|
else
|
71
72
|
self.grid_config[k.to_sym] = v
|
72
73
|
end
|
@@ -177,9 +178,11 @@ module GridRest
|
|
177
178
|
when :post then
|
178
179
|
if rparams[:json_data]
|
179
180
|
rparams[:json_data] = rparams[:json_data].merge(additional_post_parameters).to_json if rparams[:json_data].is_a?(Hash)
|
181
|
+
rparams[:json_data] = rparams[:json_data].to_json if rparams[:json_data].is_a?(Array)
|
180
182
|
RestClient.post rest_url, rparams[:json_data], :content_type => :json, :accept => :json
|
181
183
|
elsif rparams[:xml_data]
|
182
184
|
rparams[:xml_data] = rparams[:xml_data].merge(additional_post_parameters).to_xml if rparams[:xml_data].is_a?(Hash)
|
185
|
+
rparams[:xml_data] = rparams[:xml_data].to_xml if rparams[:xml_data].is_a?(Array)
|
183
186
|
RestClient.post rest_url, rparams[:xml_data], :content_type => :xml, :accept => :xml
|
184
187
|
elsif rparams[:binary]
|
185
188
|
RestClient.post rest_url, rparams[:binary], :content_type => 'binary/octet-stream'
|
@@ -192,9 +195,11 @@ module GridRest
|
|
192
195
|
when :put then
|
193
196
|
if rparams[:json_data]
|
194
197
|
rparams[:json_data] = rparams[:json_data].merge(additional_put_parameters).to_json if rparams[:json_data].is_a?(Hash)
|
198
|
+
rparams[:json_data] = rparams[:json_data].to_json if rparams[:json_data].is_a?(Array)
|
195
199
|
RestClient.put rest_url, rparams[:json_data], :content_type => :json, :accept => :json
|
196
200
|
elsif rparams[:xml_data]
|
197
201
|
rparams[:xml_data] = rparams[:xml_data].merge(additional_put_parameters).to_xml if rparams[:xml_data].is_a?(Hash)
|
202
|
+
rparams[:xml_data] = rparams[:xml_data].to_xml if rparams[:xml_data].is_a?(Array)
|
198
203
|
RestClient.put rest_url, rparams[:xml_data], :content_type => :xml, :accept => :xml
|
199
204
|
elsif rparams[:binary]
|
200
205
|
RestClient.put rest_url, rparams[:binary], :content_type => 'binary/octet-stream'
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grid_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 19
|
5
|
+
prerelease:
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Benjamin ter Kuile
|
@@ -14,16 +15,17 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2011-06-15 00:00:00
|
18
|
-
default_executable:
|
18
|
+
date: 2011-06-15 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: activesupport
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
24
25
|
requirements:
|
25
26
|
- - ">="
|
26
27
|
- !ruby/object:Gem::Version
|
28
|
+
hash: 9
|
27
29
|
segments:
|
28
30
|
- 3
|
29
31
|
- 0
|
@@ -35,9 +37,11 @@ dependencies:
|
|
35
37
|
name: rest-client
|
36
38
|
prerelease: false
|
37
39
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
38
41
|
requirements:
|
39
42
|
- - ">="
|
40
43
|
- !ruby/object:Gem::Version
|
44
|
+
hash: 3
|
41
45
|
segments:
|
42
46
|
- 0
|
43
47
|
version: "0"
|
@@ -47,9 +51,11 @@ dependencies:
|
|
47
51
|
name: shoulda
|
48
52
|
prerelease: false
|
49
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
50
55
|
requirements:
|
51
56
|
- - ">="
|
52
57
|
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
53
59
|
segments:
|
54
60
|
- 0
|
55
61
|
version: "0"
|
@@ -59,9 +65,11 @@ dependencies:
|
|
59
65
|
name: bundler
|
60
66
|
prerelease: false
|
61
67
|
requirement: &id004 !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
62
69
|
requirements:
|
63
70
|
- - ~>
|
64
71
|
- !ruby/object:Gem::Version
|
72
|
+
hash: 23
|
65
73
|
segments:
|
66
74
|
- 1
|
67
75
|
- 0
|
@@ -73,9 +81,11 @@ dependencies:
|
|
73
81
|
name: jeweler
|
74
82
|
prerelease: false
|
75
83
|
requirement: &id005 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
76
85
|
requirements:
|
77
86
|
- - ~>
|
78
87
|
- !ruby/object:Gem::Version
|
88
|
+
hash: 15
|
79
89
|
segments:
|
80
90
|
- 1
|
81
91
|
- 6
|
@@ -87,9 +97,11 @@ dependencies:
|
|
87
97
|
name: rcov
|
88
98
|
prerelease: false
|
89
99
|
requirement: &id006 !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
90
101
|
requirements:
|
91
102
|
- - ">="
|
92
103
|
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
93
105
|
segments:
|
94
106
|
- 0
|
95
107
|
version: "0"
|
@@ -120,7 +132,6 @@ files:
|
|
120
132
|
- test/helper.rb
|
121
133
|
- test/test_grid_rest.rb
|
122
134
|
- config/locales/grid_rest.en.yml
|
123
|
-
has_rdoc: true
|
124
135
|
homepage: http://github.com/bterkuile/grid_rest
|
125
136
|
licenses:
|
126
137
|
- MIT
|
@@ -130,23 +141,27 @@ rdoc_options: []
|
|
130
141
|
require_paths:
|
131
142
|
- lib
|
132
143
|
required_ruby_version: !ruby/object:Gem::Requirement
|
144
|
+
none: false
|
133
145
|
requirements:
|
134
146
|
- - ">="
|
135
147
|
- !ruby/object:Gem::Version
|
148
|
+
hash: 3
|
136
149
|
segments:
|
137
150
|
- 0
|
138
151
|
version: "0"
|
139
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
140
154
|
requirements:
|
141
155
|
- - ">="
|
142
156
|
- !ruby/object:Gem::Version
|
157
|
+
hash: 3
|
143
158
|
segments:
|
144
159
|
- 0
|
145
160
|
version: "0"
|
146
161
|
requirements: []
|
147
162
|
|
148
163
|
rubyforge_project:
|
149
|
-
rubygems_version: 1.
|
164
|
+
rubygems_version: 1.8.10
|
150
165
|
signing_key:
|
151
166
|
specification_version: 3
|
152
167
|
summary: grid_rest is a gem that makes your rails application interact with other backends through a REST interface.
|