resugan 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b0da82adc30cfab65fae130355e751f37aaa0ec
4
- data.tar.gz: ba8ca7543faf7d229e11a986f0376ce65b4a880b
3
+ metadata.gz: b9a14dd3ae75e0c54fe96dc31a547317cb2baf98
4
+ data.tar.gz: c7a00f011391a94f7a593f2b95a6ebd2d6237ec0
5
5
  SHA512:
6
- metadata.gz: 6f15686a8c362eb7206e3160517026ceb5d7a29ef1155ae8c863319524ee2e1713b22d7d9621d5b885b6046ff9ce2f18e5682ccc72de3214d62c5f3be92777b6
7
- data.tar.gz: b6a4838b230915d920ff92c9814f7e8ec8cd4b35ffe6f275d38a2ac0b211c4cafef897124868141de5c9fb198f4b0f3e920772b1c4870a5154b358db5e822253
6
+ metadata.gz: dda2fe3386e96552e0a014b91627c0736edc8b3240838c17d9de4b891dbbcdb8d940857a5d0b8912b66d23460c774597134bb95fdb3c84dc0c463743e3dbb0c4
7
+ data.tar.gz: b2501ed2afb9d5dce3f56c876c06e31fa7296105dfb3634d1fd6916f40d193e78a3e434bfe3b4520b80b6b3b5b6cb15d490cf0e9721048afc43183fe0453f4aa
data/CHANGELOG ADDED
@@ -0,0 +1,5 @@
1
+ = Version 0.1.8
2
+ * First real version for public consumption
3
+
4
+ = Version 0.1
5
+ * Initial Version
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Gem Version](https://badge.fury.io/rb/resugan.svg)](https://badge.fury.io/rb/resugan) [![CircleCI](https://circleci.com/gh/jedld/resugan.svg?style=svg)](https://circleci.com/gh/jedld/resugan)
2
+
1
3
  # Resugan
2
4
 
3
5
  Simple, powerful and unobstrusive event driven architecture framework for ruby. This gem provides
@@ -167,8 +169,6 @@ puts resugan {
167
169
  {:event1=>[{:params=>{:_source=>"/Users/jedld/workspace/resugan/spec/resugan_spec.rb:144:in `block (5 levels) in <top (required)>'"}}]}
168
170
  ```
169
171
 
170
-
171
-
172
172
  ## Related Projects
173
173
 
174
174
  Below are projects that extend resugan.
@@ -1,5 +1,14 @@
1
1
  module Resugan
2
2
  class Kernel
3
+ # show warning when a _fire was called and there was no context to consume it
4
+ def self.warn_no_context_events(enable)
5
+ @warn_no_context_events = enable
6
+ end
7
+
8
+ def self.warn_no_context_events?
9
+ @warn_no_context_events || false
10
+ end
11
+
3
12
  # flag to log the line source where a fire was executed
4
13
  def self.enable_line_trace(enable)
5
14
  @enable = enable
@@ -54,7 +63,7 @@ module Resugan
54
63
  event = "#{namespace}_#{event}".to_sym
55
64
  if @_listener && @_listener[event]
56
65
  @_listener[event].each do |_listener|
57
- _listener.call(payload.map { |p| p[:params] })
66
+ _listener.call(payload.map { |p| p[:params] || p['params'] })
58
67
  end
59
68
  end
60
69
  end
@@ -7,7 +7,7 @@ class Object
7
7
 
8
8
  context = current_thread.pop_resugan_context
9
9
  context.invoke
10
-
10
+
11
11
  context
12
12
  end
13
13
 
@@ -17,6 +17,8 @@ class Object
17
17
  current_thread = Thread.current
18
18
  if current_thread.resugan_context
19
19
  current_thread.resugan_context.register(event, params)
20
+ else
21
+ puts "WARN: #{event} called in #{caller[0]} but was not inside a resugan {} block" if Resugan::Kernal.warn_no_context_events?
20
22
  end
21
23
  end
22
24
 
@@ -1,3 +1,3 @@
1
1
  module Resugan
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
data/resugan.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
- spec.add_development_dependency "bundler", "~> 1.12"
30
+ spec.add_development_dependency "bundler"
31
31
  spec.add_development_dependency "rake", "~> 10.0"
32
32
  spec.add_development_dependency "rspec", "~> 3.0"
33
33
  spec.add_development_dependency "pry"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resugan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Emmanuel Dayo
@@ -14,16 +14,16 @@ dependencies:
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.12'
19
+ version: '0'
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
- version: '1.12'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -76,6 +76,7 @@ files:
76
76
  - ".gitignore"
77
77
  - ".rspec"
78
78
  - ".travis.yml"
79
+ - CHANGELOG
79
80
  - CODE_OF_CONDUCT.md
80
81
  - Gemfile
81
82
  - LICENSE.txt