class Geny::Context::Invoke

The `invoke` behavior for all commands is evaluated in the context of this class. All methods that are defined here are available inside `invoke`.

Public Instance Methods

color() click to toggle source

A utility for colored output @return [Pastel] @see github.com/piotrmurach/pastel

# File lib/geny/context/invoke.rb, line 20
def color
  Pastel.new(enabled: $stdout.tty?)
end
files() click to toggle source

A utility for interacting with files @return [Actions::Files]

# File lib/geny/context/invoke.rb, line 32
def files
  Actions::Files.new(ui: ui)
end
find() click to toggle source

A utility for bulk find-and-replace operations @return [Actions::Find]

# File lib/geny/context/invoke.rb, line 38
def find
  Actions::Find.new
end
geny() click to toggle source

A utility for invoking other generators @return [Actions::Geny]

# File lib/geny/context/invoke.rb, line 65
def geny
  Actions::Geny.new(registry: command.registry)
end
git() click to toggle source

A utility for interacting with git repositories @return [Actions::Git]

# File lib/geny/context/invoke.rb, line 50
def git
  Actions::Git.new(shell: shell)
end
shell() click to toggle source

A utility for running shell commands @return [Actions::Shell]

# File lib/geny/context/invoke.rb, line 44
def shell
  Actions::Shell.new(ui: ui)
end
templates() click to toggle source

A utility for rendering and copying templates @return [Actions::Templates]

# File lib/geny/context/invoke.rb, line 56
def templates
  Actions::Templates.new(
    root: command.templates_path,
    view: View.new(command: command, locals: locals)
  )
end
ui() click to toggle source

A utility for printing messages to the console @return [Actions::UI]

# File lib/geny/context/invoke.rb, line 26
def ui
  Actions::UI.new(color: color)
end