cfoundry 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -56,7 +56,7 @@ module CFoundry
56
56
  when :json
57
57
  payload = payload.to_json
58
58
  when :form
59
- payload = encode_params(payload, false)
59
+ payload = encode_params(payload)
60
60
  end
61
61
  end
62
62
 
@@ -126,17 +126,9 @@ module CFoundry
126
126
  def encode_params(hash, escape = true)
127
127
  hash.keys.map do |k|
128
128
  v = hash[k]
129
-
130
- value =
131
- if v.is_a?(Hash)
132
- v.to_json
133
- elsif escape
134
- URI.escape(v.to_s, /[^#{URI::PATTERN::UNRESERVED}]/)
135
- else
136
- v
137
- end
138
-
139
- "#{k}=#{value}"
129
+ v = v.to_json if v.is_a?(Hash)
130
+ v = URI.escape(v.to_s, /[^#{URI::PATTERN::UNRESERVED}]/) if escape
131
+ "#{k}=#{v}"
140
132
  end.join("&")
141
133
  end
142
134
 
@@ -117,7 +117,7 @@ module CFoundry::V2
117
117
  info = parse_json(response)
118
118
  raise CFoundry::APIError.new(info[:code], info[:description])
119
119
 
120
- when 401
120
+ when 401, 403
121
121
  info = parse_json(response)
122
122
  raise CFoundry::Denied.new(info[:code], info[:description])
123
123
 
@@ -1,4 +1,4 @@
1
1
  module CFoundry # :nodoc:
2
2
  # CFoundry library version number.
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfoundry
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Suraci