cooperator 0.2.1 → 0.2.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: 1840d5e84fd43296da1b4460ca7b48115e8dc75b
4
- data.tar.gz: 82673faac1bd47f7f6462c59780298bac5dbc2c9
3
+ metadata.gz: 8f341b90eda31286aff66b4d4211f86046672463
4
+ data.tar.gz: 7c3f956e40d77c7b976a815746f1230537fc9730
5
5
  SHA512:
6
- metadata.gz: 492360064a627fc2e44907a469eb97c980f8ea31d6019d90075d8c1fd2ccac36956d818c661b255a263edce14c0b1e7be152e2a78a6a9a039ecc68c0380c13a0
7
- data.tar.gz: b3b84a56b62387e8bc9b88b762ecc9eed0d47b607572dfc9c862c5162fcad56ef612fc5b7dc6e4606641946dff33e84500e02a0c8e4e437bb21dd6df50790859
6
+ metadata.gz: daeb2d49595dc715886ddc67ce64fa6d2d93c2d05c2f07e5ac6ece45fecf1708cbf33f5e1716959c4219ebec01dcc2bb153d4841a69145bd186b4e38993cfc4e
7
+ data.tar.gz: 0c5732021951f7483fadd2a3f488d4c082662867d0da41887a0ed5eb9ee238a1743c2f1f081b4843ef8f1147bcda416c65a65359f7ef21f437545555e2b61361
@@ -1,3 +1,3 @@
1
1
  module Cooperator
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
data/lib/cooperator.rb CHANGED
@@ -102,6 +102,12 @@ module Cooperator
102
102
  end
103
103
  end
104
104
 
105
+ def commit(properties = {})
106
+ properties.each do |key, value|
107
+ context.send :"#{key}=", value
108
+ end
109
+ end
110
+
105
111
  def self.prepended(base)
106
112
  base.extend ClassMethods
107
113
  end
data/spec/commit.rb ADDED
@@ -0,0 +1,18 @@
1
+ require 'cooperator'
2
+
3
+ class Interactor
4
+ prepend Cooperator
5
+
6
+ def perform
7
+ commit apple: 'Apple'
8
+ end
9
+ end
10
+
11
+ scope '#commit' do
12
+ spec 'set given properties to the current context' do
13
+ context = Interactor.perform
14
+
15
+ assert context.apple, :==, 'Apple'
16
+ end
17
+ end
18
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cooperator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erol Fornoles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-04 00:00:00.000000000 Z
11
+ date: 2014-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -54,6 +54,7 @@ files:
54
54
  - lib/cooperator.rb
55
55
  - lib/cooperator/context.rb
56
56
  - lib/cooperator/version.rb
57
+ - spec/commit.rb
57
58
  - spec/context.rb
58
59
  - spec/cooperate.rb
59
60
  - spec/failure.rb
@@ -87,6 +88,7 @@ signing_key:
87
88
  specification_version: 4
88
89
  summary: Simple cooperative interactors for Ruby
89
90
  test_files:
91
+ - spec/commit.rb
90
92
  - spec/context.rb
91
93
  - spec/cooperate.rb
92
94
  - spec/failure.rb