aesop 1.1.0.3 → 1.2.0.0

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.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MWQyZDJlZWY2MmU5NDhjYjllYThmYmNkMTczMDhlOTMyMzk4M2ZmYw==
5
- data.tar.gz: !binary |-
6
- YmMxMGJmOTVkNDg4MWMyNzhmN2U3YmFmMjIwMWRhZTFkODg0ZGUzZA==
2
+ SHA1:
3
+ metadata.gz: eeded5736b4ac2ebedf42379f2349d1609b20d37
4
+ data.tar.gz: 5a851a8487f7730271292770bc1f899632558f8e
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YmFkZmRhNzMyY2VmMDhhMWMyZjcxMWUxNDE2NmY1YmVlYmNhODk3MzQ4NGE5
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
@@ -17,3 +17,5 @@ test/version_tmp
17
17
  tmp
18
18
  DEPLOY_TIME
19
19
  .DS_STORE
20
+ .ruby-*
21
+ .rvmrc
@@ -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
- - rbx-19mode
13
- - jruby-19mode
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
@@ -0,0 +1,5 @@
1
+ 1.2.0.0
2
+ -----------
3
+ - DEPRECATES support for Ruby 1.9.3.
4
+ - Removes auto-initialisation when used without Rails or Merb.
5
+ - Adds Redis socket support.
@@ -22,6 +22,4 @@ elsif defined? Rails
22
22
  # We need it to add dev mode routes after initialization finished.
23
23
  Aesop::Aesop.instance.init
24
24
  end
25
- else
26
- Aesop::Aesop.instance.init
27
25
  end
@@ -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
@@ -1,9 +1,9 @@
1
1
  module Aesop
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 1
4
+ MINOR = 2
5
5
  PATCH = 0
6
- BUILD = 3
6
+ BUILD = 0
7
7
  end
8
8
 
9
9
  VERSION = [Version::MAJOR, Version::MINOR, Version::PATCH, Version::BUILD].compact.join('.')
@@ -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
- it 'merges the redis password when it is given' do
51
- password = "pa55word"
52
- redis_conf = double
53
- redis_conf.stub(:host)
54
- redis_conf.stub(:port)
55
- redis_conf.should_receive(:password).and_return(password)
56
- subject.configuration.stub(:redis).and_return(redis_conf)
57
- redis_options = subject.redis_options
58
- redis_options.should have_key(:password)
59
- redis_options[:password].should == password
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
 
@@ -71,8 +71,8 @@ describe 'Creating Hooks' do
71
71
  end
72
72
 
73
73
  context 'Other' do
74
- it 'inits' do
75
- Aesop::Aesop.instance.should_receive(:init)
74
+ it 'does not init' do
75
+ expect(Aesop::Aesop.instance).to_not receive(:init)
76
76
  load_file
77
77
  end
78
78
  end
@@ -8,13 +8,11 @@ rescue Bundler::BundlerError => e
8
8
  exit e.status_code
9
9
  end
10
10
 
11
- unless RUBY_VERSION == "1.8.7"
12
- require "codeclimate-test-reporter"
13
- CodeClimate::TestReporter.start
11
+ require "codeclimate-test-reporter"
12
+ CodeClimate::TestReporter.start
14
13
 
15
- require 'simplecov'
16
- SimpleCov.start
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.1.0.3
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: 2014-11-11 00:00:00.000000000 Z
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.2.2
174
+ rubygems_version: 2.4.5.1
174
175
  signing_key:
175
176
  specification_version: 4
176
177
  summary: Manage exception notification