klogger 1.0.0 → 1.0.1
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.
- data/.gitignore +5 -1
- data/.travis.yml +22 -0
- data/Jarfile +3 -2
- data/README.md +40 -1
- data/VERSION +1 -1
- data/klogger.gemspec +7 -5
- data/lib/klogger.rb +58 -28
- data/lib/klogger/base.rb +20 -0
- data/lib/klogger/email.rb +59 -0
- data/lib/klogger/irc.rb +77 -0
- data/lib/klogger/syslog.rb +39 -0
- data/pom.xml +44 -0
- data/release.sh +27 -0
- data/spec/klogger/integration_spec.rb +59 -0
- data/spec/spec_helper.rb +1 -0
- metadata +60 -24
data/.gitignore
CHANGED
data/.travis.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
notifications:
|
4
|
+
email:
|
5
|
+
- killbilling-dev@googlegroups.com
|
6
|
+
|
7
|
+
rvm:
|
8
|
+
- 1.9.2
|
9
|
+
- 1.9.3
|
10
|
+
- ruby-head
|
11
|
+
- jruby-19mode
|
12
|
+
- jruby-head
|
13
|
+
|
14
|
+
jdk:
|
15
|
+
- openjdk7
|
16
|
+
- oraclejdk7
|
17
|
+
- openjdk6
|
18
|
+
|
19
|
+
matrix:
|
20
|
+
allow_failures:
|
21
|
+
- rvm: ruby-head
|
22
|
+
- rvm: jruby-head
|
data/Jarfile
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
jar 'com.ning.billing:killbill-api', '0.1.
|
2
|
-
jar 'com.ning.billing:killbill-util:tests', '0.1.
|
1
|
+
jar 'com.ning.billing:killbill-api', '0.1.78'
|
2
|
+
jar 'com.ning.billing:killbill-util:tests', '0.1.78'
|
3
|
+
jar 'javax.servlet:javax.servlet-api', '3.0.1'
|
data/README.md
CHANGED
@@ -1,4 +1,43 @@
|
|
1
|
+
[](https://travis-ci.org/killbill/killbill-logging-plugin)
|
2
|
+
[](https://codeclimate.com/github/killbill/killbill-logging-plugin)
|
3
|
+
|
1
4
|
killbill-logging-plugin
|
2
5
|
=======================
|
3
6
|
|
4
|
-
Plugin to log
|
7
|
+
Plugin to log Kill Bill events.
|
8
|
+
|
9
|
+
Configuration
|
10
|
+
-------------
|
11
|
+
|
12
|
+
The plugin expects a `klogger.yml` configuration file containing the following:
|
13
|
+
|
14
|
+
```
|
15
|
+
syslog:
|
16
|
+
:enabled: true
|
17
|
+
:ident: 'klogger'
|
18
|
+
:options: 9 # ::Syslog::LOG_PID | ::Syslog::LOG_NDELAY
|
19
|
+
:facility: 128 # ::Syslog::LOG_LOCAL0
|
20
|
+
|
21
|
+
irc:
|
22
|
+
:enabled: true
|
23
|
+
:channels: ['#killbilling']
|
24
|
+
:nick: 'klogger'
|
25
|
+
:server: 'irc.freenode.org'
|
26
|
+
:port: 6667
|
27
|
+
:password: 'foo'
|
28
|
+
|
29
|
+
email:
|
30
|
+
:to: pierre@pierre.com
|
31
|
+
:from: ops@pierre.com
|
32
|
+
:enabled: true
|
33
|
+
:address: 'smtp.gmail.com'
|
34
|
+
:port: 587
|
35
|
+
:domain: 'your.host.name'
|
36
|
+
:username: 'username'
|
37
|
+
:password: 'password'
|
38
|
+
:authentication: 'plain'
|
39
|
+
:enable_starttls_auto: true
|
40
|
+
```
|
41
|
+
|
42
|
+
By default, the plugin will look at the plugin directory root (where `killbill.properties` is located) to find this file.
|
43
|
+
Alternatively, set the Kill Bill system property `-Dcom.ning.billing.osgi.bundles.jruby.conf.dir=/my/directory` to specify another location.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
data/klogger.gemspec
CHANGED
@@ -3,16 +3,16 @@ version = File.read(File.expand_path('../VERSION', __FILE__)).strip
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'klogger'
|
5
5
|
s.version = version
|
6
|
-
s.summary = 'Plugin to log
|
7
|
-
s.description = 'Log all events generated by
|
6
|
+
s.summary = 'Plugin to log Kill Bill events.'
|
7
|
+
s.description = 'Log all events generated by Kill Bill.'
|
8
8
|
|
9
9
|
s.required_ruby_version = '>= 1.9.3'
|
10
10
|
|
11
11
|
s.license = 'Apache License (2.0)'
|
12
12
|
|
13
|
-
s.author = '
|
13
|
+
s.author = 'Kill Bill core team'
|
14
14
|
s.email = 'killbilling-users@googlegroups.com'
|
15
|
-
s.homepage = 'http://
|
15
|
+
s.homepage = 'http://kill-bill.org'
|
16
16
|
|
17
17
|
s.files = `git ls-files`.split("\n")
|
18
18
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -22,10 +22,12 @@ Gem::Specification.new do |s|
|
|
22
22
|
|
23
23
|
s.rdoc_options << '--exclude' << '.'
|
24
24
|
|
25
|
-
s.add_dependency 'killbill', '~> 1.0.
|
25
|
+
s.add_dependency 'killbill', '~> 1.0.18'
|
26
26
|
s.add_dependency 'cinch', '~> 2.0.3'
|
27
|
+
s.add_dependency 'mail', '~> 2.5.3'
|
27
28
|
|
28
29
|
s.add_development_dependency 'jbundler', '~> 0.4.1'
|
29
30
|
s.add_development_dependency 'rake', '>= 10.0.0'
|
31
|
+
s.add_development_dependency 'rack', '>= 1.5.2'
|
30
32
|
s.add_development_dependency 'rspec', '~> 2.12.0'
|
31
33
|
end
|
data/lib/klogger.rb
CHANGED
@@ -4,55 +4,85 @@ require 'psych'
|
|
4
4
|
require 'killbill'
|
5
5
|
|
6
6
|
require 'klogger/base'
|
7
|
+
require 'klogger/email'
|
7
8
|
require 'klogger/irc'
|
8
9
|
require 'klogger/syslog'
|
9
10
|
|
10
11
|
MODULES = {
|
11
12
|
:irc => Klogger::IRC,
|
12
|
-
:syslog => Klogger::Syslog
|
13
|
+
:syslog => Klogger::Syslog,
|
14
|
+
:email => Klogger::Email
|
13
15
|
}
|
14
16
|
|
15
|
-
ENABLED_MODULES = []
|
16
|
-
|
17
|
-
LOG = Logger.new(STDOUT)
|
18
|
-
LOG.level = Logger::INFO
|
19
|
-
|
20
|
-
# Parse the config file
|
21
|
-
begin
|
22
|
-
CONFIG = Psych.load_file('klogger.yml')
|
23
|
-
rescue Errno::ENOENT
|
24
|
-
LOG.warn 'Unable to find the config file klogger.yml'
|
25
|
-
CONFIG = {}
|
26
|
-
end
|
27
|
-
|
28
|
-
# Instantiate each module
|
29
|
-
CONFIG.each do |kmodule, config|
|
30
|
-
next unless config['enabled']
|
31
|
-
|
32
|
-
module_klass = MODULES[kmodule.to_sym]
|
33
|
-
next unless module_klass
|
34
|
-
|
35
|
-
LOG.info "Module #{module_klass} enabled"
|
36
|
-
ENABLED_MODULES << module_klass.send('new', config)
|
37
|
-
end
|
38
|
-
|
39
17
|
# Killbill plugin, which dispatches to all klogger modules
|
40
18
|
module Klogger
|
41
19
|
class KloggerPlugin < Killbill::Plugin::Notification
|
42
20
|
|
21
|
+
def initialize(*args)
|
22
|
+
super(*args)
|
23
|
+
@enabled_modules = []
|
24
|
+
end
|
25
|
+
|
43
26
|
def start_plugin
|
44
|
-
|
27
|
+
configure_modules
|
28
|
+
@enabled_modules.each do |m|
|
29
|
+
begin
|
30
|
+
m.start_plugin
|
31
|
+
rescue => e
|
32
|
+
@logger.warn "Unable to start module #{m.class}: #{e.message}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
45
36
|
super
|
37
|
+
|
38
|
+
@logger.info "Klogger::KloggerPlugin started"
|
46
39
|
end
|
47
40
|
|
48
41
|
def on_event(event)
|
49
|
-
|
42
|
+
@enabled_modules.each do |m|
|
43
|
+
begin
|
44
|
+
m.on_event(event)
|
45
|
+
rescue => e
|
46
|
+
@logger.warn "Unable to send event to module #{m.class}: #{e.message}"
|
47
|
+
end
|
48
|
+
end
|
50
49
|
end
|
51
50
|
|
52
51
|
def stop_plugin
|
53
52
|
super
|
54
|
-
|
53
|
+
|
54
|
+
@enabled_modules.each do |m|
|
55
|
+
begin
|
56
|
+
m.stop_plugin
|
57
|
+
rescue => e
|
58
|
+
@logger.warn "Unable to stop module #{m.class}: #{e.message}"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
@logger.info "Klogger::KloggerPlugin stopped"
|
55
63
|
end
|
56
64
|
|
65
|
+
private
|
66
|
+
|
67
|
+
def configure_modules
|
68
|
+
# Parse the config file
|
69
|
+
begin
|
70
|
+
@config = Psych.load_file("#{@conf_dir}/klogger.yml")
|
71
|
+
rescue Errno::ENOENT
|
72
|
+
@logger.warn "Unable to find the config file #{@conf_dir}/klogger.yml"
|
73
|
+
return
|
74
|
+
end
|
75
|
+
|
76
|
+
# Instantiate each module
|
77
|
+
@config.each do |kmodule, config|
|
78
|
+
next unless config[:enabled]
|
79
|
+
|
80
|
+
module_klass = MODULES[kmodule.to_sym]
|
81
|
+
next unless module_klass
|
82
|
+
|
83
|
+
@logger.info "Module #{module_klass} enabled"
|
84
|
+
@enabled_modules << module_klass.send('new', config, @logger)
|
85
|
+
end
|
86
|
+
end
|
57
87
|
end
|
58
88
|
end
|
data/lib/klogger/base.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
module Klogger
|
2
|
+
class KloggerBase
|
3
|
+
|
4
|
+
def initialize(config, logger)
|
5
|
+
@config = config
|
6
|
+
@logger = logger
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.event_to_hash(event)
|
10
|
+
{
|
11
|
+
:event_type => event.event_type,
|
12
|
+
:object_type => event.object_type,
|
13
|
+
:event_id => event.object_id,
|
14
|
+
:account_id => event.account_id,
|
15
|
+
:tenant_id => event.tenant_id
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'mail'
|
2
|
+
|
3
|
+
module Klogger
|
4
|
+
class Email < KloggerBase
|
5
|
+
|
6
|
+
def start_plugin
|
7
|
+
configure
|
8
|
+
end
|
9
|
+
|
10
|
+
def on_event(event)
|
11
|
+
say_event(event)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def say_event(event)
|
17
|
+
email_body = <<-eos
|
18
|
+
Event type: #{event.event_type}
|
19
|
+
Object type: #{event.object_type}
|
20
|
+
Account id: #{event.account_id}
|
21
|
+
Event id: #{event.object_id}
|
22
|
+
Tenant id: #{event.tenant_id}
|
23
|
+
eos
|
24
|
+
say(event.event_type, email_body)
|
25
|
+
end
|
26
|
+
|
27
|
+
def say(type, msg)
|
28
|
+
recipient = @config[:to]
|
29
|
+
sender = @config[:from] || "ops@killbill.com"
|
30
|
+
topic = @config[:subject] || "New Kill Bill event: #{type}"
|
31
|
+
|
32
|
+
# Instance variables won't be visible inside the block
|
33
|
+
email = Mail.deliver do
|
34
|
+
to recipient
|
35
|
+
from sender
|
36
|
+
subject topic
|
37
|
+
body msg
|
38
|
+
end
|
39
|
+
@logger.debug "Sent message #{email.message_id} to #{email.to}"
|
40
|
+
end
|
41
|
+
|
42
|
+
def configure
|
43
|
+
options = { :address => @config[:address],
|
44
|
+
:port => @config[:port],
|
45
|
+
:domain => @config[:domain],
|
46
|
+
:user_name => @config[:username],
|
47
|
+
:password => @config[:password],
|
48
|
+
:authentication => @config[:authentication],
|
49
|
+
:enable_starttls_auto => @config[:enable_starttls_auto] }
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
specified_delivery_method = @config[:delivery_method] || :smtp
|
54
|
+
Mail.defaults do
|
55
|
+
delivery_method specified_delivery_method, options
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/lib/klogger/irc.rb
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'cinch'
|
2
|
+
|
3
|
+
module Klogger
|
4
|
+
class IRC < KloggerBase
|
5
|
+
|
6
|
+
def start_plugin
|
7
|
+
@channels = @config[:channels] || ['#killbilling']
|
8
|
+
start_bot(@config[:nick] || 'klogger',
|
9
|
+
@config[:server] || 'irc.freenode.org',
|
10
|
+
@config[:port] || 6667,
|
11
|
+
@config[:password])
|
12
|
+
end
|
13
|
+
|
14
|
+
def on_event(event)
|
15
|
+
@bot.handlers.dispatch(:killbill_events, nil, event, @channels)
|
16
|
+
# Give it some time to write the event to the channel
|
17
|
+
sleep 1
|
18
|
+
end
|
19
|
+
|
20
|
+
def stop_plugin
|
21
|
+
stop_bot
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
class KloggerIRCBot
|
27
|
+
include Cinch::Plugin
|
28
|
+
|
29
|
+
listen_to :killbill_events
|
30
|
+
def listen(m, event, channels)
|
31
|
+
say_event(event, channels)
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def say_event(event, channels)
|
37
|
+
say(KloggerBase.event_to_hash(event).to_s, channels)
|
38
|
+
end
|
39
|
+
|
40
|
+
def say(msg, channels)
|
41
|
+
channels.each do |chan|
|
42
|
+
Channel(chan).send msg
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def start_bot(nick, server, port, password)
|
48
|
+
connected = false
|
49
|
+
@bot = Cinch::Bot.new do
|
50
|
+
configure do |c|
|
51
|
+
c.nick = nick
|
52
|
+
c.server = server
|
53
|
+
c.port = port
|
54
|
+
c.password = password
|
55
|
+
c.channels = @channels
|
56
|
+
c.plugins.plugins = [KloggerIRCBot]
|
57
|
+
|
58
|
+
on :connect do |m|
|
59
|
+
connected = true
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
Thread.abort_on_exception = true
|
65
|
+
@bot_thread = Thread.new do
|
66
|
+
@bot.start
|
67
|
+
end
|
68
|
+
sleep 1 until connected
|
69
|
+
end
|
70
|
+
|
71
|
+
def stop_bot
|
72
|
+
@bot.stop
|
73
|
+
Thread.kill(@bot_thread)
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'syslog'
|
2
|
+
|
3
|
+
module Klogger
|
4
|
+
class Syslog < KloggerBase
|
5
|
+
|
6
|
+
def start_plugin
|
7
|
+
start_syslog(@config[:ident] || 'klogger',
|
8
|
+
@config[:options] || ::Syslog::LOG_PID | ::Syslog::LOG_NDELAY,
|
9
|
+
@config[:facility] || ::Syslog::LOG_LOCAL0)
|
10
|
+
end
|
11
|
+
|
12
|
+
def on_event(event)
|
13
|
+
say_event(event)
|
14
|
+
end
|
15
|
+
|
16
|
+
def stop_plugin
|
17
|
+
stop_syslog
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def say_event(event)
|
23
|
+
say(KloggerBase.event_to_hash(event).to_s)
|
24
|
+
end
|
25
|
+
|
26
|
+
def say(msg)
|
27
|
+
::Syslog.log(::Syslog::LOG_INFO, msg)
|
28
|
+
end
|
29
|
+
|
30
|
+
def start_syslog(ident, options, facility)
|
31
|
+
::Syslog.open(ident, options, facility)
|
32
|
+
end
|
33
|
+
|
34
|
+
def stop_syslog
|
35
|
+
::Syslog.close
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
data/pom.xml
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!--
|
3
|
+
~ Copyright 2010-2013 Ning, Inc.
|
4
|
+
~
|
5
|
+
~ Ning licenses this file to you under the Apache License, version 2.0
|
6
|
+
~ (the "License"); you may not use this file except in compliance with the
|
7
|
+
~ License. You may obtain a copy of the License at:
|
8
|
+
~
|
9
|
+
~ http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
~
|
11
|
+
~ Unless required by applicable law or agreed to in writing, software
|
12
|
+
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
13
|
+
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
14
|
+
~ License for the specific language governing permissions and limitations
|
15
|
+
~ under the License.
|
16
|
+
-->
|
17
|
+
|
18
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
19
|
+
<parent>
|
20
|
+
<groupId>org.sonatype.oss</groupId>
|
21
|
+
<artifactId>oss-parent</artifactId>
|
22
|
+
<version>5</version>
|
23
|
+
</parent>
|
24
|
+
<modelVersion>4.0.0</modelVersion>
|
25
|
+
<groupId>com.ning.killbill.ruby</groupId>
|
26
|
+
<artifactId>logging-plugin</artifactId>
|
27
|
+
<packaging>pom</packaging>
|
28
|
+
<version>1.0.1</version>
|
29
|
+
<name>logging-plugin</name>
|
30
|
+
<url>http://github.com/killbill/killbill-logging-plugin</url>
|
31
|
+
<description>Plugin to log Kill Bill events</description>
|
32
|
+
<licenses>
|
33
|
+
<license>
|
34
|
+
<name>Apache License 2.0</name>
|
35
|
+
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
|
36
|
+
<distribution>repo</distribution>
|
37
|
+
</license>
|
38
|
+
</licenses>
|
39
|
+
<scm>
|
40
|
+
<connection>scm:git:git://github.com/killbill/killbill-logging-plugin.git</connection>
|
41
|
+
<url>https://github.com/killbill/killbill-logging-plugin/</url>
|
42
|
+
<developerConnection>scm:git:git@github.com:killbill/killbill-logging-plugin.git</developerConnection>
|
43
|
+
</scm>
|
44
|
+
</project>
|
data/release.sh
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
set -e
|
2
|
+
|
3
|
+
VERSION=`grep -E '<version>([0-9]+\.[0-9]+\.[0-9]+)</version>' pom.xml | sed 's/[\t \n]*<version>\(.*\)<\/version>[\t \n]*/\1/'`
|
4
|
+
if [ "$VERSION" != "$(cat $PWD/VERSION)" ]; then
|
5
|
+
echo "Unable to release: make sure the versions in pom.xml and VERSION match"
|
6
|
+
exit 1
|
7
|
+
fi
|
8
|
+
|
9
|
+
echo "Cleaning up"
|
10
|
+
rake killbill:clean ; rake build
|
11
|
+
|
12
|
+
echo "Pushing the gem to Rubygems"
|
13
|
+
rake release
|
14
|
+
|
15
|
+
echo "Building artifact"
|
16
|
+
rake killbill:package
|
17
|
+
|
18
|
+
ARTIFACT="$PWD/pkg/klogger-$VERSION.tar.gz"
|
19
|
+
echo "Pushing $ARTIFACT to Maven Central"
|
20
|
+
mvn gpg:sign-and-deploy-file \
|
21
|
+
-DgroupId=com.ning.killbill.ruby \
|
22
|
+
-DartifactId=logging-plugin \
|
23
|
+
-Dversion=$VERSION \
|
24
|
+
-Dpackaging=tar.gz \
|
25
|
+
-DrepositoryId=ossrh-releases \
|
26
|
+
-Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ \
|
27
|
+
-Dfile=$ARTIFACT
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class String
|
4
|
+
def to_string
|
5
|
+
self
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class MockEvent
|
10
|
+
def get_event_type
|
11
|
+
'InvoiceCreationEvent'
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_object_type
|
15
|
+
'INVOICE'
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_object_id
|
19
|
+
'1234'
|
20
|
+
end
|
21
|
+
|
22
|
+
def get_account_id
|
23
|
+
'11-22-33'
|
24
|
+
end
|
25
|
+
|
26
|
+
def get_tenant_id
|
27
|
+
'1100-998'
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe Klogger do
|
32
|
+
|
33
|
+
before(:each) do
|
34
|
+
Dir.mktmpdir do |dir|
|
35
|
+
file = File.new(File.join(dir, 'klogger.yml'), "w+")
|
36
|
+
file.write(<<-eos)
|
37
|
+
syslog:
|
38
|
+
:enabled: false
|
39
|
+
irc:
|
40
|
+
:enabled: false
|
41
|
+
email:
|
42
|
+
:enabled: false
|
43
|
+
eos
|
44
|
+
file.close
|
45
|
+
|
46
|
+
@plugin = Klogger::KloggerPlugin.new
|
47
|
+
@plugin.logger = Logger.new(STDOUT)
|
48
|
+
@plugin.conf_dir = File.dirname(file)
|
49
|
+
|
50
|
+
# Start the plugin here - since the config file will be deleted
|
51
|
+
@plugin.start_plugin
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should start and stop correctly" do
|
56
|
+
@plugin.on_event MockEvent.new
|
57
|
+
@plugin.stop_plugin
|
58
|
+
end
|
59
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: klogger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
4
5
|
prerelease:
|
5
|
-
version: 1.0.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
|
-
-
|
8
|
+
- Kill Bill core team
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: killbill
|
16
16
|
version_requirements: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - ~>
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 1.0.
|
20
|
+
version: 1.0.18
|
21
21
|
none: false
|
22
22
|
requirement: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0.
|
26
|
+
version: 1.0.18
|
27
27
|
none: false
|
28
28
|
prerelease: false
|
29
29
|
type: :runtime
|
@@ -31,29 +31,45 @@ dependencies:
|
|
31
31
|
name: cinch
|
32
32
|
version_requirements: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
|
-
- - ~>
|
34
|
+
- - "~>"
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: 2.0.3
|
37
37
|
none: false
|
38
38
|
requirement: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- - ~>
|
40
|
+
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: 2.0.3
|
43
43
|
none: false
|
44
44
|
prerelease: false
|
45
45
|
type: :runtime
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: mail
|
48
|
+
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - "~>"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 2.5.3
|
53
|
+
none: false
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - "~>"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: 2.5.3
|
59
|
+
none: false
|
60
|
+
prerelease: false
|
61
|
+
type: :runtime
|
46
62
|
- !ruby/object:Gem::Dependency
|
47
63
|
name: jbundler
|
48
64
|
version_requirements: !ruby/object:Gem::Requirement
|
49
65
|
requirements:
|
50
|
-
- - ~>
|
66
|
+
- - "~>"
|
51
67
|
- !ruby/object:Gem::Version
|
52
68
|
version: 0.4.1
|
53
69
|
none: false
|
54
70
|
requirement: !ruby/object:Gem::Requirement
|
55
71
|
requirements:
|
56
|
-
- - ~>
|
72
|
+
- - "~>"
|
57
73
|
- !ruby/object:Gem::Version
|
58
74
|
version: 0.4.1
|
59
75
|
none: false
|
@@ -63,41 +79,58 @@ dependencies:
|
|
63
79
|
name: rake
|
64
80
|
version_requirements: !ruby/object:Gem::Requirement
|
65
81
|
requirements:
|
66
|
-
- -
|
82
|
+
- - ">="
|
67
83
|
- !ruby/object:Gem::Version
|
68
84
|
version: 10.0.0
|
69
85
|
none: false
|
70
86
|
requirement: !ruby/object:Gem::Requirement
|
71
87
|
requirements:
|
72
|
-
- -
|
88
|
+
- - ">="
|
73
89
|
- !ruby/object:Gem::Version
|
74
90
|
version: 10.0.0
|
75
91
|
none: false
|
76
92
|
prerelease: false
|
77
93
|
type: :development
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rack
|
96
|
+
version_requirements: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: 1.5.2
|
101
|
+
none: false
|
102
|
+
requirement: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 1.5.2
|
107
|
+
none: false
|
108
|
+
prerelease: false
|
109
|
+
type: :development
|
78
110
|
- !ruby/object:Gem::Dependency
|
79
111
|
name: rspec
|
80
112
|
version_requirements: !ruby/object:Gem::Requirement
|
81
113
|
requirements:
|
82
|
-
- - ~>
|
114
|
+
- - "~>"
|
83
115
|
- !ruby/object:Gem::Version
|
84
116
|
version: 2.12.0
|
85
117
|
none: false
|
86
118
|
requirement: !ruby/object:Gem::Requirement
|
87
119
|
requirements:
|
88
|
-
- - ~>
|
120
|
+
- - "~>"
|
89
121
|
- !ruby/object:Gem::Version
|
90
122
|
version: 2.12.0
|
91
123
|
none: false
|
92
124
|
prerelease: false
|
93
125
|
type: :development
|
94
|
-
description: Log all events generated by
|
126
|
+
description: Log all events generated by Kill Bill.
|
95
127
|
email: killbilling-users@googlegroups.com
|
96
128
|
executables: []
|
97
129
|
extensions: []
|
98
130
|
extra_rdoc_files: []
|
99
131
|
files:
|
100
|
-
- .gitignore
|
132
|
+
- ".gitignore"
|
133
|
+
- ".travis.yml"
|
101
134
|
- Gemfile
|
102
135
|
- Jarfile
|
103
136
|
- README.md
|
@@ -107,41 +140,44 @@ files:
|
|
107
140
|
- klogger.gemspec
|
108
141
|
- lib/klogger.rb
|
109
142
|
- lib/klogger/base.rb
|
143
|
+
- lib/klogger/email.rb
|
110
144
|
- lib/klogger/irc.rb
|
111
145
|
- lib/klogger/syslog.rb
|
146
|
+
- pom.xml
|
147
|
+
- release.sh
|
112
148
|
- spec/klogger/integration_spec.rb
|
113
149
|
- spec/spec_helper.rb
|
114
|
-
homepage: http://
|
150
|
+
homepage: http://kill-bill.org
|
115
151
|
licenses:
|
116
152
|
- Apache License (2.0)
|
117
153
|
post_install_message:
|
118
154
|
rdoc_options:
|
119
|
-
- --exclude
|
120
|
-
- .
|
155
|
+
- "--exclude"
|
156
|
+
- "."
|
121
157
|
require_paths:
|
122
158
|
- lib
|
123
159
|
required_ruby_version: !ruby/object:Gem::Requirement
|
124
160
|
requirements:
|
125
|
-
- -
|
161
|
+
- - ">="
|
126
162
|
- !ruby/object:Gem::Version
|
127
163
|
version: 1.9.3
|
128
164
|
none: false
|
129
165
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
166
|
requirements:
|
131
|
-
- -
|
167
|
+
- - ">="
|
132
168
|
- !ruby/object:Gem::Version
|
133
169
|
segments:
|
134
170
|
- 0
|
135
|
-
hash: 2
|
136
171
|
version: !binary |-
|
137
172
|
MA==
|
173
|
+
hash: 2
|
138
174
|
none: false
|
139
175
|
requirements: []
|
140
176
|
rubyforge_project:
|
141
177
|
rubygems_version: 1.8.24
|
142
178
|
signing_key:
|
143
179
|
specification_version: 3
|
144
|
-
summary: Plugin to log
|
180
|
+
summary: Plugin to log Kill Bill events.
|
145
181
|
test_files:
|
146
182
|
- spec/klogger/integration_spec.rb
|
147
183
|
- spec/spec_helper.rb
|