Module: Preseason::Colorize

Includes:
GeneratorContext
Included in:
Preseason, Config, Recipe
Defined in:
lib/preseason/colorize.rb

Instance Method Summary collapse

Methods included from GeneratorContext

#method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Preseason::GeneratorContext

Instance Method Details

#ask(statement, *args) ⇒ Object

override method from Thor::Shell::Basic



6
7
8
9
# File 'lib/preseason/colorize.rb', line 6

def ask(statement, *args)
  statement = colorize(statement)
  super
end

#readme(path) ⇒ Object

override method from Rails::Generators::Actions



18
19
20
21
22
23
24
25
# File 'lib/preseason/colorize.rb', line 18

def readme(path)
  begin
    say "#{option_color}"
    super
  ensure
    say "#{no_color}"
  end
end

#yes?(statement, color = nil) ⇒ Boolean

override method from Thor::Shell::Basic

Returns:

  • (Boolean)


12
13
14
15
# File 'lib/preseason/colorize.rb', line 12

def yes?(statement, color = nil)
  statement = colorize(statement)
  super
end