inferno 0.1.0 → 0.1.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.
- checksums.yaml +8 -8
- data/Rakefile +2 -0
- data/inferno.gemspec +1 -2
- data/lib/inferno.rb +2 -0
- data/lib/inferno/logger.rb +15 -0
- data/lib/inferno/version.rb +1 -1
- data/spec/event_spec.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTk1OGQ4NmI2YmI5NDdhYWRkNmRhNmFhOGQyYjgxZjNjNThiZTkxYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTU4ZmY2MjcyNzMxOGNjMDE3YWIyMmJiZGY3NTNkZGNlNzYxNjAxOA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWE4NzhkOGE5NThiNGI3ZWRlMGUxZDM0YWZjMTlmM2E0ZGU3MWE3OTdmMDBh
|
10
|
+
MDE2MDI1YjNlZTY4YWIzZTY3MjZmNzVjZTQxYjg3NWUwNTFhNGRlMjFkNzRm
|
11
|
+
NDcwZTQ4YTA4ODkwYmQ4YjNlNzBkYzY4MjNmNTRmM2E4ODBkNWE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWNmMjIxMzZiNGI2Y2ZkZTgzZWQxMmI3ZTY5NWRlMThjMTRkMjJlYzQwNTFh
|
14
|
+
ZmJjYTQwMDJlNDU3YjVhNDBhZDZmZTM5NzQwYmMxOWY5YWM3ZTFmMWE5Mjhh
|
15
|
+
MDU2YzhmZTczYzc5Y2VlYmQ2ZjAwMTk2MWMxMDk1OTA1YTg3OTc=
|
data/Rakefile
CHANGED
data/inferno.gemspec
CHANGED
@@ -2,8 +2,7 @@
|
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require 'inferno/version'
|
5
|
-
|
6
|
-
RSpec::Core::RakeTask.new('spec')
|
5
|
+
|
7
6
|
Gem::Specification.new do |spec|
|
8
7
|
spec.name = "inferno"
|
9
8
|
spec.version = Inferno::VERSION
|
data/lib/inferno.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
require "logger"
|
2
|
+
|
3
|
+
module Inferno
|
4
|
+
|
5
|
+
class Logger
|
6
|
+
def initialize(notifications)
|
7
|
+
@logger = ::Logger.new(STDOUT)
|
8
|
+
@logger.formatter = proc do |severity, datetime, progname, msg|
|
9
|
+
msg + "\n"
|
10
|
+
end
|
11
|
+
notifications.on("triggered.event", self) { |payload| @logger.info "Triggered: #{payload[:event].inspect} with payload: #{payload[:payload].inspect}" }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
data/lib/inferno/version.rb
CHANGED
data/spec/event_spec.rb
CHANGED
@@ -18,6 +18,7 @@ describe Inferno::Event do
|
|
18
18
|
it "should allow add actions and run it in proper context" do
|
19
19
|
dummy = DummyContextObject.new
|
20
20
|
notifications = Inferno::Event.new
|
21
|
+
|
21
22
|
notifications.on(:test, dummy) { @test_var = 2 }
|
22
23
|
notifications.count(:test).should eq(1)
|
23
24
|
notifications.trigger(:test)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inferno
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arkadiusz Buras
|
@@ -86,6 +86,7 @@ files:
|
|
86
86
|
- Rakefile
|
87
87
|
- inferno.gemspec
|
88
88
|
- lib/inferno.rb
|
89
|
+
- lib/inferno/logger.rb
|
89
90
|
- lib/inferno/version.rb
|
90
91
|
- spec/event_spec.rb
|
91
92
|
- spec/spec_helper.rb
|