Module: SpecForge::CLI::Actions

Included in:
Command
Defined in:
lib/spec_forge/cli/actions.rb

Overview

Provides helper methods for CLI actions such as file generation and template rendering through Thor::Actions integration.

Examples:

Using actions in a command

actions.template("my_template.tt", "destination/path.rb")

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Internal Ruby hook, called when the module is included in another file

Parameters:

  • base (Class)

    The class that included this module



18
19
20
21
22
23
24
25
26
27
# File 'lib/spec_forge/cli/actions.rb', line 18

def self.included(base)
  #
  # Returns an ActionContext instance for performing file operations
  #
  # @return [ActionContext] The action context for this command
  #
  base.define_method(:actions) do
    @actions ||= ActionContext.new
  end
end