aesop 1.1.0.3 → 1.2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.gitignore +2 -0
- data/.travis.yml +4 -5
- data/CHANGES.md +5 -0
- data/lib/aesop.rb +0 -2
- data/lib/aesop/aesop.rb +22 -5
- data/lib/aesop/version.rb +2 -2
- data/spec/aesop/aesop_spec.rb +32 -10
- data/spec/aesop/hooks_spec.rb +2 -2
- data/spec/spec_helper.rb +4 -6
- metadata +23 -22
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
YmMxMGJmOTVkNDg4MWMyNzhmN2U3YmFmMjIwMWRhZTFkODg0ZGUzZA==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: eeded5736b4ac2ebedf42379f2349d1609b20d37
|
4
|
+
data.tar.gz: 5a851a8487f7730271292770bc1f899632558f8e
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ZTg0ZDk1OWE5ZGZhMGVlY2MxMzE2YTIyYzcwYjQwMDgwNzg1OWMxNDk5MmM4
|
11
|
-
MzIyYTQxMmIyNWFhNjJlOTc3ZmQ3NDY5MmRiODU3ZWY0MzVkODU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NTg2ZDA4ZjgwYzcxYmExNmQ4MWI2YzU1MWQ4NDI3MWJmNmQwNWUyMTQ0M2Zi
|
14
|
-
NWEyNDc4OGM2OTQyOWMwMjg1ODkzODY0NjE4OTMyZTQ2MjU3OWFiMzVmYWVl
|
15
|
-
ZTNmNTZlMzEwZTNhNDA3YTM1NDI5MWRjZTg3YmFhYTQ4ZTY3NWE=
|
6
|
+
metadata.gz: 6502c35013fbfa9c0122b390335b29dd347021533c7cd5f3f1dd0a14124f374c18502308c3b7abdd12f3fe59a5714a50a676a3472480a66dec57907c60a7e4ea
|
7
|
+
data.tar.gz: 779c559b447268bf51ea13732c33800e7e5ceb94f2fedd14331dcab9fa02509896d3813f2a697eedf414da8429dbd86c6a04794fa2329f9bf93b906ff28c61ad
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,21 +1,20 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
3
|
services: redis
|
4
|
+
sudo: false
|
4
5
|
|
5
6
|
jdk:
|
6
7
|
- oraclejdk7
|
7
8
|
|
8
9
|
rvm:
|
9
|
-
- 1.8.7
|
10
|
-
- 1.9.3
|
11
10
|
- 2.0.0
|
12
|
-
-
|
13
|
-
-
|
11
|
+
- 2.2.3
|
12
|
+
- rbx-2.6
|
14
13
|
- ruby-head
|
15
14
|
- jruby-head
|
16
15
|
|
16
|
+
|
17
17
|
matrix:
|
18
18
|
allow_failures:
|
19
19
|
- rvm: ruby-head
|
20
20
|
- rvm: jruby-head
|
21
|
-
- rvm: rbx-19mode
|
data/CHANGES.md
ADDED
data/lib/aesop.rb
CHANGED
data/lib/aesop/aesop.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'singleton'
|
2
|
-
|
3
2
|
class Aesop::Aesop
|
4
3
|
include Singleton
|
5
4
|
include ::Aesop
|
@@ -28,12 +27,22 @@ class Aesop::Aesop
|
|
28
27
|
end
|
29
28
|
|
30
29
|
def catch_exception(exception)
|
30
|
+
log_exception(exception)
|
31
31
|
store_exception_occurrence(exception)
|
32
32
|
if should_dispatch?(exception)
|
33
33
|
dispatch_exception(exception)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
def log_exception(exception)
|
38
|
+
Aesop::Logger.debug(exception.message)
|
39
|
+
if trace = exception.backtrace
|
40
|
+
trace.each do |line|
|
41
|
+
Aesop::Logger.debug(line)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
37
46
|
def should_dispatch?(exception)
|
38
47
|
return false if is_excluded?(exception) || exception_already_dispatched?(exception)
|
39
48
|
return true if internal_exception?(exception)
|
@@ -111,16 +120,24 @@ class Aesop::Aesop
|
|
111
120
|
end
|
112
121
|
|
113
122
|
def redis_options
|
114
|
-
options =
|
115
|
-
:host => configuration.redis.host,
|
116
|
-
:port => configuration.redis.port,
|
117
|
-
}
|
123
|
+
options = redis_host_or_socket_options
|
118
124
|
if (password = configuration.redis.password) && !password.empty?
|
119
125
|
options.merge!(:password => password)
|
120
126
|
end
|
121
127
|
options
|
122
128
|
end
|
123
129
|
|
130
|
+
def redis_host_or_socket_options
|
131
|
+
if configuration.redis.path
|
132
|
+
{ path: configuration.redis.path }
|
133
|
+
else
|
134
|
+
{
|
135
|
+
host: configuration.redis.host,
|
136
|
+
port: configuration.redis.port,
|
137
|
+
}
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
124
141
|
def redis
|
125
142
|
if @redis.nil? || (@redis.client && !@redis.client.connected?)
|
126
143
|
begin
|
data/lib/aesop/version.rb
CHANGED
data/spec/aesop/aesop_spec.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
require File.join( File.dirname(__FILE__), '..', 'spec_helper')
|
2
2
|
|
3
3
|
describe Aesop::Aesop do
|
4
|
+
|
5
|
+
before do
|
6
|
+
Aesop::Aesop.instance.init
|
7
|
+
end
|
8
|
+
|
4
9
|
subject{ Aesop::Aesop.instance }
|
5
10
|
|
6
11
|
context 'configuration' do
|
@@ -47,16 +52,33 @@ describe Aesop::Aesop do
|
|
47
52
|
subject.init
|
48
53
|
end
|
49
54
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
55
|
+
describe '#redis_options' do
|
56
|
+
let(:opts){ subject.redis_options }
|
57
|
+
|
58
|
+
it 'configures a redis socket path if its configured' do
|
59
|
+
redis_conf = double
|
60
|
+
allow(redis_conf).to receive(:path).and_return('test')
|
61
|
+
allow(redis_conf).to receive(:password).and_return('')
|
62
|
+
allow(subject.configuration).to receive(:redis).and_return(redis_conf)
|
63
|
+
|
64
|
+
expect(opts).to have_key(:path)
|
65
|
+
expect(opts).to_not have_key(:host)
|
66
|
+
expect(opts).to_not have_key(:port)
|
67
|
+
expect(opts[:path]).to eq 'test'
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'merges the redis password when it is given' do
|
71
|
+
password = "pa55word"
|
72
|
+
redis_conf = double
|
73
|
+
redis_conf.stub(:host)
|
74
|
+
redis_conf.stub(:port)
|
75
|
+
allow(redis_conf).to receive(:path).and_return(nil)
|
76
|
+
redis_conf.should_receive(:password).and_return(password)
|
77
|
+
subject.configuration.stub(:redis).and_return(redis_conf)
|
78
|
+
|
79
|
+
opts.should have_key(:password)
|
80
|
+
opts[:password].should == password
|
81
|
+
end
|
60
82
|
end
|
61
83
|
end
|
62
84
|
|
data/spec/aesop/hooks_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -8,13 +8,11 @@ rescue Bundler::BundlerError => e
|
|
8
8
|
exit e.status_code
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
CodeClimate::TestReporter.start
|
11
|
+
require "codeclimate-test-reporter"
|
12
|
+
CodeClimate::TestReporter.start
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
end
|
14
|
+
require 'simplecov'
|
15
|
+
SimpleCov.start
|
18
16
|
|
19
17
|
require 'rspec/core'
|
20
18
|
|
metadata
CHANGED
@@ -1,111 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aesop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- J.W. Koelewijn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 2.14.1
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.14.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: redis
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: hiredis
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: configatron
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: log4r
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
description: Check deployment time, write it to Redis and when exceptions are thrown,
|
@@ -116,9 +116,10 @@ executables: []
|
|
116
116
|
extensions: []
|
117
117
|
extra_rdoc_files: []
|
118
118
|
files:
|
119
|
-
- .gitignore
|
120
|
-
- .rspec
|
121
|
-
- .travis.yml
|
119
|
+
- ".gitignore"
|
120
|
+
- ".rspec"
|
121
|
+
- ".travis.yml"
|
122
|
+
- CHANGES.md
|
122
123
|
- Gemfile
|
123
124
|
- LICENSE
|
124
125
|
- README.md
|
@@ -160,17 +161,17 @@ require_paths:
|
|
160
161
|
- lib
|
161
162
|
required_ruby_version: !ruby/object:Gem::Requirement
|
162
163
|
requirements:
|
163
|
-
- -
|
164
|
+
- - ">="
|
164
165
|
- !ruby/object:Gem::Version
|
165
166
|
version: '0'
|
166
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
168
|
requirements:
|
168
|
-
- -
|
169
|
+
- - ">="
|
169
170
|
- !ruby/object:Gem::Version
|
170
171
|
version: '0'
|
171
172
|
requirements: []
|
172
173
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.
|
174
|
+
rubygems_version: 2.4.5.1
|
174
175
|
signing_key:
|
175
176
|
specification_version: 4
|
176
177
|
summary: Manage exception notification
|