amiando 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/amiando.gemspec +1 -1
- data/lib/amiando/request.rb +12 -5
- data/lib/amiando/resource.rb +2 -0
- data/lib/amiando/version.rb +1 -1
- metadata +12 -8
data/amiando.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_dependency 'typhoeus'
|
22
22
|
s.add_dependency 'multi_json'
|
23
23
|
|
24
|
-
s.add_development_dependency 'minitest'
|
24
|
+
s.add_development_dependency 'minitest', '2.9.0'
|
25
25
|
s.add_development_dependency 'webmock'
|
26
26
|
s.add_development_dependency 'rake'
|
27
27
|
end
|
data/lib/amiando/request.rb
CHANGED
@@ -15,18 +15,25 @@ module Amiando
|
|
15
15
|
super(path, :method => verb, :params => params, :verbose => Amiando.verbose)
|
16
16
|
end
|
17
17
|
|
18
|
+
def log_request
|
19
|
+
if Amiando.logger && Amiando.logger.debug?
|
20
|
+
Amiando.logger.debug "#{self.method.to_s.upcase} request #{filter_log(url)} with body #{filter_log(self.params.inspect)}"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
18
24
|
def log_response
|
19
25
|
if Amiando.logger
|
20
|
-
|
21
|
-
Amiando.logger.info "REST request #{filtered_url} returned #{response.code} and took #{response.time} seconds"
|
22
|
-
|
26
|
+
Amiando.logger.info "#{self.method.to_s.upcase} request #{filter_log(url)} returned #{response.code} and took #{response.time} seconds"
|
23
27
|
if Amiando.logger.debug? && response.body
|
24
|
-
|
25
|
-
Amiando.logger.debug "REST request body: #{filtered_body}"
|
28
|
+
Amiando.logger.debug "#{self.method.to_s.upcase} response body: #{filter_log(response.body.inspect)}"
|
26
29
|
end
|
27
30
|
end
|
28
31
|
end
|
29
32
|
|
33
|
+
def filter_log(text)
|
34
|
+
text.gsub(/password=([^&]+)/, "password=[FILTERED]").gsub(/password: .*/,'password: [FILTERED]')
|
35
|
+
end
|
36
|
+
|
30
37
|
private
|
31
38
|
|
32
39
|
def default_params
|
data/lib/amiando/resource.rb
CHANGED
data/lib/amiando/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amiando
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 5
|
10
|
+
version: 0.3.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jorge Dias
|
@@ -16,7 +16,8 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-12-15 00:00:00 +01:00
|
20
|
+
default_executable:
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|
22
23
|
name: typhoeus
|
@@ -52,12 +53,14 @@ dependencies:
|
|
52
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
53
54
|
none: false
|
54
55
|
requirements:
|
55
|
-
- - "
|
56
|
+
- - "="
|
56
57
|
- !ruby/object:Gem::Version
|
57
|
-
hash:
|
58
|
+
hash: 43
|
58
59
|
segments:
|
60
|
+
- 2
|
61
|
+
- 9
|
59
62
|
- 0
|
60
|
-
version:
|
63
|
+
version: 2.9.0
|
61
64
|
type: :development
|
62
65
|
version_requirements: *id003
|
63
66
|
- !ruby/object:Gem::Dependency
|
@@ -220,6 +223,7 @@ files:
|
|
220
223
|
- test/support/factory.rb
|
221
224
|
- test/support/hydra_cache.rb
|
222
225
|
- test/test_helper.rb
|
226
|
+
has_rdoc: true
|
223
227
|
homepage: ""
|
224
228
|
licenses: []
|
225
229
|
|
@@ -249,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
253
|
requirements: []
|
250
254
|
|
251
255
|
rubyforge_project: amiando
|
252
|
-
rubygems_version: 1.
|
256
|
+
rubygems_version: 1.6.2
|
253
257
|
signing_key:
|
254
258
|
specification_version: 3
|
255
259
|
summary: A ruby client for the amiando REST API
|