inferno 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODhlNDVmMTNmM2U0MzJmYzM0YTFjMzcxYmJmZWMwZjg5MmQ1ZDRkMg==
4
+ OTk1OGQ4NmI2YmI5NDdhYWRkNmRhNmFhOGQyYjgxZjNjNThiZTkxYg==
5
5
  data.tar.gz: !binary |-
6
- NDUzMTUwZGJlOTExNWM1MDlkMzBmMWI0MWNlYjZkYjEyNDU2OTA2OQ==
6
+ MTU4ZmY2MjcyNzMxOGNjMDE3YWIyMmJiZGY3NTNkZGNlNzYxNjAxOA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YTFjYzIxM2M5ZjVhNGIzZDFkYzQ0MzgwZDc2YmQ5MDRjMmIxM2E5MTUzOWY0
10
- MmVjZWRjMWMxYzNiODQ4NjU4N2YzZmIwZGYwNzBhMGE1YWEyMGIxZWU0MzIz
11
- OGRkMjAxMjJiOTU5M2RiOTM2Njg5N2M3OWJlZTYxMTQxMmQzY2I=
9
+ MWE4NzhkOGE5NThiNGI3ZWRlMGUxZDM0YWZjMTlmM2E0ZGU3MWE3OTdmMDBh
10
+ MDE2MDI1YjNlZTY4YWIzZTY3MjZmNzVjZTQxYjg3NWUwNTFhNGRlMjFkNzRm
11
+ NDcwZTQ4YTA4ODkwYmQ4YjNlNzBkYzY4MjNmNTRmM2E4ODBkNWE=
12
12
  data.tar.gz: !binary |-
13
- YTQ0OGVmMzMzNGM2ODhkM2FmNDM1YmQwMDEzNWExMzZiZGM1NTczNDc2Njdm
14
- MDc4N2Y2YmYxZmY2ZTk5NzM3NzEyNTI4Njc4YjY5ZTM5OTJmOTRkZTZmN2I1
15
- YTc2OWRmZjhjZDdjYWZiOThjODczNjQ2NGI5MGM0ODExNjVlNTU=
13
+ ZWNmMjIxMzZiNGI2Y2ZkZTgzZWQxMmI3ZTY5NWRlMThjMTRkMjJlYzQwNTFh
14
+ ZmJjYTQwMDJlNDU3YjVhNDBhZDZmZTM5NzQwYmMxOWY5YWM3ZTFmMWE5Mjhh
15
+ MDU2YzhmZTczYzc5Y2VlYmQ2ZjAwMTk2MWMxMDk1OTA1YTg3OTc=
data/Rakefile CHANGED
@@ -1 +1,3 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+ RSpec::Core::RakeTask.new('spec')
@@ -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
- require 'rspec/core/rake_task'
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
@@ -1,5 +1,7 @@
1
1
  require "inferno/version"
2
+ require "inferno/logger"
2
3
  require "eventmachine"
4
+
3
5
  module Inferno
4
6
  class Event
5
7
  def initialize
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Inferno
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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.0
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