hotdogprincess 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/hotdogprincess.gemspec +1 -1
- data/lib/hotdogprincess/client.rb +12 -41
- data/lib/hotdogprincess/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4d8c7f80c8cfdb73e5147c39ce994cd83063222
|
4
|
+
data.tar.gz: 192bb8a04628f0ad9f54257e7c4208c781959cd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff2789b9305f20eefd458ef23a47b985ba03275994cc5035bddc9802d5e2d8772b02d6408ba4f7411dfe189c3b5d3cf1f775640fbb2fbd3a15d5e698c84cad2c
|
7
|
+
data.tar.gz: 8951ac0d3ff731675399fc2f2a834c0758de8f63685986ab9bd04d268ff9b13b96343192b0af7e4d9779a6e638e45d75145f35d643ec6855b8e4afcc259eaf35
|
data/hotdogprincess.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_runtime_dependency 'gyoku', '~> 1'
|
22
22
|
spec.add_runtime_dependency 'nori', '~> 2'
|
23
|
-
spec.add_runtime_dependency 'rest-client'
|
23
|
+
spec.add_runtime_dependency 'rest-client', '~> 1'
|
24
24
|
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
spec.required_ruby_version = '>= 1.9.2'
|
@@ -175,58 +175,29 @@ module HotDogPrincess
|
|
175
175
|
|
176
176
|
def schema(object)
|
177
177
|
schema = schema_raw(object)
|
178
|
-
schema_hash =
|
178
|
+
schema_hash = schema_parse(schema[object])
|
179
179
|
schema_hash
|
180
180
|
end
|
181
181
|
|
182
182
|
def schema_json(object)
|
183
183
|
schema = schema_raw(object)
|
184
|
-
schema_hash =
|
184
|
+
schema_hash = schema_parse(schema[object])
|
185
185
|
JSON.generate(schema_hash)
|
186
186
|
end
|
187
187
|
|
188
188
|
def schema_parse(input)
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
output
|
198
|
-
end
|
199
|
-
|
200
|
-
def schema_parse_array(input_array)
|
201
|
-
output = []
|
202
|
-
input_array.each do |item|
|
203
|
-
if item.class == Array
|
204
|
-
output.push schema_parse_array(item)
|
205
|
-
elsif item.class == Hash
|
206
|
-
output.push schema_parse_hash(item)
|
207
|
-
elsif value.class == String
|
208
|
-
output.push schema_parse_string(item)
|
209
|
-
else
|
210
|
-
output.push item
|
211
|
-
end
|
212
|
-
end
|
213
|
-
output
|
214
|
-
end
|
215
|
-
|
216
|
-
def schema_parse_hash(input_hash)
|
217
|
-
output = {}
|
218
|
-
input_hash.each do |key, value|
|
219
|
-
if value.class == Array
|
220
|
-
output[key.to_s.name_to_key] = schema_parse_array(value)
|
221
|
-
elsif value.class == Hash
|
222
|
-
output[key.to_s.name_to_key] = schema_parse_hash(value)
|
223
|
-
elsif value.class == String
|
224
|
-
output[key.to_s.name_to_key] = schema_parse_string(value)
|
225
|
-
else
|
226
|
-
output[key.to_s.name_to_key] = value
|
189
|
+
if input.is_a? String
|
190
|
+
schema_parse_string(input)
|
191
|
+
elsif input.is_a? Array
|
192
|
+
input.map { |item| schema_parse(item) }
|
193
|
+
elsif input.is_a? Hash
|
194
|
+
input.inject({}) do |memo, (key, value)|
|
195
|
+
memo[key.to_s.name_to_key] = schema_parse(value)
|
196
|
+
memo
|
227
197
|
end
|
198
|
+
else
|
199
|
+
input
|
228
200
|
end
|
229
|
-
output
|
230
201
|
end
|
231
202
|
|
232
203
|
def schema_parse_string(input_string)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotdogprincess
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Callis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: rest-client
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '1'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '1'
|
69
69
|
description: Integrate with the Parature API.
|
70
70
|
email:
|
71
71
|
- matthew.callis@gmail.com
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: 1.3.5
|
108
108
|
requirements: []
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.
|
110
|
+
rubygems_version: 2.2.2
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Integrate with the Parature API. It's gunna be so flippin' awesome!
|