Class: Archfiend::Generators::Extensions
- Inherits:
-
Object
- Object
- Archfiend::Generators::Extensions
- Defined in:
- lib/archfiend/generators/extensions.rb
Constant Summary collapse
- PHASES =
%i[init exec].freeze
- CALLBACK_TYPES =
%i[before after].freeze
Instance Method Summary collapse
-
#initialize(generator_options, action_context, generator_name) ⇒ Extensions
constructor
A new instance of Extensions.
- #run_with_exec_callbacks ⇒ Object
- #run_with_init_callbacks ⇒ Object
Constructor Details
#initialize(generator_options, action_context, generator_name) ⇒ Extensions
Returns a new instance of Extensions.
10 11 12 13 14 15 16 17 |
# File 'lib/archfiend/generators/extensions.rb', line 10 def initialize(, action_context, generator_name) @generator_options = @action_context = action_context @generator_name = generator_name @extensions = activate_extensions expose_extensions end |
Instance Method Details
#run_with_exec_callbacks ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/archfiend/generators/extensions.rb', line 27 def run_with_exec_callbacks run_callback(:exec, :before) yield unless skip_default_action?(:exec) run_callback(:exec, :after) end |
#run_with_init_callbacks ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/archfiend/generators/extensions.rb', line 19 def run_with_init_callbacks run_callback(:init, :before) yield unless skip_default_action?(:init) run_callback(:init, :after) end |