much-rails 0.0.1 → 0.2.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.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/lib/much-rails.rb +85 -0
  4. data/lib/much-rails/action.rb +415 -0
  5. data/lib/much-rails/action/base_command_result.rb +22 -0
  6. data/lib/much-rails/action/base_result.rb +14 -0
  7. data/lib/much-rails/action/base_router.rb +474 -0
  8. data/lib/much-rails/action/controller.rb +100 -0
  9. data/lib/much-rails/action/head_result.rb +18 -0
  10. data/lib/much-rails/action/redirect_to_result.rb +18 -0
  11. data/lib/much-rails/action/render_result.rb +25 -0
  12. data/lib/much-rails/action/router.rb +101 -0
  13. data/lib/much-rails/action/send_data_result.rb +18 -0
  14. data/lib/much-rails/action/send_file_result.rb +18 -0
  15. data/lib/much-rails/action/unprocessable_entity_result.rb +37 -0
  16. data/lib/much-rails/assets.rb +54 -0
  17. data/lib/much-rails/boolean.rb +7 -0
  18. data/lib/much-rails/call_method.rb +27 -0
  19. data/lib/much-rails/call_method_callbacks.rb +122 -0
  20. data/lib/much-rails/change_action.rb +83 -0
  21. data/lib/much-rails/change_action_result.rb +59 -0
  22. data/lib/much-rails/config.rb +55 -0
  23. data/lib/much-rails/date.rb +50 -0
  24. data/lib/much-rails/decimal.rb +7 -0
  25. data/lib/much-rails/destroy_action.rb +32 -0
  26. data/lib/much-rails/destroy_service.rb +67 -0
  27. data/lib/much-rails/has_slug.rb +7 -0
  28. data/lib/much-rails/input_value.rb +19 -0
  29. data/lib/much-rails/json.rb +29 -0
  30. data/lib/much-rails/layout.rb +142 -0
  31. data/lib/much-rails/layout/helper.rb +25 -0
  32. data/lib/much-rails/mixin.rb +7 -0
  33. data/lib/much-rails/not_given.rb +7 -0
  34. data/lib/much-rails/rails_routes.rb +29 -0
  35. data/lib/much-rails/railtie.rb +39 -0
  36. data/lib/much-rails/records.rb +5 -0
  37. data/lib/much-rails/records/always_destroyable.rb +30 -0
  38. data/lib/much-rails/records/not_destroyable.rb +30 -0
  39. data/lib/much-rails/records/validate_destroy.rb +92 -0
  40. data/lib/much-rails/result.rb +7 -0
  41. data/lib/much-rails/save_action.rb +32 -0
  42. data/lib/much-rails/save_service.rb +68 -0
  43. data/lib/much-rails/service.rb +18 -0
  44. data/lib/much-rails/service_validation_errors.rb +41 -0
  45. data/lib/much-rails/time.rb +28 -0
  46. data/lib/much-rails/version.rb +3 -1
  47. data/lib/much-rails/view_models.rb +3 -0
  48. data/lib/much-rails/view_models/breadcrumb.rb +11 -0
  49. data/lib/much-rails/wrap_and_call_method.rb +41 -0
  50. data/lib/much-rails/wrap_method.rb +45 -0
  51. data/much-rails.gemspec +20 -4
  52. data/test/helper.rb +20 -2
  53. data/test/support/actions/show.rb +11 -0
  54. data/test/support/config/routes/test.rb +3 -0
  55. data/test/support/factory.rb +2 -0
  56. data/test/support/fake_action_controller.rb +63 -0
  57. data/test/unit/action/base_command_result_tests.rb +43 -0
  58. data/test/unit/action/base_result_tests.rb +22 -0
  59. data/test/unit/action/base_router_tests.rb +530 -0
  60. data/test/unit/action/controller_tests.rb +110 -0
  61. data/test/unit/action/head_result_tests.rb +24 -0
  62. data/test/unit/action/redirect_to_result_tests.rb +24 -0
  63. data/test/unit/action/render_result_tests.rb +43 -0
  64. data/test/unit/action/router_tests.rb +252 -0
  65. data/test/unit/action/send_data_result_tests.rb +24 -0
  66. data/test/unit/action/send_file_result_tests.rb +24 -0
  67. data/test/unit/action/unprocessable_entity_result_tests.rb +51 -0
  68. data/test/unit/action_tests.rb +400 -0
  69. data/test/unit/assets_tests.rb +127 -0
  70. data/test/unit/boolean_tests.rb +17 -0
  71. data/test/unit/call_method_callbacks_tests.rb +176 -0
  72. data/test/unit/call_method_tests.rb +62 -0
  73. data/test/unit/change_action_result_tests.rb +113 -0
  74. data/test/unit/change_action_tests.rb +260 -0
  75. data/test/unit/config_tests.rb +68 -0
  76. data/test/unit/date_tests.rb +55 -0
  77. data/test/unit/decimal_tests.rb +17 -0
  78. data/test/unit/destroy_action_tests.rb +83 -0
  79. data/test/unit/destroy_service_tests.rb +238 -0
  80. data/test/unit/has_slug_tests.rb +17 -0
  81. data/test/unit/input_value_tests.rb +34 -0
  82. data/test/unit/json_tests.rb +55 -0
  83. data/test/unit/layout_tests.rb +155 -0
  84. data/test/unit/mixin_tests.rb +17 -0
  85. data/test/unit/much-rails_tests.rb +82 -4
  86. data/test/unit/not_given_tests.rb +17 -0
  87. data/test/unit/rails_routes_tests.rb +28 -0
  88. data/test/unit/records/always_destroyable_tests.rb +43 -0
  89. data/test/unit/records/not_destroyable_tests.rb +40 -0
  90. data/test/unit/records/validate_destroy_tests.rb +252 -0
  91. data/test/unit/result_tests.rb +17 -0
  92. data/test/unit/save_action_tests.rb +83 -0
  93. data/test/unit/save_service_tests.rb +264 -0
  94. data/test/unit/service_tests.rb +33 -0
  95. data/test/unit/service_validation_errors_tests.rb +107 -0
  96. data/test/unit/time_tests.rb +58 -0
  97. data/test/unit/view_models/breadcrumb_tests.rb +53 -0
  98. data/test/unit/wrap_and_call_method_tests.rb +163 -0
  99. data/test/unit/wrap_method_tests.rb +112 -0
  100. metadata +356 -7
  101. data/test/unit/.keep +0 -0
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "assert"
4
+ require "much-rails/time"
5
+
6
+ module MuchRails::Time
7
+ class UnitTests < Assert::Context
8
+ desc "MuchRails::Time"
9
+ subject{ unit_class }
10
+
11
+ let(:unit_class){ MuchRails::Time }
12
+
13
+ let(:time){ Time.current }
14
+ let(:utc_time){ time.utc }
15
+
16
+ should have_imeths :for
17
+
18
+ should "know how to convert time-like representations to Time" do
19
+ # nil, blank value(s)
20
+ assert_that(subject.for(nil)).is_nil
21
+ ["", " "].each do |object|
22
+ assert_that(subject.for(object)).is_nil
23
+ end
24
+
25
+ assert_equal 1, 1
26
+
27
+ # Time, DateTime, or Date
28
+ objects =
29
+ [
30
+ Time.current,
31
+ DateTime.current, # rubocop:disable Style/DateTime
32
+ Date.today,
33
+ ]
34
+ objects.each do |object|
35
+ assert_that(subject.for(object)).equals(object.to_time)
36
+ end
37
+
38
+ # U.S.-formatted String
39
+ result = subject.for(time.iso8601)
40
+
41
+ assert_that(result).is_instance_of(Time)
42
+ assert_that(result.utc?).is_true
43
+ assert_that(result.year).equals(utc_time.year)
44
+ assert_that(result.month).equals(utc_time.month)
45
+ assert_that(result.day).equals(utc_time.day)
46
+ assert_that(result.hour).equals(utc_time.hour)
47
+ assert_that(result.min).equals(utc_time.min)
48
+ assert_that(result.sec).equals(utc_time.sec)
49
+
50
+ # invalid values
51
+ invalid_objects = ["TEST_VALUE", 42, Class.new]
52
+ invalid_objects.each do |object|
53
+ assert_that(->{ subject.for(object) })
54
+ .raises(MuchRails::Time::InvalidError)
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "assert"
4
+ require "much-rails/view_models/breadcrumb"
5
+
6
+ class MuchRails::ViewModels::Breadcrumb
7
+ class UnitTests < Assert::Context
8
+ desc "MuchRails::ViewModels::Breadcrumb"
9
+ subject{ unit_class }
10
+
11
+ let(:unit_class){ MuchRails::ViewModels::Breadcrumb }
12
+ end
13
+
14
+ class InitTests < UnitTests
15
+ desc "when init"
16
+ subject{ unit_class.new }
17
+
18
+ let(:name){ "name" }
19
+ let(:url){ "url" }
20
+
21
+ should have_readers :name, :url
22
+
23
+ should have_imeths :render_as_link?
24
+
25
+ should "know its name" do
26
+ assert_that(subject.name).is_nil
27
+
28
+ result = unit_class.new(name)
29
+ assert_that(result.name).equals(name)
30
+
31
+ result = unit_class.new(name, url)
32
+ assert_that(result.name).equals(name)
33
+ end
34
+
35
+ should "know its url" do
36
+ assert_that(subject.url).is_nil
37
+
38
+ result = unit_class.new(name)
39
+ assert_that(result.url).is_nil
40
+
41
+ result = unit_class.new(name, url)
42
+ assert_that(result.url).equals(url)
43
+ end
44
+
45
+ should "know if it should render as link" do
46
+ result = unit_class.new(name, url)
47
+ assert_that(result.render_as_link?).is_true
48
+
49
+ result = unit_class.new(name)
50
+ assert_that(result.render_as_link?).is_false
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,163 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "assert"
4
+ require "much-rails/wrap_and_call_method"
5
+
6
+ module MuchRails::WrapAndCallMethod
7
+ class UnitTests < Assert::Context
8
+ desc "MuchRails::WrapAndCallMethod"
9
+ subject{ unit_class }
10
+
11
+ let(:unit_class){ MuchRails::WrapAndCallMethod }
12
+
13
+ should "include MuchRails::Mixin" do
14
+ assert_that(subject).includes(MuchRails::Mixin)
15
+ end
16
+ end
17
+
18
+ class ReceiverTests < UnitTests
19
+ desc "receiver"
20
+ subject{ receiver_class }
21
+
22
+ let(:receiver_class) do
23
+ Class.new do
24
+ include MuchRails::WrapAndCallMethod
25
+
26
+ attr_reader :object, :object_kargs, :call_called
27
+
28
+ def initialize(object, **object_kargs)
29
+ @object = object
30
+ @object_kargs = object_kargs
31
+ end
32
+
33
+ def call
34
+ @call_called = true
35
+ MuchRails::Result.success(name: object.name)
36
+ end
37
+ end
38
+ end
39
+
40
+ let(:objects){ [object1, object2] }
41
+ let(:object1){ OpenStruct.new(name: "OBJECT1") }
42
+ let(:object2){ OpenStruct.new(name: "OBJECT2") }
43
+
44
+ let(:object_kargs) do
45
+ {
46
+ test_key1: 1,
47
+ test_key2: 2,
48
+ }
49
+ end
50
+
51
+ should have_imeths :wrap_and_call, :wrap_and_map_call
52
+ should have_imeths :wrap_and_capture_call, :wrap_and_capture_call!
53
+
54
+ should "be configured as expected" do
55
+ assert_that(subject).includes(MuchRails::CallMethod)
56
+ assert_that(subject).includes(MuchRails::WrapMethod)
57
+ end
58
+ end
59
+
60
+ class WrapAndCallTests < ReceiverTests
61
+ desc "wrap and call"
62
+ subject{ receiver_class }
63
+
64
+ should "wrap and call its objects and return the wrapped objects" do
65
+ wrapped_objects = subject.wrap_and_call(objects, **object_kargs)
66
+
67
+ assert_that(wrapped_objects.size).equals(objects.size)
68
+ wrapped_objects.each_with_index do |wrapped_object, index|
69
+ assert_that(wrapped_object).is_instance_of(subject)
70
+ assert_that(wrapped_object.object).equals(objects[index])
71
+ assert_that(wrapped_object.object_kargs).equals(object_kargs)
72
+ assert_that(wrapped_object.call_called).is_true
73
+ end
74
+ end
75
+ end
76
+
77
+ class WrapAndMapCallTests < ReceiverTests
78
+ desc "wrap and map call"
79
+ subject{ receiver_class }
80
+
81
+ should "wrap and call its object and return each call's return value" do
82
+ wrapped_objects = subject.wrap_and_call(objects, **object_kargs)
83
+ call_results = subject.wrap_and_map_call(objects, **object_kargs)
84
+
85
+ assert_that(call_results.size).equals(objects.size)
86
+ call_results.each_with_index do |result, index|
87
+ assert_that(result.name).equals(wrapped_objects[index].call.name)
88
+ end
89
+ end
90
+ end
91
+
92
+ class WrapAndCaptureCallTests < ReceiverTests
93
+ desc "wrap and capture call"
94
+ subject{ receiver_class }
95
+
96
+ setup do
97
+ Assert.stub(MuchRails::Result, :tap) do |&block|
98
+ block.call(tapped_result1)
99
+ end
100
+ Assert.stub_tap_on_call(tapped_result1, :capture_for_all) do |_, call|
101
+ @capture_for_all_call = call
102
+ end
103
+ end
104
+
105
+ let(:tapped_result1){ MuchRails::Result.success }
106
+
107
+ should "wrap and call its objects and capture each return value as a "\
108
+ "sub-result in a given MuchRails::Result" do
109
+ wrapped_objects = subject.wrap_and_call(objects, **object_kargs)
110
+
111
+ MuchRails::Result.tap do |result|
112
+ subject.wrap_and_capture_call(
113
+ objects,
114
+ capturing_result: result,
115
+ **object_kargs,
116
+ )
117
+ end
118
+
119
+ assert_that(tapped_result1.sub_results.size).equals(objects.size)
120
+ tapped_result1.sub_results.each_with_index do |sub_result, index|
121
+ assert_that(sub_result.name).equals(wrapped_objects[index].call.name)
122
+ end
123
+ assert_that(@capture_for_all_call.args)
124
+ .equals([tapped_result1.sub_results])
125
+ end
126
+ end
127
+
128
+ class WrapAndCaptureCallBangTests < ReceiverTests
129
+ desc "wrap and capture call bang"
130
+ subject{ receiver_class }
131
+
132
+ setup do
133
+ Assert.stub(MuchRails::Result, :tap) do |&block|
134
+ block.call(tapped_result1)
135
+ end
136
+ Assert.stub_tap_on_call(tapped_result1, :capture_for_all!) do |_, call|
137
+ @capture_for_all_bang_call = call
138
+ end
139
+ end
140
+
141
+ let(:tapped_result1){ MuchRails::Result.success }
142
+
143
+ should "wrap and call its objects and capture each return value as a "\
144
+ "sub-result in a given MuchRails::Result" do
145
+ wrapped_objects = subject.wrap_and_call(objects, **object_kargs)
146
+
147
+ MuchRails::Result.tap do |result|
148
+ subject.wrap_and_capture_call!(
149
+ objects,
150
+ capturing_result: result,
151
+ **object_kargs,
152
+ )
153
+ end
154
+
155
+ assert_that(tapped_result1.sub_results.size).equals(objects.size)
156
+ tapped_result1.sub_results.each_with_index do |sub_result, index|
157
+ assert_that(sub_result.name).equals(wrapped_objects[index].call.name)
158
+ end
159
+ assert_that(@capture_for_all_bang_call.args)
160
+ .equals([tapped_result1.sub_results])
161
+ end
162
+ end
163
+ end
@@ -0,0 +1,112 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "assert"
4
+ require "much-rails/wrap_method"
5
+
6
+ module MuchRails::WrapMethod
7
+ class UnitTests < Assert::Context
8
+ desc "MuchRails::WrapMethod"
9
+ subject{ unit_class }
10
+
11
+ let(:unit_class){ MuchRails::WrapMethod }
12
+
13
+ should "include MuchRails::Mixin" do
14
+ assert_that(subject).includes(MuchRails::Mixin)
15
+ end
16
+ end
17
+
18
+ class ReceiverTests < UnitTests
19
+ desc "receiver"
20
+ subject{ receiver_class }
21
+
22
+ let(:receiver_class) do
23
+ Class.new do
24
+ include MuchRails::WrapMethod
25
+
26
+ attr_reader :object, :object_kargs
27
+
28
+ def initialize(object, **object_kargs)
29
+ @object = object
30
+ @object_kargs = object_kargs
31
+ end
32
+
33
+ def self.build(object, **object_kargs)
34
+ new(object, initializer_method: :build, **object_kargs)
35
+ end
36
+ end
37
+ end
38
+
39
+ let(:objects){ [object1, object2] }
40
+ let(:object1){ OpenStruct.new(name: "OBJECT1") }
41
+ let(:object2){ OpenStruct.new(name: "OBJECT2") }
42
+
43
+ let(:object_kargs) do
44
+ {
45
+ test_key1: 1,
46
+ test_key2: 2,
47
+ }
48
+ end
49
+
50
+ should have_imeths :wrap, :wrap_with_index, :wrap_initializer_method
51
+ end
52
+
53
+ class WrapAndWrapWithIndexTests < ReceiverTests
54
+ desc "wrap and wrap with index"
55
+ subject{ receiver_class }
56
+
57
+ should "call new for each given object" do
58
+ wrapped_objects = subject.wrap(objects, **object_kargs)
59
+
60
+ assert_that(wrapped_objects.size).equals(objects.size)
61
+ wrapped_objects.each_with_index do |wrapped_object, index|
62
+ assert_that(wrapped_object).is_instance_of(subject)
63
+ assert_that(wrapped_object.object).equals(objects[index])
64
+ assert_that(wrapped_object.object_kargs).equals(object_kargs)
65
+ end
66
+
67
+ wrapped_objects = subject.wrap_with_index(objects, **object_kargs)
68
+
69
+ assert_that(wrapped_objects.size).equals(objects.size)
70
+ wrapped_objects.each_with_index do |wrapped_object, index|
71
+ assert_that(wrapped_object).is_instance_of(subject)
72
+ assert_that(wrapped_object.object).equals(objects[index])
73
+ assert_that(wrapped_object.object_kargs)
74
+ .equals(object_kargs.update(index: index))
75
+ end
76
+ end
77
+ end
78
+
79
+ class CustomWrapInitializerMethodTests < ReceiverTests
80
+ desc "with a custom wrap initializer method"
81
+ subject{ receiver_class }
82
+
83
+ setup do
84
+ receiver_class.wrap_initializer_method(:build)
85
+ end
86
+
87
+ should "call the custom method for each given object" do
88
+ wrapped_objects = subject.wrap(objects, **object_kargs)
89
+
90
+ assert_that(wrapped_objects.size).equals(objects.size)
91
+ wrapped_objects.each_with_index do |wrapped_object, index|
92
+ assert_that(wrapped_object).is_instance_of(subject)
93
+ assert_that(wrapped_object.object).equals(objects[index])
94
+ assert_that(wrapped_object.object_kargs)
95
+ .equals(object_kargs.merge(initializer_method: :build))
96
+ end
97
+ end
98
+ end
99
+
100
+ class WrapMethodConfigTests < ReceiverTests
101
+ desc "receiver_class::WrapMethodConfig"
102
+ subject{ config_class.new }
103
+
104
+ let(:config_class){ receiver_class::WrapMethodConfig }
105
+
106
+ should have_accessors :wrap_initializer_method
107
+
108
+ should "know its attribute values" do
109
+ assert_that(subject.wrap_initializer_method).equals(:new)
110
+ end
111
+ end
112
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: much-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Redding
@@ -9,22 +9,236 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-12-14 00:00:00.000000000 Z
12
+ date: 2021-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: much-style-guide
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: 0.6.0
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: 0.6.0
14
28
  - !ruby/object:Gem::Dependency
15
29
  name: assert
16
30
  requirement: !ruby/object:Gem::Requirement
17
31
  requirements:
18
32
  - - "~>"
19
33
  - !ruby/object:Gem::Version
20
- version: 2.18.4
34
+ version: 2.19.5
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: 2.19.5
42
+ - !ruby/object:Gem::Dependency
43
+ name: rails
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">"
47
+ - !ruby/object:Gem::Version
48
+ version: '5.0'
49
+ - - "<"
50
+ - !ruby/object:Gem::Version
51
+ version: '7.0'
21
52
  type: :development
22
53
  prerelease: false
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">"
57
+ - !ruby/object:Gem::Version
58
+ version: '5.0'
59
+ - - "<"
60
+ - !ruby/object:Gem::Version
61
+ version: '7.0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: activerecord
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">"
67
+ - !ruby/object:Gem::Version
68
+ version: '5.0'
69
+ - - "<"
70
+ - !ruby/object:Gem::Version
71
+ version: '7.0'
72
+ type: :runtime
73
+ prerelease: false
74
+ version_requirements: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">"
77
+ - !ruby/object:Gem::Version
78
+ version: '5.0'
79
+ - - "<"
80
+ - !ruby/object:Gem::Version
81
+ version: '7.0'
82
+ - !ruby/object:Gem::Dependency
83
+ name: activesupport
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">"
87
+ - !ruby/object:Gem::Version
88
+ version: '5.0'
89
+ - - "<"
90
+ - !ruby/object:Gem::Version
91
+ version: '7.0'
92
+ type: :runtime
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">"
97
+ - !ruby/object:Gem::Version
98
+ version: '5.0'
99
+ - - "<"
100
+ - !ruby/object:Gem::Version
101
+ version: '7.0'
102
+ - !ruby/object:Gem::Dependency
103
+ name: dassets
104
+ requirement: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - "~>"
107
+ - !ruby/object:Gem::Version
108
+ version: 0.15.1
109
+ type: :runtime
110
+ prerelease: false
111
+ version_requirements: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: 0.15.1
116
+ - !ruby/object:Gem::Dependency
117
+ name: dassets-erubi
118
+ requirement: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - "~>"
121
+ - !ruby/object:Gem::Version
122
+ version: 0.1.1
123
+ type: :runtime
124
+ prerelease: false
125
+ version_requirements: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: 0.1.1
130
+ - !ruby/object:Gem::Dependency
131
+ name: dassets-sass
132
+ requirement: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - "~>"
135
+ - !ruby/object:Gem::Version
136
+ version: 0.5.1
137
+ type: :runtime
138
+ prerelease: false
139
+ version_requirements: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - "~>"
142
+ - !ruby/object:Gem::Version
143
+ version: 0.5.1
144
+ - !ruby/object:Gem::Dependency
145
+ name: much-boolean
146
+ requirement: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - "~>"
149
+ - !ruby/object:Gem::Version
150
+ version: 0.2.1
151
+ type: :runtime
152
+ prerelease: false
153
+ version_requirements: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - "~>"
156
+ - !ruby/object:Gem::Version
157
+ version: 0.2.1
158
+ - !ruby/object:Gem::Dependency
159
+ name: much-decimal
160
+ requirement: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - "~>"
163
+ - !ruby/object:Gem::Version
164
+ version: 0.1.3
165
+ type: :runtime
166
+ prerelease: false
167
+ version_requirements: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - "~>"
170
+ - !ruby/object:Gem::Version
171
+ version: 0.1.3
172
+ - !ruby/object:Gem::Dependency
173
+ name: much-mixin
174
+ requirement: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - "~>"
177
+ - !ruby/object:Gem::Version
178
+ version: 0.2.4
179
+ type: :runtime
180
+ prerelease: false
181
+ version_requirements: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - "~>"
184
+ - !ruby/object:Gem::Version
185
+ version: 0.2.4
186
+ - !ruby/object:Gem::Dependency
187
+ name: much-not-given
188
+ requirement: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - "~>"
191
+ - !ruby/object:Gem::Version
192
+ version: 0.1.2
193
+ type: :runtime
194
+ prerelease: false
195
+ version_requirements: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - "~>"
198
+ - !ruby/object:Gem::Version
199
+ version: 0.1.2
200
+ - !ruby/object:Gem::Dependency
201
+ name: much-result
202
+ requirement: !ruby/object:Gem::Requirement
203
+ requirements:
204
+ - - "~>"
205
+ - !ruby/object:Gem::Version
206
+ version: 0.1.3
207
+ type: :runtime
208
+ prerelease: false
209
+ version_requirements: !ruby/object:Gem::Requirement
210
+ requirements:
211
+ - - "~>"
212
+ - !ruby/object:Gem::Version
213
+ version: 0.1.3
214
+ - !ruby/object:Gem::Dependency
215
+ name: much-slug
216
+ requirement: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - "~>"
219
+ - !ruby/object:Gem::Version
220
+ version: 0.1.1
221
+ type: :runtime
222
+ prerelease: false
223
+ version_requirements: !ruby/object:Gem::Requirement
224
+ requirements:
225
+ - - "~>"
226
+ - !ruby/object:Gem::Version
227
+ version: 0.1.1
228
+ - !ruby/object:Gem::Dependency
229
+ name: oj
230
+ requirement: !ruby/object:Gem::Requirement
231
+ requirements:
232
+ - - "~>"
233
+ - !ruby/object:Gem::Version
234
+ version: '3.10'
235
+ type: :runtime
236
+ prerelease: false
23
237
  version_requirements: !ruby/object:Gem::Requirement
24
238
  requirements:
25
239
  - - "~>"
26
240
  - !ruby/object:Gem::Version
27
- version: 2.18.4
241
+ version: '3.10'
28
242
  description: Rails utilities.
29
243
  email:
30
244
  - kelly@kellyredding.com
@@ -37,14 +251,104 @@ files:
37
251
  - LICENSE
38
252
  - README.md
39
253
  - lib/much-rails.rb
254
+ - lib/much-rails/action.rb
255
+ - lib/much-rails/action/base_command_result.rb
256
+ - lib/much-rails/action/base_result.rb
257
+ - lib/much-rails/action/base_router.rb
258
+ - lib/much-rails/action/controller.rb
259
+ - lib/much-rails/action/head_result.rb
260
+ - lib/much-rails/action/redirect_to_result.rb
261
+ - lib/much-rails/action/render_result.rb
262
+ - lib/much-rails/action/router.rb
263
+ - lib/much-rails/action/send_data_result.rb
264
+ - lib/much-rails/action/send_file_result.rb
265
+ - lib/much-rails/action/unprocessable_entity_result.rb
266
+ - lib/much-rails/assets.rb
267
+ - lib/much-rails/boolean.rb
268
+ - lib/much-rails/call_method.rb
269
+ - lib/much-rails/call_method_callbacks.rb
270
+ - lib/much-rails/change_action.rb
271
+ - lib/much-rails/change_action_result.rb
272
+ - lib/much-rails/config.rb
273
+ - lib/much-rails/date.rb
274
+ - lib/much-rails/decimal.rb
275
+ - lib/much-rails/destroy_action.rb
276
+ - lib/much-rails/destroy_service.rb
277
+ - lib/much-rails/has_slug.rb
278
+ - lib/much-rails/input_value.rb
279
+ - lib/much-rails/json.rb
280
+ - lib/much-rails/layout.rb
281
+ - lib/much-rails/layout/helper.rb
282
+ - lib/much-rails/mixin.rb
283
+ - lib/much-rails/not_given.rb
284
+ - lib/much-rails/rails_routes.rb
285
+ - lib/much-rails/railtie.rb
286
+ - lib/much-rails/records.rb
287
+ - lib/much-rails/records/always_destroyable.rb
288
+ - lib/much-rails/records/not_destroyable.rb
289
+ - lib/much-rails/records/validate_destroy.rb
290
+ - lib/much-rails/result.rb
291
+ - lib/much-rails/save_action.rb
292
+ - lib/much-rails/save_service.rb
293
+ - lib/much-rails/service.rb
294
+ - lib/much-rails/service_validation_errors.rb
295
+ - lib/much-rails/time.rb
40
296
  - lib/much-rails/version.rb
297
+ - lib/much-rails/view_models.rb
298
+ - lib/much-rails/view_models/breadcrumb.rb
299
+ - lib/much-rails/wrap_and_call_method.rb
300
+ - lib/much-rails/wrap_method.rb
41
301
  - log/.keep
42
302
  - much-rails.gemspec
43
303
  - test/helper.rb
304
+ - test/support/actions/show.rb
305
+ - test/support/config/routes/test.rb
44
306
  - test/support/factory.rb
307
+ - test/support/fake_action_controller.rb
45
308
  - test/system/.keep
46
- - test/unit/.keep
309
+ - test/unit/action/base_command_result_tests.rb
310
+ - test/unit/action/base_result_tests.rb
311
+ - test/unit/action/base_router_tests.rb
312
+ - test/unit/action/controller_tests.rb
313
+ - test/unit/action/head_result_tests.rb
314
+ - test/unit/action/redirect_to_result_tests.rb
315
+ - test/unit/action/render_result_tests.rb
316
+ - test/unit/action/router_tests.rb
317
+ - test/unit/action/send_data_result_tests.rb
318
+ - test/unit/action/send_file_result_tests.rb
319
+ - test/unit/action/unprocessable_entity_result_tests.rb
320
+ - test/unit/action_tests.rb
321
+ - test/unit/assets_tests.rb
322
+ - test/unit/boolean_tests.rb
323
+ - test/unit/call_method_callbacks_tests.rb
324
+ - test/unit/call_method_tests.rb
325
+ - test/unit/change_action_result_tests.rb
326
+ - test/unit/change_action_tests.rb
327
+ - test/unit/config_tests.rb
328
+ - test/unit/date_tests.rb
329
+ - test/unit/decimal_tests.rb
330
+ - test/unit/destroy_action_tests.rb
331
+ - test/unit/destroy_service_tests.rb
332
+ - test/unit/has_slug_tests.rb
333
+ - test/unit/input_value_tests.rb
334
+ - test/unit/json_tests.rb
335
+ - test/unit/layout_tests.rb
336
+ - test/unit/mixin_tests.rb
47
337
  - test/unit/much-rails_tests.rb
338
+ - test/unit/not_given_tests.rb
339
+ - test/unit/rails_routes_tests.rb
340
+ - test/unit/records/always_destroyable_tests.rb
341
+ - test/unit/records/not_destroyable_tests.rb
342
+ - test/unit/records/validate_destroy_tests.rb
343
+ - test/unit/result_tests.rb
344
+ - test/unit/save_action_tests.rb
345
+ - test/unit/save_service_tests.rb
346
+ - test/unit/service_tests.rb
347
+ - test/unit/service_validation_errors_tests.rb
348
+ - test/unit/time_tests.rb
349
+ - test/unit/view_models/breadcrumb_tests.rb
350
+ - test/unit/wrap_and_call_method_tests.rb
351
+ - test/unit/wrap_method_tests.rb
48
352
  - tmp/.keep
49
353
  homepage: https://github.com/redding/much-rails
50
354
  licenses:
@@ -65,13 +369,58 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
369
  - !ruby/object:Gem::Version
66
370
  version: '0'
67
371
  requirements: []
68
- rubygems_version: 3.1.2
372
+ rubyforge_project:
373
+ rubygems_version: 2.7.6.2
69
374
  signing_key:
70
375
  specification_version: 4
71
376
  summary: Rails utilities.
72
377
  test_files:
73
378
  - test/helper.rb
379
+ - test/support/actions/show.rb
380
+ - test/support/config/routes/test.rb
74
381
  - test/support/factory.rb
382
+ - test/support/fake_action_controller.rb
75
383
  - test/system/.keep
76
- - test/unit/.keep
384
+ - test/unit/action/base_command_result_tests.rb
385
+ - test/unit/action/base_result_tests.rb
386
+ - test/unit/action/base_router_tests.rb
387
+ - test/unit/action/controller_tests.rb
388
+ - test/unit/action/head_result_tests.rb
389
+ - test/unit/action/redirect_to_result_tests.rb
390
+ - test/unit/action/render_result_tests.rb
391
+ - test/unit/action/router_tests.rb
392
+ - test/unit/action/send_data_result_tests.rb
393
+ - test/unit/action/send_file_result_tests.rb
394
+ - test/unit/action/unprocessable_entity_result_tests.rb
395
+ - test/unit/action_tests.rb
396
+ - test/unit/assets_tests.rb
397
+ - test/unit/boolean_tests.rb
398
+ - test/unit/call_method_callbacks_tests.rb
399
+ - test/unit/call_method_tests.rb
400
+ - test/unit/change_action_result_tests.rb
401
+ - test/unit/change_action_tests.rb
402
+ - test/unit/config_tests.rb
403
+ - test/unit/date_tests.rb
404
+ - test/unit/decimal_tests.rb
405
+ - test/unit/destroy_action_tests.rb
406
+ - test/unit/destroy_service_tests.rb
407
+ - test/unit/has_slug_tests.rb
408
+ - test/unit/input_value_tests.rb
409
+ - test/unit/json_tests.rb
410
+ - test/unit/layout_tests.rb
411
+ - test/unit/mixin_tests.rb
77
412
  - test/unit/much-rails_tests.rb
413
+ - test/unit/not_given_tests.rb
414
+ - test/unit/rails_routes_tests.rb
415
+ - test/unit/records/always_destroyable_tests.rb
416
+ - test/unit/records/not_destroyable_tests.rb
417
+ - test/unit/records/validate_destroy_tests.rb
418
+ - test/unit/result_tests.rb
419
+ - test/unit/save_action_tests.rb
420
+ - test/unit/save_service_tests.rb
421
+ - test/unit/service_tests.rb
422
+ - test/unit/service_validation_errors_tests.rb
423
+ - test/unit/time_tests.rb
424
+ - test/unit/view_models/breadcrumb_tests.rb
425
+ - test/unit/wrap_and_call_method_tests.rb
426
+ - test/unit/wrap_method_tests.rb