call 0.0.1 → 0.0.2

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: 4de687ca6fd57163c91e38697986639f2e8976b4
4
- data.tar.gz: 35b6f1dbb6236fd91853e70412ec3fa6147aa47a
3
+ metadata.gz: 6ad2822a1b06af2df2e30453263b1310dfb99ce7
4
+ data.tar.gz: 640355175d7335585ea19757ff7dc726708baf00
5
5
  SHA512:
6
- metadata.gz: 83e2f170d01e5b250d0a1e1fcb7938b2d7eda2421216d9867fc686bf17eb6e069a87ad24ff1dd5763cdd362a2918aa76768c9a2872a47edd073e0d7124961aad
7
- data.tar.gz: 2acda1c8db91cc6c17dd0b7291e29f9818b112be1daccb6c0abeeed5d75b4bcf35a4beb81341606c32503b55135cfb6d29dfa2b0034ca6e8b0099c2f4623a661
6
+ metadata.gz: 4756a2afa9431609d96d6e11bf72349c339d20cdff0d9acee8e04cb741260279b00ac014c8a5b390617cd5190f60492e7cc0f01675e52c52056a01ae089507bc
7
+ data.tar.gz: 591246de784d0afe82661dc42ee5a43aae500beeaa256a6d74445e03184f4868b0bae59f90c56864366d0e51c4332e0ba1bc58456c686aeba212beddc5b4b710
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Call
2
2
 
3
- TODO: Write a gem description
3
+ We use this little gem for coordination the Callback-Trigger-Pingpong between
4
+ contexts and their callers.
5
+
6
+ See [examples/dci.rb](https://github.com/neopoly/call/blob/master/examples/dci.rb) for a running piece of code using `Call`.
7
+
4
8
 
5
9
  ## Installation
6
10
 
@@ -16,10 +20,6 @@ Or install it yourself as:
16
20
 
17
21
  $ gem install call
18
22
 
19
- ## Usage
20
-
21
- TODO: Write usage instructions here
22
-
23
23
  ## Contributing
24
24
 
25
25
  1. Fork it
@@ -6,7 +6,7 @@ require 'call/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "call"
8
8
  spec.version = Call::VERSION
9
- spec.authors = ["Jakob Holderbaum"]
9
+ spec.authors = ["Jakob Holderbaum", "Peter Suschlik", "Jonas Thiel"]
10
10
  spec.email = ["jh@neopoly.de"]
11
11
  spec.summary = %q{Callback-Trigger-Pingpong for clean DCI implementation.}
12
12
  spec.homepage = "https://github.com/neopoly/call"
@@ -1,5 +1,7 @@
1
1
  module Call
2
2
  class Response
3
+ attr_reader :type, :args
4
+
3
5
  def initialize(type, *args)
4
6
  @type = type
5
7
  @args = args
@@ -7,7 +9,7 @@ module Call
7
9
 
8
10
  private
9
11
  def trigger_responded(type, &block)
10
- if type == @type
12
+ if type == self.type
11
13
  block.call(*@args)
12
14
  end
13
15
  end
@@ -1,3 +1,3 @@
1
1
  module Call
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -38,7 +38,7 @@ describe Call do
38
38
  end
39
39
 
40
40
  on.failure do |*args|
41
- @calls << OpenStruct.new(:type => :success, :args => args)
41
+ @calls << OpenStruct.new(:type => :failure, :args => args)
42
42
  end
43
43
  end
44
44
 
@@ -46,5 +46,11 @@ describe Call do
46
46
  trigger.failure 22
47
47
 
48
48
  assert_equal 2, @calls.size
49
+
50
+ assert_equal :success, @calls[0].type
51
+ assert_equal ['12', :b], @calls[0].args
52
+
53
+ assert_equal :failure, @calls[1].type
54
+ assert_equal [22], @calls[1].args
49
55
  end
50
56
  end
metadata CHANGED
@@ -1,10 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: call
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakob Holderbaum
8
+ - Peter Suschlik
9
+ - Jonas Thiel
8
10
  autorequire:
9
11
  bindir: bin
10
12
  cert_chain: []