interaction 0.0.1 → 0.0.2

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: 24abdee95d1dcb71e2f8fcff831c58fbc7eecd56
4
- data.tar.gz: ce0165495f7ab28fe43bc63055f90816167cc7a4
3
+ metadata.gz: b2f6540164e956df26bace2a6bf1587e87cf370d
4
+ data.tar.gz: 54f712fec342b6a37e583bd81f0e6c6f86e845ae
5
5
  SHA512:
6
- metadata.gz: 53f4b4878a61bcaff9faf77e6a7ae55436d9aab5f31d9982ae8cedd951745eaa8016c769ff60e745fb2c79970573d0964bae22d15631c2ff52f65afa42c859e5
7
- data.tar.gz: 87e8aea24284006a64b866b9bf5738c6a62ab45458141b526a67346455ae5ddabac091eabd0917fc1fd8ebcf7e18b48f12eb4aa1196497cd9596d78c2516d4d4
6
+ metadata.gz: 0f6eef545d0053a932be6dfac2403ba52989066a2bb004e5a9e6f8a213cf8b5f4ab72d3c3aa22920a0c35a577bc0c49e47602c8d72fe4fd8f606f0b078854e08
7
+ data.tar.gz: 3d35d32ead882c2eb60d0bdcc739a03492e9f1ca2a889bb76975b6e121aca655922f9ad7f896a89f3a669dd56b2dadb47285e61b6327824418b3f89e8d5b27de
data/README.md CHANGED
@@ -7,7 +7,7 @@ application `SignUp`, `RequestResetPasswordEmail` etc.
7
7
  Attributes are whitelisted and coerced into an expected type using Virtus. An
8
8
  attribute will either be the specified type or nil.
9
9
 
10
- Take a look at the [code itself](https://github.com/stevehodgkiss/use_case/blob/master/lib/use_case.rb) for full details of the API provided.
10
+ Take a look at the [code itself](https://github.com/stevehodgkiss/interaction/blob/master/lib/interaction.rb) for full details of the API provided.
11
11
 
12
12
  ## A simple example
13
13
 
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["steve@hodgkiss.me"]
11
11
  spec.summary = %q{Provides a convention for modelling user interactions as use case classes.}
12
12
  spec.description = %q{}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/stevehodgkiss/interaction"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -3,9 +3,8 @@ require "interaction/params"
3
3
  require "interaction/validation_helpers"
4
4
 
5
5
  module Interaction
6
- # Override Ruby's module inclusion hook to prepend base with our #perform
7
- # method, extend base with a .perform method, include Params for Virtus and
8
- # ActiveSupport::Validation.
6
+ # Override Ruby's module inclusion hook to prepend base with #perform,
7
+ # extend base with a .perform method, and include Params for Virtus.
9
8
  #
10
9
  # @api private
11
10
  def self.included(base)
@@ -8,7 +8,7 @@ module Interaction::ValidationHelpers
8
8
  # @since 0.0.1
9
9
  # @api public
10
10
  def validate!
11
- failure unless valid?
11
+ failure! unless valid?
12
12
  end
13
13
 
14
14
  # Merges errors from another
@@ -1,3 +1,3 @@
1
1
  module Interaction
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -12,11 +12,12 @@ describe Interaction::ValidationHelpers do
12
12
  ActiveModel::Name.new(self, nil, "Test")
13
13
  end
14
14
 
15
- attr_accessor :name
15
+ attr_accessor :name, :result
16
16
  validates :name, presence: true
17
17
 
18
18
  def perform
19
19
  validate!
20
+ @result = true
20
21
  end
21
22
 
22
23
  public :merge_errors
@@ -45,12 +46,15 @@ describe Interaction::ValidationHelpers do
45
46
  let(:params) { {} }
46
47
 
47
48
  it { should_not be_success }
49
+ it { expect(use_case.result).to be_nil }
48
50
  end
49
51
 
50
52
  context 'when validation succeeds' do
51
53
  let(:params) { { name: 'Test' } }
52
54
 
53
55
  it { should be_success }
56
+
57
+ it { expect(use_case.result).to eq(true) }
54
58
  end
55
59
  end
56
60
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interaction
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
  - Steve Hodgkiss
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-05 00:00:00.000000000 Z
11
+ date: 2015-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -102,7 +102,7 @@ files:
102
102
  - spec/interaction/validation_helpers_spec.rb
103
103
  - spec/interaction_spec.rb
104
104
  - spec/spec_helper.rb
105
- homepage: ''
105
+ homepage: https://github.com/stevehodgkiss/interaction
106
106
  licenses:
107
107
  - MIT
108
108
  metadata: {}