wordnik 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +10 -0
- data/config/pretty_print.xsl +1 -1
- data/lib/wordnik/response.rb +2 -2
- data/lib/wordnik/version.rb +1 -1
- metadata +3 -3
data/Rakefile
CHANGED
@@ -140,6 +140,16 @@ task :write_resource_methods do
|
|
140
140
|
lines << " request = Wordnik::Request.new(http_method, path, :params => params, :body => body)"
|
141
141
|
lines << " request_only ? request : request.response.body"
|
142
142
|
lines << " end\n"
|
143
|
+
|
144
|
+
# case response.valueType
|
145
|
+
# when 'wordObject'
|
146
|
+
# Wordnik::Word.new(response.body)
|
147
|
+
# when 'List[definition]'
|
148
|
+
# response.body.map do |definition_data|
|
149
|
+
# Wordnik::Definition.new(definition_data)
|
150
|
+
# end
|
151
|
+
# end
|
152
|
+
|
143
153
|
end
|
144
154
|
end
|
145
155
|
|
data/config/pretty_print.xsl
CHANGED
data/lib/wordnik/response.rb
CHANGED
@@ -25,9 +25,9 @@ module Wordnik
|
|
25
25
|
# TODO: If body is XML, parse it
|
26
26
|
# Otherwise return raw string
|
27
27
|
def body
|
28
|
-
JSON.parse raw.body
|
28
|
+
JSON.parse raw.body#.encode(::Encoding::UTF_8, undef: :replace)
|
29
29
|
rescue
|
30
|
-
raw.body
|
30
|
+
raw.body#.encode(::Encoding::UTF_8, undef: :replace)
|
31
31
|
end
|
32
32
|
|
33
33
|
def headers
|
data/lib/wordnik/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: wordnik
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.4.
|
5
|
+
version: 0.4.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Zeke Sikelianos
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-05-
|
14
|
+
date: 2011-05-16 00:00:00 -07:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
196
|
requirements: []
|
197
197
|
|
198
198
|
rubyforge_project: wordnik
|
199
|
-
rubygems_version: 1.
|
199
|
+
rubygems_version: 1.5.1
|
200
200
|
signing_key:
|
201
201
|
specification_version: 3
|
202
202
|
summary: A ruby wrapper for the Wordnik API
|