subroutine 4.2.0 → 4.5.0

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.
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2015 Mike Nelson
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md DELETED
@@ -1,82 +0,0 @@
1
- # Subroutine
2
-
3
- A gem that provides an interface for creating feature-driven operations. You've probably heard at least one of these terms: "service objects", "form objects", "intentions", or "commands". Subroutine calls these "ops" and really it's just about enabling clear, concise, testable, and meaningful code.
4
-
5
- ## Example
6
-
7
- So you need to sign up a user? or maybe update one's account? or change a password? or maybe you need to sign up a business along with a user, associate them, send an email, and queue a worker in a single request? Not a problem, create an op for any of these use cases. Here's the signup example.
8
-
9
- ```ruby
10
- class SignupOp < ::Subroutine::Op
11
-
12
- string :name
13
- string :email
14
- string :password
15
-
16
- string :company_name
17
-
18
- validates :name, presence: true
19
- validates :email, presence: true
20
- validates :password, presence: true
21
- validates :company_name, presence: true
22
-
23
- outputs :user
24
- outputs :business, type: Business # validate that output type is an instance of Business
25
-
26
- protected
27
-
28
- def perform
29
- u = create_user!
30
- b = create_business!(u)
31
-
32
- deliver_welcome_email(u)
33
-
34
- output :user, u
35
- output :business, b
36
- end
37
-
38
- def create_user!
39
- User.create!(name: name, email: email, password: password)
40
- end
41
-
42
- def create_business!(owner)
43
- Business.create!(company_name: company_name, owner: owner)
44
- end
45
-
46
- def deliver_welcome_email(u)
47
- UserMailer.welcome(u.id).deliver_later
48
- end
49
- end
50
- ```
51
-
52
- ## So why use this?
53
-
54
- - Avoid cluttering models or controllers with logic only applicable to one intention. You also don't need strong parameters because the inputs to the Op are well-defined.
55
- - Test the Op in isolation
56
- - Clear and concise intention in a single file
57
- - Multi-model operations become simple
58
-
59
- ## Continue Reading
60
-
61
- - [Implementing an Op](https://github.com/guideline-tech/subroutine/wiki/Implementing-an-Op)
62
- - [Using an Op](https://github.com/guideline-tech/subroutine/wiki/Using-an-Op)
63
- - [Errors](https://github.com/guideline-tech/subroutine/wiki/Errors)
64
- - [Basic Usage in Rails](https://github.com/guideline-tech/subroutine/wiki/Rails-Usage)
65
-
66
- ## Development
67
-
68
- Run the test suite against current Rails version:
69
-
70
- ```
71
- bundle exec rake test
72
- ```
73
-
74
- Run the test suite against all supported Rails versions using `appraisal`:
75
-
76
- ```
77
- bundle exec appraisal rake test
78
- ```
79
-
80
- For help updating the `Gemfile` or changing supported Rails versions, see the `appraisal` gem [README](https://github.com/thoughtbot/appraisal#usage).
81
-
82
- Note that the gemfiles in `gemfiles/*` are auto-generated by `appraisal` and should not be modified directly.
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require 'rake/testtask'
3
-
4
- Rake::TestTask.new do |t|
5
- t.libs << 'test'
6
- t.pattern = "test/**/*_test.rb"
7
- end
8
-
9
- task :default => [:test]
10
-
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "activemodel", "~> 6.1.0"
7
- gem "actionpack", "~> 6.1.0"
8
-
9
- gemspec path: "../"
@@ -1,98 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- subroutine (4.2.0)
5
- activemodel (>= 6.1)
6
- activesupport (>= 6.1)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actionpack (6.1.7.10)
12
- actionview (= 6.1.7.10)
13
- activesupport (= 6.1.7.10)
14
- rack (~> 2.0, >= 2.0.9)
15
- rack-test (>= 0.6.3)
16
- rails-dom-testing (~> 2.0)
17
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (6.1.7.10)
19
- activesupport (= 6.1.7.10)
20
- builder (~> 3.1)
21
- erubi (~> 1.4)
22
- rails-dom-testing (~> 2.0)
23
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activemodel (6.1.7.10)
25
- activesupport (= 6.1.7.10)
26
- activesupport (6.1.7.10)
27
- concurrent-ruby (~> 1.0, >= 1.0.2)
28
- i18n (>= 1.6, < 2)
29
- minitest (>= 5.1)
30
- tzinfo (~> 2.0)
31
- zeitwerk (~> 2.3)
32
- ansi (1.5.0)
33
- appraisal (2.5.0)
34
- bundler
35
- rake
36
- thor (>= 0.14.0)
37
- builder (3.3.0)
38
- byebug (11.1.3)
39
- concurrent-ruby (1.3.4)
40
- crass (1.0.6)
41
- erubi (1.13.0)
42
- i18n (1.14.6)
43
- concurrent-ruby (~> 1.0)
44
- loofah (2.23.1)
45
- crass (~> 1.0.2)
46
- nokogiri (>= 1.12.0)
47
- m (1.6.2)
48
- method_source (>= 0.6.7)
49
- rake (>= 0.9.2.2)
50
- method_source (1.1.0)
51
- mini_portile2 (2.8.8)
52
- minitest (5.25.4)
53
- minitest-reporters (1.7.1)
54
- ansi
55
- builder
56
- minitest (>= 5.0)
57
- ruby-progressbar
58
- mocha (2.7.1)
59
- ruby2_keywords (>= 0.0.5)
60
- nokogiri (1.17.2)
61
- mini_portile2 (~> 2.8.2)
62
- racc (~> 1.4)
63
- racc (1.8.1)
64
- rack (2.2.10)
65
- rack-test (2.1.0)
66
- rack (>= 1.3)
67
- rails-dom-testing (2.2.0)
68
- activesupport (>= 5.0.0)
69
- minitest
70
- nokogiri (>= 1.6)
71
- rails-html-sanitizer (1.6.2)
72
- loofah (~> 2.21)
73
- nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
74
- rake (13.2.1)
75
- ruby-progressbar (1.13.0)
76
- ruby2_keywords (0.0.5)
77
- thor (1.3.2)
78
- tzinfo (2.0.6)
79
- concurrent-ruby (~> 1.0)
80
- zeitwerk (2.7.1)
81
-
82
- PLATFORMS
83
- ruby
84
-
85
- DEPENDENCIES
86
- actionpack (~> 6.1.0)
87
- activemodel (~> 6.1.0)
88
- appraisal
89
- byebug
90
- m
91
- minitest
92
- minitest-reporters
93
- mocha
94
- rake
95
- subroutine!
96
-
97
- BUNDLED WITH
98
- 2.5.22
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "activemodel", "~> 7.0.0"
7
- gem "actionpack", "~> 7.0.0"
8
-
9
- gemspec path: "../"
@@ -1,96 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- subroutine (4.2.0)
5
- activemodel (>= 6.1)
6
- activesupport (>= 6.1)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actionpack (7.0.8.7)
12
- actionview (= 7.0.8.7)
13
- activesupport (= 7.0.8.7)
14
- rack (~> 2.0, >= 2.2.4)
15
- rack-test (>= 0.6.3)
16
- rails-dom-testing (~> 2.0)
17
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (7.0.8.7)
19
- activesupport (= 7.0.8.7)
20
- builder (~> 3.1)
21
- erubi (~> 1.4)
22
- rails-dom-testing (~> 2.0)
23
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activemodel (7.0.8.7)
25
- activesupport (= 7.0.8.7)
26
- activesupport (7.0.8.7)
27
- concurrent-ruby (~> 1.0, >= 1.0.2)
28
- i18n (>= 1.6, < 2)
29
- minitest (>= 5.1)
30
- tzinfo (~> 2.0)
31
- ansi (1.5.0)
32
- appraisal (2.5.0)
33
- bundler
34
- rake
35
- thor (>= 0.14.0)
36
- builder (3.3.0)
37
- byebug (11.1.3)
38
- concurrent-ruby (1.3.4)
39
- crass (1.0.6)
40
- erubi (1.13.0)
41
- i18n (1.14.6)
42
- concurrent-ruby (~> 1.0)
43
- loofah (2.23.1)
44
- crass (~> 1.0.2)
45
- nokogiri (>= 1.12.0)
46
- m (1.6.2)
47
- method_source (>= 0.6.7)
48
- rake (>= 0.9.2.2)
49
- method_source (1.1.0)
50
- mini_portile2 (2.8.8)
51
- minitest (5.25.4)
52
- minitest-reporters (1.7.1)
53
- ansi
54
- builder
55
- minitest (>= 5.0)
56
- ruby-progressbar
57
- mocha (2.7.1)
58
- ruby2_keywords (>= 0.0.5)
59
- nokogiri (1.17.2)
60
- mini_portile2 (~> 2.8.2)
61
- racc (~> 1.4)
62
- racc (1.8.1)
63
- rack (2.2.10)
64
- rack-test (2.1.0)
65
- rack (>= 1.3)
66
- rails-dom-testing (2.2.0)
67
- activesupport (>= 5.0.0)
68
- minitest
69
- nokogiri (>= 1.6)
70
- rails-html-sanitizer (1.6.2)
71
- loofah (~> 2.21)
72
- nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
73
- rake (13.2.1)
74
- ruby-progressbar (1.13.0)
75
- ruby2_keywords (0.0.5)
76
- thor (1.3.2)
77
- tzinfo (2.0.6)
78
- concurrent-ruby (~> 1.0)
79
-
80
- PLATFORMS
81
- ruby
82
-
83
- DEPENDENCIES
84
- actionpack (~> 7.0.0)
85
- activemodel (~> 7.0.0)
86
- appraisal
87
- byebug
88
- m
89
- minitest
90
- minitest-reporters
91
- mocha
92
- rake
93
- subroutine!
94
-
95
- BUNDLED WITH
96
- 2.5.22
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "activemodel", "~> 7.1.0"
7
- gem "actionpack", "~> 7.1.0"
8
-
9
- gemspec path: "../"
@@ -1,115 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- subroutine (4.2.0)
5
- activemodel (>= 6.1)
6
- activesupport (>= 6.1)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actionpack (7.1.5.1)
12
- actionview (= 7.1.5.1)
13
- activesupport (= 7.1.5.1)
14
- nokogiri (>= 1.8.5)
15
- racc
16
- rack (>= 2.2.4)
17
- rack-session (>= 1.0.1)
18
- rack-test (>= 0.6.3)
19
- rails-dom-testing (~> 2.2)
20
- rails-html-sanitizer (~> 1.6)
21
- actionview (7.1.5.1)
22
- activesupport (= 7.1.5.1)
23
- builder (~> 3.1)
24
- erubi (~> 1.11)
25
- rails-dom-testing (~> 2.2)
26
- rails-html-sanitizer (~> 1.6)
27
- activemodel (7.1.5.1)
28
- activesupport (= 7.1.5.1)
29
- activesupport (7.1.5.1)
30
- base64
31
- benchmark (>= 0.3)
32
- bigdecimal
33
- concurrent-ruby (~> 1.0, >= 1.0.2)
34
- connection_pool (>= 2.2.5)
35
- drb
36
- i18n (>= 1.6, < 2)
37
- logger (>= 1.4.2)
38
- minitest (>= 5.1)
39
- mutex_m
40
- securerandom (>= 0.3)
41
- tzinfo (~> 2.0)
42
- ansi (1.5.0)
43
- appraisal (2.5.0)
44
- bundler
45
- rake
46
- thor (>= 0.14.0)
47
- base64 (0.2.0)
48
- benchmark (0.4.0)
49
- bigdecimal (3.1.8)
50
- builder (3.3.0)
51
- byebug (11.1.3)
52
- concurrent-ruby (1.3.4)
53
- connection_pool (2.4.1)
54
- crass (1.0.6)
55
- drb (2.2.1)
56
- erubi (1.13.0)
57
- i18n (1.14.6)
58
- concurrent-ruby (~> 1.0)
59
- logger (1.6.3)
60
- loofah (2.23.1)
61
- crass (~> 1.0.2)
62
- nokogiri (>= 1.12.0)
63
- m (1.6.2)
64
- method_source (>= 0.6.7)
65
- rake (>= 0.9.2.2)
66
- method_source (1.1.0)
67
- minitest (5.25.4)
68
- minitest-reporters (1.7.1)
69
- ansi
70
- builder
71
- minitest (>= 5.0)
72
- ruby-progressbar
73
- mocha (2.7.1)
74
- ruby2_keywords (>= 0.0.5)
75
- mutex_m (0.3.0)
76
- nokogiri (1.17.2-arm64-darwin)
77
- racc (~> 1.4)
78
- racc (1.8.1)
79
- rack (3.1.8)
80
- rack-session (2.0.0)
81
- rack (>= 3.0.0)
82
- rack-test (2.1.0)
83
- rack (>= 1.3)
84
- rails-dom-testing (2.2.0)
85
- activesupport (>= 5.0.0)
86
- minitest
87
- nokogiri (>= 1.6)
88
- rails-html-sanitizer (1.6.2)
89
- loofah (~> 2.21)
90
- nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
91
- rake (13.2.1)
92
- ruby-progressbar (1.13.0)
93
- ruby2_keywords (0.0.5)
94
- securerandom (0.4.0)
95
- thor (1.3.2)
96
- tzinfo (2.0.6)
97
- concurrent-ruby (~> 1.0)
98
-
99
- PLATFORMS
100
- arm64-darwin
101
-
102
- DEPENDENCIES
103
- actionpack (~> 7.1.0)
104
- activemodel (~> 7.1.0)
105
- appraisal
106
- byebug
107
- m
108
- minitest
109
- minitest-reporters
110
- mocha
111
- rake
112
- subroutine!
113
-
114
- BUNDLED WITH
115
- 2.5.22
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "activemodel", "~> 7.2.0"
7
- gem "actionpack", "~> 7.2.0"
8
-
9
- gemspec path: "../"
@@ -1,115 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- subroutine (4.2.0)
5
- activemodel (>= 6.1)
6
- activesupport (>= 6.1)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actionpack (7.2.2.1)
12
- actionview (= 7.2.2.1)
13
- activesupport (= 7.2.2.1)
14
- nokogiri (>= 1.8.5)
15
- racc
16
- rack (>= 2.2.4, < 3.2)
17
- rack-session (>= 1.0.1)
18
- rack-test (>= 0.6.3)
19
- rails-dom-testing (~> 2.2)
20
- rails-html-sanitizer (~> 1.6)
21
- useragent (~> 0.16)
22
- actionview (7.2.2.1)
23
- activesupport (= 7.2.2.1)
24
- builder (~> 3.1)
25
- erubi (~> 1.11)
26
- rails-dom-testing (~> 2.2)
27
- rails-html-sanitizer (~> 1.6)
28
- activemodel (7.2.2.1)
29
- activesupport (= 7.2.2.1)
30
- activesupport (7.2.2.1)
31
- base64
32
- benchmark (>= 0.3)
33
- bigdecimal
34
- concurrent-ruby (~> 1.0, >= 1.3.1)
35
- connection_pool (>= 2.2.5)
36
- drb
37
- i18n (>= 1.6, < 2)
38
- logger (>= 1.4.2)
39
- minitest (>= 5.1)
40
- securerandom (>= 0.3)
41
- tzinfo (~> 2.0, >= 2.0.5)
42
- ansi (1.5.0)
43
- appraisal (2.5.0)
44
- bundler
45
- rake
46
- thor (>= 0.14.0)
47
- base64 (0.2.0)
48
- benchmark (0.4.0)
49
- bigdecimal (3.1.8)
50
- builder (3.3.0)
51
- byebug (11.1.3)
52
- concurrent-ruby (1.3.4)
53
- connection_pool (2.4.1)
54
- crass (1.0.6)
55
- drb (2.2.1)
56
- erubi (1.13.0)
57
- i18n (1.14.6)
58
- concurrent-ruby (~> 1.0)
59
- logger (1.6.3)
60
- loofah (2.23.1)
61
- crass (~> 1.0.2)
62
- nokogiri (>= 1.12.0)
63
- m (1.6.2)
64
- method_source (>= 0.6.7)
65
- rake (>= 0.9.2.2)
66
- method_source (1.1.0)
67
- minitest (5.25.4)
68
- minitest-reporters (1.7.1)
69
- ansi
70
- builder
71
- minitest (>= 5.0)
72
- ruby-progressbar
73
- mocha (2.7.1)
74
- ruby2_keywords (>= 0.0.5)
75
- nokogiri (1.17.2-arm64-darwin)
76
- racc (~> 1.4)
77
- racc (1.8.1)
78
- rack (3.1.8)
79
- rack-session (2.0.0)
80
- rack (>= 3.0.0)
81
- rack-test (2.1.0)
82
- rack (>= 1.3)
83
- rails-dom-testing (2.2.0)
84
- activesupport (>= 5.0.0)
85
- minitest
86
- nokogiri (>= 1.6)
87
- rails-html-sanitizer (1.6.2)
88
- loofah (~> 2.21)
89
- nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
90
- rake (13.2.1)
91
- ruby-progressbar (1.13.0)
92
- ruby2_keywords (0.0.5)
93
- securerandom (0.4.0)
94
- thor (1.3.2)
95
- tzinfo (2.0.6)
96
- concurrent-ruby (~> 1.0)
97
- useragent (0.16.11)
98
-
99
- PLATFORMS
100
- arm64-darwin
101
-
102
- DEPENDENCIES
103
- actionpack (~> 7.2.0)
104
- activemodel (~> 7.2.0)
105
- appraisal
106
- byebug
107
- m
108
- minitest
109
- minitest-reporters
110
- mocha
111
- rake
112
- subroutine!
113
-
114
- BUNDLED WITH
115
- 2.5.22