simple_action 0.0.1.pre3 → 0.0.1.pre4

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGNmNTZkMDQxNDllYjJkMGQ5NjhlZjMyMTRiODEyNTk1Y2I0YzRkYg==
4
+ ODdhYTRmMjQ0MjU4OTU0MjBkYmYyNjA1MzQ4MWE0NzY1MzI2MGZiMQ==
5
5
  data.tar.gz: !binary |-
6
- ZWUxMDRiNmRlOWRiNWFjMGNhNTYyZGMzNzQ1YmE1NjFmMTEzNTcwMQ==
6
+ ZTllZjRiZDEzNmJjNThiOGRkOWRjY2Q0NDAzZDNlYzRkMWJiN2IzZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTVmZWZmOTk0MmVjYzQ5Yjk1ZTRiZjBkYzk4OTQ3N2YwYmJkZjg3MDQ0NDk2
10
- Nzg5ZTY0MTkzMDBkNjQwM2FiY2Q4MzFjMGQ5ODIyMmY4ODc5OTQyZGFmMzE3
11
- Zjk5NWVjNjA3YmFjODNmOTEyNDNmNGU5MjgwOTExOWE3ZmFjMjg=
9
+ NTZiZmViMDgzZmQxYTBmMDQ0NWEzZGU5MmU4ZDg2ZmM1M2M0Yzc1YzAzZTk5
10
+ NWEyNjJlOGJhYzY2YTM0NGYxOTY0YWJiMmMwNWQ5ZDkyZDUyOTI3ODk0ZjQw
11
+ ZmJhOWUwNTBjOWNhYzE2NDczYThmYTBjNWExYWZmMjdkZDgxMWY=
12
12
  data.tar.gz: !binary |-
13
- MDg1NDRiNmRiZjdjYzA1NTFmYjk2ZTUzMzA5NDM2Zjk0N2M3NDIxYWRhMjEx
14
- ZmMxMDgxZGVkYzM5YjM1NjE2NjMzMGVkMjg0YmU4MmU2OTVlNjNhYjJhNjQy
15
- MDBjYzZkZDY1YzE4OGMyZWRmNzg5ODc1Y2ZhMjc2NTU1ZjYxMWM=
13
+ OGJhOGMyNmVlNzRiN2Q5NGIyMzE5M2Y1MTQ4N2I4YmFjNjMzNzY4ZWQ5NjNi
14
+ M2Y4MmRjNTY1YjdkM2I3N2ZiNmUxMjBhY2U5ODAwODg0ZWExOGJlMmU1MjJm
15
+ ZmUxYWY2ODc3Y2M2NDc3Nzk3NDZkZTg2YTQ1ZGM3ZWQ1YzA0MjE=
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_action (0.0.1.pre1)
5
- simple_params (>= 0.0.4, < 1.0)
4
+ simple_action (0.0.1.pre3)
5
+ simple_params (>= 0.0.5, < 1.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -32,7 +32,7 @@ GEM
32
32
  ice_nine (0.11.1)
33
33
  json (1.8.2)
34
34
  method_source (0.8.2)
35
- minitest (5.6.1)
35
+ minitest (5.7.0)
36
36
  pry (0.10.1)
37
37
  coderay (~> 1.1.0)
38
38
  method_source (~> 0.8.1)
@@ -48,7 +48,7 @@ GEM
48
48
  rspec-mocks (2.99.3)
49
49
  shoulda-matchers (2.8.0)
50
50
  activesupport (>= 3.0.0)
51
- simple_params (0.0.4)
51
+ simple_params (0.0.5)
52
52
  activemodel (>= 3.0, < 5.0)
53
53
  shoulda-matchers (~> 2.8)
54
54
  virtus (>= 1.0.0)
@@ -30,6 +30,7 @@ module SimpleAction
30
30
  def initialize(params={})
31
31
  @raw_params = params
32
32
  @params = self.class.params_class.new(params)
33
+ @validity = nil
33
34
  end
34
35
 
35
36
  def params
@@ -37,7 +38,12 @@ module SimpleAction
37
38
  end
38
39
 
39
40
  def valid?
40
- @params.valid?
41
+ # Doing this to avoid re-running @params.valid? every time.
42
+ if @validity.nil?
43
+ @validity = @params.valid?
44
+ else
45
+ @validity
46
+ end
41
47
  end
42
48
 
43
49
  def errors
@@ -1,3 +1,3 @@
1
1
  module SimpleAction
2
- VERSION = "0.0.1.pre3"
2
+ VERSION = "0.0.1.pre4"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "simple_params", ">= 0.0.4", "< 1.0"
21
+ spec.add_dependency "simple_params", ">= 0.0.5", "< 1.0"
22
22
  spec.add_development_dependency "bundler", "~> 1.5"
23
23
  spec.add_development_dependency "rake", "~> 10.1"
24
24
  spec.add_development_dependency "rspec", "~> 2.6"
data/spec/service_spec.rb CHANGED
@@ -35,7 +35,7 @@ describe SimpleAction::Service do
35
35
  outcome.should be_success
36
36
  end
37
37
 
38
- it "has result equal to output of execute", failing: true do
38
+ it "has result equal to output of execute" do
39
39
  outcome.result.should eq(41)
40
40
  end
41
41
 
data/spec/spec_helper.rb CHANGED
@@ -5,8 +5,6 @@ require 'pry'
5
5
 
6
6
  Dir[File.join('.', 'spec', 'support', '**', '*.rb')].each {|f| require f}
7
7
 
8
- # I18n.config.enforce_available_locales = true
9
-
10
8
  RSpec.configure do |config|
11
9
  config.mock_with :rspec
12
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_action
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre3
4
+ version: 0.0.1.pre4
5
5
  platform: ruby
6
6
  authors:
7
7
  - brycesenz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-18 00:00:00.000000000 Z
11
+ date: 2015-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_params
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.4
19
+ version: 0.0.5
20
20
  - - <
21
21
  - !ruby/object:Gem::Version
22
22
  version: '1.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.0.4
29
+ version: 0.0.5
30
30
  - - <
31
31
  - !ruby/object:Gem::Version
32
32
  version: '1.0'