casual_helper 0.0.5 → 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/lib/casual_helper.rb +5 -5
- data/lib/casual_helper/version.rb +1 -1
- metadata +2 -2
data/lib/casual_helper.rb
CHANGED
|
@@ -108,7 +108,7 @@ module CasualHelper
|
|
|
108
108
|
|
|
109
109
|
def update_user(user_id, body)
|
|
110
110
|
return if are_invalid user_id, body
|
|
111
|
-
put "#{@api_server.to_s}/v0/users/#{user_id}", body
|
|
111
|
+
put "#{@api_server.to_s}/v0/users/#{user_id}", body
|
|
112
112
|
end
|
|
113
113
|
|
|
114
114
|
def add_comment_tap(tap_id, comment_string)
|
|
@@ -127,7 +127,7 @@ module CasualHelper
|
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
def put(url, body)
|
|
130
|
-
response_json = RestClient.put url, body, JSON_CONTENT
|
|
130
|
+
response_json = RestClient.put url, body.to_json, JSON_CONTENT
|
|
131
131
|
response = JSON.parse(response_json)
|
|
132
132
|
response['meta']['code'] >= 200 && response['meta']['code'] <= 300
|
|
133
133
|
rescue => e
|
|
@@ -155,9 +155,9 @@ module CasualHelper
|
|
|
155
155
|
# always returns nil
|
|
156
156
|
def log_error(url, message)
|
|
157
157
|
calling_method = caller[1][/`.*'/][1..-2]
|
|
158
|
-
p "Error in #{self.class.name}.#{calling_method}"
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
p "Error in #{self.class.name}.#{calling_method}\n" <<
|
|
159
|
+
" url: #{url}\n" <<
|
|
160
|
+
" message: #{message}"
|
|
161
161
|
nil
|
|
162
162
|
end
|
|
163
163
|
|