toadhopper 1.2 → 1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Rakefile +2 -1
- data/lib/toadhopper.rb +5 -9
- data/test/test_filtering.rb +6 -1
- metadata +5 -8
- data/Gemfile.lock +0 -20
data/.gitignore
CHANGED
data/Rakefile
CHANGED
data/lib/toadhopper.rb
CHANGED
@@ -4,7 +4,7 @@ require 'ostruct'
|
|
4
4
|
|
5
5
|
# Posts errors to the Hoptoad API
|
6
6
|
class Toadhopper
|
7
|
-
VERSION = "1.
|
7
|
+
VERSION = "1.3"
|
8
8
|
FILTER_REPLACEMENT = "[FILTERED]"
|
9
9
|
|
10
10
|
# Hoptoad API response
|
@@ -56,7 +56,7 @@ class Toadhopper
|
|
56
56
|
end
|
57
57
|
|
58
58
|
# Posts a deployment notification
|
59
|
-
#
|
59
|
+
#
|
60
60
|
# @param [Hash] options
|
61
61
|
# @option options [String] framework_env The framework environment your app is running under, defaults to development
|
62
62
|
# @option options [String] scm_repository The repository URL
|
@@ -121,7 +121,7 @@ class Toadhopper
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
124
|
-
|
124
|
+
|
125
125
|
def parse_response(response)
|
126
126
|
Response.new(response.code.to_i,
|
127
127
|
response.body,
|
@@ -158,7 +158,7 @@ class Toadhopper
|
|
158
158
|
|
159
159
|
def clean(hash)
|
160
160
|
hash.inject({}) do |acc, (k, v)|
|
161
|
-
acc[k] = (v.is_a?(Hash) ? clean(v) : filtered_value(k,v))
|
161
|
+
acc[k] = (v.is_a?(Hash) ? clean(v) : filtered_value(k,v))
|
162
162
|
acc
|
163
163
|
end
|
164
164
|
end
|
@@ -167,13 +167,9 @@ class Toadhopper
|
|
167
167
|
if filters.any? {|f| key.to_s =~ Regexp.new(f)}
|
168
168
|
FILTER_REPLACEMENT
|
169
169
|
else
|
170
|
-
value
|
170
|
+
value.to_s
|
171
171
|
end
|
172
172
|
end
|
173
|
-
|
174
|
-
def serializable?(value)
|
175
|
-
[Fixnum, Array, String, Hash, Bignum].any? {|c| value.is_a?(c)}
|
176
|
-
end
|
177
173
|
end
|
178
174
|
|
179
175
|
# Convenience method for creating Toadhoppers
|
data/test/test_filtering.rb
CHANGED
@@ -9,10 +9,15 @@ class Toadhopper::TestFiltering < Test::Unit::TestCase
|
|
9
9
|
assert_filtered "sensitive", /sit/
|
10
10
|
end
|
11
11
|
|
12
|
+
def test_converting_values_to_string
|
13
|
+
time = Time.mktime(2011, 03, 15).to_s
|
14
|
+
assert_equal({:time => time}, toadhopper.send(:clean, :time => time))
|
15
|
+
end
|
16
|
+
|
12
17
|
def assert_not_filtered(key, filter)
|
13
18
|
assert_false filtered_document(key, "value", filter).include?(Toadhopper::FILTER_REPLACEMENT)
|
14
19
|
end
|
15
|
-
|
20
|
+
|
16
21
|
def assert_filtered(key, filter)
|
17
22
|
assert_false filtered_document(key, "value", filter).include?("value")
|
18
23
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: toadhopper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: "1.
|
5
|
+
version: "1.3"
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Tim Lucas
|
@@ -14,8 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
18
|
-
default_executable:
|
17
|
+
date: 2011-06-08 00:00:00 Z
|
19
18
|
dependencies:
|
20
19
|
- !ruby/object:Gem::Dependency
|
21
20
|
name: rake
|
@@ -64,7 +63,6 @@ files:
|
|
64
63
|
- .gitignore
|
65
64
|
- .yardopts
|
66
65
|
- Gemfile
|
67
|
-
- Gemfile.lock
|
68
66
|
- LICENSE
|
69
67
|
- README.md
|
70
68
|
- Rakefile
|
@@ -77,7 +75,6 @@ files:
|
|
77
75
|
- test/test_filtering.rb
|
78
76
|
- test/test_posting.rb
|
79
77
|
- toadhopper.gemspec
|
80
|
-
has_rdoc: true
|
81
78
|
homepage: http://github.com/toolmantim/toadhopper
|
82
79
|
licenses: []
|
83
80
|
|
@@ -91,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
91
88
|
requirements:
|
92
89
|
- - ">="
|
93
90
|
- !ruby/object:Gem::Version
|
94
|
-
hash:
|
91
|
+
hash: 2357103887843071799
|
95
92
|
segments:
|
96
93
|
- 0
|
97
94
|
version: "0"
|
@@ -100,14 +97,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
97
|
requirements:
|
101
98
|
- - ">="
|
102
99
|
- !ruby/object:Gem::Version
|
103
|
-
hash:
|
100
|
+
hash: 2357103887843071799
|
104
101
|
segments:
|
105
102
|
- 0
|
106
103
|
version: "0"
|
107
104
|
requirements: []
|
108
105
|
|
109
106
|
rubyforge_project: toadhopper
|
110
|
-
rubygems_version: 1.5
|
107
|
+
rubygems_version: 1.8.5
|
111
108
|
signing_key:
|
112
109
|
specification_version: 3
|
113
110
|
summary: Post error notifications to Hoptoad
|
data/Gemfile.lock
DELETED