nala 0.0.6 → 0.0.7

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d87e064fd811730de41a3619632242a9059d5c3c
4
- data.tar.gz: 69c65044ee82f3b3844faaafefff09d773a80f9a
3
+ metadata.gz: e24b33814fd472cb82c0a1df0245dd50bca407cc
4
+ data.tar.gz: 7acae49d029d2c69fb61777de30f37384f0b3bb5
5
5
  SHA512:
6
- metadata.gz: e1c78d8c10c6a0e5fc2099eefc65ddbc138a8b729c68d17c6c44e03561143e0e47e5edd7e1f51742a1041fb037e609df03184f067b4496aa4cd9fb287ef795bf
7
- data.tar.gz: ae16065d973d70d209fb9aa1b874d0b0572e9dec94513660fa15d36c977c07d9e5960f0f8449520567511c203862bfe066f627813037cea6c6fae80b9523e8c4
6
+ metadata.gz: 1c9e49b94f37ac4f107781016db0b19851c3e02e7aaad1dc71b99fba3f490a8e45e28eb7de98641d63f3a380c12369a908e63d3cf68e1d1c38e77168c831aa0b
7
+ data.tar.gz: ea4cf4ed1e5a030634c77847b93fbd214c66a072f6d26ebf7c25acad960e828972ceea4018414620eb5f4f1c157726dbca8633c486f345c446f5678f6b502897
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) [year] [fullname]
3
+ Copyright (c) 2015 LoyaltyLion Ltd
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -19,7 +19,9 @@ module Nala
19
19
  end
20
20
 
21
21
  def publish(event, *args)
22
- emitter.store_result(event, args)
22
+ emitter.store_result(event, args) if emitter
23
+
24
+ args
23
25
  end
24
26
 
25
27
  private
data/lib/nala/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nala
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
data/readme.md CHANGED
@@ -7,12 +7,12 @@ Lightweight gem for adding events to use case style classes.
7
7
  To install via RubyGems run:
8
8
 
9
9
  ```
10
- gem install nala
10
+ $ gem install nala
11
11
  ```
12
12
 
13
13
  To install via bundler, add this line to your Gemfile and run `bundle install`:
14
14
 
15
- ```
15
+ ```ruby
16
16
  gem "nala"
17
17
  ```
18
18
 
@@ -83,6 +83,16 @@ class RegistrationController < ApplicationController
83
83
  end
84
84
  ```
85
85
 
86
+ If in some cases you don't need to handle the events, you can either use `.call` or `#call` depending on your preference as internal calls to `#publish` will be ignored.
87
+
88
+ ```ruby
89
+ PlaceOrder.call(order_params)
90
+
91
+ # or
92
+
93
+ PlaceOrder.new(order_params).call
94
+ ```
95
+
86
96
  ## Testing with RSpec
87
97
 
88
98
  If you are using RSpec then you can use the supplied matcher by adding the
@@ -156,7 +166,7 @@ just `block`):
156
166
  let(:success) { Nala::BlockSpy.new }
157
167
  let(:notified) { Nala::BlockSpy.new }
158
168
 
159
- it "passes multiple arguments to handlers" do
169
+ it "calls multiple handlers" do
160
170
  PlaceOrder.call
161
171
  .on(:success, &success.spy)
162
172
  .on(:notified, &notified.spy)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nala
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Pike