axn 0.1.0.pre.alpha.1
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 +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +54 -0
- data/CHANGELOG.md +5 -0
- data/CONTRIBUTING.md +37 -0
- data/LICENSE.txt +22 -0
- data/README.md +30 -0
- data/Rakefile +12 -0
- data/axn.gemspec +45 -0
- data/docs/.vitepress/config.mjs +55 -0
- data/docs/about/index.md +46 -0
- data/docs/advanced/rough.md +12 -0
- data/docs/advanced/validating-user-input.md +11 -0
- data/docs/guide/index.md +157 -0
- data/docs/index.md +26 -0
- data/docs/reference/action-result.md +12 -0
- data/docs/reference/class.md +18 -0
- data/docs/reference/configuration.md +90 -0
- data/docs/reference/instance.md +17 -0
- data/docs/usage/conventions.md +38 -0
- data/docs/usage/setup.md +26 -0
- data/docs/usage/testing.md +13 -0
- data/docs/usage/using.md +65 -0
- data/docs/usage/writing.md +118 -0
- data/lib/action/configuration.rb +46 -0
- data/lib/action/context_facade.rb +201 -0
- data/lib/action/contract.rb +190 -0
- data/lib/action/contract_validator.rb +66 -0
- data/lib/action/enqueueable.rb +74 -0
- data/lib/action/exceptions.rb +65 -0
- data/lib/action/hoist_errors.rb +51 -0
- data/lib/action/logging.rb +41 -0
- data/lib/action/organizer.rb +41 -0
- data/lib/action/swallow_exceptions.rb +104 -0
- data/lib/action/top_level_around_hook.rb +63 -0
- data/lib/axn/version.rb +5 -0
- data/lib/axn.rb +54 -0
- data/package.json +10 -0
- data/yarn.lock +1166 -0
- metadata +128 -0
data/lib/axn/version.rb
ADDED
data/lib/axn.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Axn; end
|
4
|
+
require_relative "axn/version"
|
5
|
+
|
6
|
+
require "interactor"
|
7
|
+
|
8
|
+
require "active_support"
|
9
|
+
|
10
|
+
require_relative "action/exceptions"
|
11
|
+
require_relative "action/logging"
|
12
|
+
require_relative "action/configuration"
|
13
|
+
require_relative "action/top_level_around_hook"
|
14
|
+
require_relative "action/contract"
|
15
|
+
require_relative "action/swallow_exceptions"
|
16
|
+
require_relative "action/hoist_errors"
|
17
|
+
|
18
|
+
require_relative "action/organizer"
|
19
|
+
require_relative "action/enqueueable"
|
20
|
+
|
21
|
+
module Action
|
22
|
+
def self.included(base)
|
23
|
+
base.class_eval do
|
24
|
+
include Interactor
|
25
|
+
|
26
|
+
# Include first so other modules can assume `log` is available
|
27
|
+
include Logging
|
28
|
+
|
29
|
+
# NOTE: include before any others that set hooks (like contract validation), so we
|
30
|
+
# can include those hook executions in any traces set from this hook.
|
31
|
+
include TopLevelAroundHook
|
32
|
+
|
33
|
+
include Contract
|
34
|
+
include SwallowExceptions
|
35
|
+
|
36
|
+
include HoistErrors
|
37
|
+
|
38
|
+
include Enqueueable
|
39
|
+
|
40
|
+
# Allow additional automatic includes to be configured
|
41
|
+
Array(Action.config.additional_includes).each { |mod| include mod }
|
42
|
+
|
43
|
+
# ----
|
44
|
+
|
45
|
+
# ALPHA: Everything below here is to support inheritance
|
46
|
+
|
47
|
+
base.define_singleton_method(:inherited) do |base_klass|
|
48
|
+
return super(base_klass) if Interactor::Hooks::ClassMethods.private_method_defined?(:ancestor_hooks)
|
49
|
+
|
50
|
+
raise StepsRequiredForInheritanceSupportError
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|