simple_action 2.0.1 → 2.0.6

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
- SHA1:
3
- metadata.gz: c1f1cc36cc2e037bf064c3bf6c948d23a4f848da
4
- data.tar.gz: 0cd354808e89b9495129704002950e2699b59cb8
2
+ SHA256:
3
+ metadata.gz: 217c7ba90316a0753a557aa0bf2d261323fc56538da9514ba9693942b565352f
4
+ data.tar.gz: 82fecc8486863e6d700a50ffaa8c4a16a14bd8f92b638c6ee0937af23140edee
5
5
  SHA512:
6
- metadata.gz: b17cef8f5a8a57687499496505dc5829c935c7701b111a65aeb01caf2606f53ae4576713bb96ff38faed88b5c70ffb0ff453e5497e39072f25cd5952b8c967c0
7
- data.tar.gz: bb5346936f15153c0a89811f395db6b7c831889471ff144017aa912932f377724bfa84259ee72c4cebe7292f6f4b11cf5914d6d7a41e332d8cf23f3b47d51f7b
6
+ metadata.gz: 55422909b72d5529ce5bf80c88a47df66ab84ea101c50ac4d02c7d837426555198651d5ed80d36a1149755c00a279d4c856133e1437dcf9f370c9726555f1103
7
+ data.tar.gz: 3c1f3c4fe7068bda16b0178df3191d0007e8f2052d86a56b3f00a10a803c1982209739ccf0b1be7c12de2262a878ed2fe444ad5839adb6d79ecd7a6aac471840
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.4.1
1
+ 2.5.0
data/Gemfile.lock CHANGED
@@ -1,19 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_action (2.0.0)
5
- simple_params (>= 2.0.2)
4
+ simple_action (2.0.6)
5
+ simple_params
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activemodel (5.2.1)
11
- activesupport (= 5.2.1)
12
- activesupport (5.2.1)
10
+ activemodel (6.0.3.2)
11
+ activesupport (= 6.0.3.2)
12
+ activesupport (6.0.3.2)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 0.7, < 2)
15
15
  minitest (~> 5.1)
16
16
  tzinfo (~> 1.1)
17
+ zeitwerk (~> 2.2, >= 2.2.2)
17
18
  appraisal (2.2.0)
18
19
  bundler
19
20
  rake
@@ -25,16 +26,16 @@ GEM
25
26
  coderay (1.1.0)
26
27
  coercible (1.0.0)
27
28
  descendants_tracker (~> 0.0.1)
28
- concurrent-ruby (1.0.5)
29
+ concurrent-ruby (1.1.7)
29
30
  descendants_tracker (0.0.4)
30
31
  thread_safe (~> 0.3, >= 0.3.1)
31
32
  diff-lcs (1.2.5)
32
33
  equalizer (0.0.11)
33
- i18n (1.1.0)
34
+ i18n (1.8.3)
34
35
  concurrent-ruby (~> 1.0)
35
36
  ice_nine (0.11.2)
36
37
  method_source (0.8.2)
37
- minitest (5.11.3)
38
+ minitest (5.14.1)
38
39
  pry (0.10.1)
39
40
  coderay (~> 1.1.0)
40
41
  method_source (~> 0.8.1)
@@ -48,33 +49,34 @@ GEM
48
49
  rspec-expectations (2.99.2)
49
50
  diff-lcs (>= 1.1.3, < 2.0)
50
51
  rspec-mocks (2.99.3)
51
- shoulda-matchers (3.1.2)
52
- activesupport (>= 4.0.0)
53
- simple_params (2.0.2)
54
- activemodel (>= 3.0, <= 6.0)
52
+ shoulda-matchers (4.3.0)
53
+ activesupport (>= 4.2.0)
54
+ simple_params (2.0.4)
55
+ activemodel (>= 3.0, <= 7.0)
55
56
  shoulda-matchers (>= 2.8)
56
57
  virtus (>= 1.0.0)
57
58
  slop (3.6.0)
58
59
  thor (0.20.0)
59
60
  thread_safe (0.3.6)
60
- tzinfo (1.2.5)
61
+ tzinfo (1.2.7)
61
62
  thread_safe (~> 0.1)
62
63
  virtus (1.0.5)
63
64
  axiom-types (~> 0.1)
64
65
  coercible (~> 1.0)
65
66
  descendants_tracker (~> 0.0, >= 0.0.3)
66
67
  equalizer (~> 0.0, >= 0.0.9)
68
+ zeitwerk (2.4.0)
67
69
 
68
70
  PLATFORMS
69
71
  ruby
70
72
 
71
73
  DEPENDENCIES
72
74
  appraisal
73
- bundler (~> 1.5)
75
+ bundler (>= 1.5)
74
76
  pry
75
- rake (~> 10.1)
76
- rspec (~> 2.6)
77
+ rake
78
+ rspec (>= 2.6)
77
79
  simple_action!
78
80
 
79
81
  BUNDLED WITH
80
- 1.15.4
82
+ 2.1.4
data/README.md CHANGED
@@ -107,6 +107,14 @@ params.dog.name #=> "Bailey"
107
107
  params.dog.breed #=> "Shiba Inu"
108
108
  ```
109
109
 
110
+ # Using Transactions
111
+
112
+ By default, SimpleAction via SimpleParams will run the `execute` method inside of an ActiveRecord transaction. You can modify this setting inside an initializer file.
113
+
114
+ ```ruby
115
+ SimpleAction::Service.transaction = false
116
+ ```
117
+
110
118
  # ApiPie Documentation
111
119
 
112
120
  If your project is using [apipie-rails](http://example.com/ "apipie-rails"),
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'rubygems'
2
+ require 'appraisal'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- simple_action (1.6.4)
4
+ simple_action (2.0.3)
5
5
  simple_params
6
6
 
7
7
  GEM
@@ -70,12 +70,12 @@ PLATFORMS
70
70
 
71
71
  DEPENDENCIES
72
72
  appraisal
73
- bundler (~> 1.5)
73
+ bundler (>= 1.5)
74
74
  pry
75
- rake (~> 10.1)
76
- rspec (~> 2.6)
75
+ rake
76
+ rspec (>= 2.6)
77
77
  simple_action!
78
78
  simple_params (>= 1.0, < 2.0)
79
79
 
80
80
  BUNDLED WITH
81
- 1.15.4
81
+ 2.1.4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- simple_action (1.6.4)
4
+ simple_action (2.0.3)
5
5
  simple_params
6
6
 
7
7
  GEM
@@ -68,12 +68,12 @@ PLATFORMS
68
68
 
69
69
  DEPENDENCIES
70
70
  appraisal
71
- bundler (~> 1.5)
71
+ bundler (>= 1.5)
72
72
  pry
73
- rake (~> 10.1)
74
- rspec (~> 2.6)
73
+ rake
74
+ rspec (>= 2.6)
75
75
  simple_action!
76
76
  simple_params (>= 2.0, < 3.0)
77
77
 
78
78
  BUNDLED WITH
79
- 1.15.4
79
+ 2.1.4
@@ -32,9 +32,13 @@ module SimpleAction
32
32
  end
33
33
  end
34
34
 
35
+ def transaction=(bool)
36
+ @@transaction = !!bool
37
+ end
38
+
35
39
  # @return [Boolean]
36
40
  def transaction?
37
- true
41
+ defined?(@@transaction) ? @@transaction : true
38
42
  end
39
43
 
40
44
  # @return [Hash]
@@ -42,4 +46,4 @@ module SimpleAction
42
46
  {}
43
47
  end
44
48
  end
45
- end
49
+ end
@@ -1,3 +1,3 @@
1
1
  module SimpleAction
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.6"
3
3
  end
@@ -18,10 +18,10 @@ 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', '>= 2.0.2'
21
+ spec.add_dependency 'simple_params'
22
22
  spec.add_development_dependency 'appraisal'
23
- spec.add_development_dependency 'bundler', '~> 1.5'
24
- spec.add_development_dependency 'rake', '~> 10.1'
25
- spec.add_development_dependency 'rspec', '~> 2.6'
23
+ spec.add_development_dependency 'bundler', '>= 1.5'
24
+ spec.add_development_dependency 'rake'
25
+ spec.add_development_dependency 'rspec', '>= 2.6'
26
26
  spec.add_development_dependency 'pry'
27
27
  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: 2.0.1
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - brycesenz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-08 00:00:00.000000000 Z
11
+ date: 2021-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_params
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.2
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.2
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: appraisal
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -42,42 +42,42 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.5'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.5'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '10.1'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '10.1'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '2.6'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.6'
83
83
  - !ruby/object:Gem::Dependency
@@ -110,6 +110,7 @@ files:
110
110
  - Gemfile.lock
111
111
  - LICENSE
112
112
  - README.md
113
+ - Rakefile
113
114
  - gemfiles/.bundle/config
114
115
  - gemfiles/simple_params_1.gemfile
115
116
  - gemfiles/simple_params_1.gemfile.lock
@@ -139,7 +140,7 @@ homepage: https://github.com/brycesenz/simple_action
139
140
  licenses:
140
141
  - MIT
141
142
  metadata: {}
142
- post_install_message:
143
+ post_install_message:
143
144
  rdoc_options: []
144
145
  require_paths:
145
146
  - lib
@@ -154,9 +155,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
155
  - !ruby/object:Gem::Version
155
156
  version: '0'
156
157
  requirements: []
157
- rubyforge_project:
158
- rubygems_version: 2.6.11
159
- signing_key:
158
+ rubygems_version: 3.0.0
159
+ signing_key:
160
160
  specification_version: 4
161
161
  summary: A DSL for specifying services objects, including parameters and execution
162
162
  test_files: