activeinteractor 1.2.2 → 2.0.0.alpha.1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -1
  3. data/LICENSE +1 -1
  4. data/README.md +4 -64
  5. data/lib/active_interactor/base.rb +77 -29
  6. data/lib/active_interactor/errors.rb +12 -0
  7. data/lib/active_interactor/result.rb +73 -0
  8. data/lib/active_interactor.rb +3 -101
  9. data/sig/active_interactor.rbs +3 -0
  10. metadata +23 -86
  11. data/.yardopts +0 -12
  12. data/lib/active_interactor/config.rb +0 -60
  13. data/lib/active_interactor/configurable.rb +0 -53
  14. data/lib/active_interactor/context/attributes.rb +0 -179
  15. data/lib/active_interactor/context/base.rb +0 -333
  16. data/lib/active_interactor/context/errors.rb +0 -57
  17. data/lib/active_interactor/context/loader.rb +0 -50
  18. data/lib/active_interactor/context/status.rb +0 -106
  19. data/lib/active_interactor/error.rb +0 -46
  20. data/lib/active_interactor/interactor/callbacks.rb +0 -293
  21. data/lib/active_interactor/interactor/context.rb +0 -378
  22. data/lib/active_interactor/interactor/perform.rb +0 -260
  23. data/lib/active_interactor/interactor/worker.rb +0 -120
  24. data/lib/active_interactor/models.rb +0 -50
  25. data/lib/active_interactor/organizer/base.rb +0 -18
  26. data/lib/active_interactor/organizer/callbacks.rb +0 -275
  27. data/lib/active_interactor/organizer/interactor_interface.rb +0 -127
  28. data/lib/active_interactor/organizer/interactor_interface_collection.rb +0 -62
  29. data/lib/active_interactor/organizer/organize.rb +0 -67
  30. data/lib/active_interactor/organizer/perform.rb +0 -112
  31. data/lib/active_interactor/rails/orm/active_record.rb +0 -5
  32. data/lib/active_interactor/rails/orm/dynamoid.rb +0 -5
  33. data/lib/active_interactor/rails/orm/mongoid.rb +0 -5
  34. data/lib/active_interactor/rails/railtie.rb +0 -21
  35. data/lib/active_interactor/rails.rb +0 -4
  36. data/lib/active_interactor/version.rb +0 -45
  37. data/lib/rails/generators/active_interactor/application_context_generator.rb +0 -21
  38. data/lib/rails/generators/active_interactor/application_interactor_generator.rb +0 -21
  39. data/lib/rails/generators/active_interactor/application_organizer_generator.rb +0 -21
  40. data/lib/rails/generators/active_interactor/base.rb +0 -29
  41. data/lib/rails/generators/active_interactor/generator.rb +0 -21
  42. data/lib/rails/generators/active_interactor/install_generator.rb +0 -16
  43. data/lib/rails/generators/active_interactor.rb +0 -5
  44. data/lib/rails/generators/interactor/context/rspec_generator.rb +0 -17
  45. data/lib/rails/generators/interactor/context/test_unit_generator.rb +0 -17
  46. data/lib/rails/generators/interactor/context_generator.rb +0 -22
  47. data/lib/rails/generators/interactor/generates_context.rb +0 -28
  48. data/lib/rails/generators/interactor/interactor_generator.rb +0 -25
  49. data/lib/rails/generators/interactor/organizer_generator.rb +0 -39
  50. data/lib/rails/generators/interactor/rspec_generator.rb +0 -15
  51. data/lib/rails/generators/interactor/test_unit_generator.rb +0 -15
  52. data/lib/rails/generators/templates/active_interactor.erb +0 -17
  53. data/lib/rails/generators/templates/application_context.rb +0 -4
  54. data/lib/rails/generators/templates/application_interactor.rb +0 -4
  55. data/lib/rails/generators/templates/application_organizer.rb +0 -4
  56. data/lib/rails/generators/templates/context.erb +0 -7
  57. data/lib/rails/generators/templates/context_spec.erb +0 -7
  58. data/lib/rails/generators/templates/context_test_unit.erb +0 -9
  59. data/lib/rails/generators/templates/interactor.erb +0 -15
  60. data/lib/rails/generators/templates/interactor_spec.erb +0 -7
  61. data/lib/rails/generators/templates/interactor_test_unit.erb +0 -9
  62. data/lib/rails/generators/templates/organizer.erb +0 -13
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class <%= class_name %> < ApplicationInteractor
4
- <%- if skip_context? && !context_attributes.empty? -%>
5
- context_attributes <%= context_attributes.map { |a| ":#{a}" }.join(', ') %>
6
-
7
- <%- end -%>
8
- def perform
9
- # TODO implement <%= class_name %> call
10
- end
11
-
12
- def rollback
13
- # TODO implement <%= class_name %> rollback
14
- end
15
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rails_helper'
4
-
5
- RSpec.describe <%= class_name %>, type: :interactor do
6
- pending "add some examples to (or delete) #{__FILE__}"
7
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'test_helper'
4
-
5
- class <%= class_name %>Test < ActiveSupport::TestCase
6
- # test "the truth" do
7
- # assert true
8
- # end
9
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class <%= class_name %> < ApplicationOrganizer
4
- <%- if skip_context? && !context_attributes.empty? -%>
5
- context_attributes <%= context_attributes.map { |a| ":#{a}" }.join(', ') %>
6
-
7
- <%- end -%>
8
- <%- if interactors.any? -%>
9
- organize <%= interactors.join(", ") %>
10
- <%- else -%>
11
- # organize :interactor_1, :interactor_2
12
- <%- end -%>
13
- end