Sha256: 685b626497d2f8daca29dd72b01e2b5a271fcfb9060be6c934e3aa510d21650e

Contents?: true

Size: 611 Bytes

Versions: 90

Compression:

Stored size: 611 Bytes

Contents

module GeneratorMessages
  class << self
    def output
      @output ||= []
    end

    def add_error(message)
      output << format_error(message)
    end

    def add_warning(message)
      output << format_warning(message)
    end

    def add_info(message)
      output << format_info(message)
    end

    def messages
      output
    end

    def format_error(msg)
      Rainbow("ERROR: #{msg}").red
    end

    def format_warning(msg)
      Rainbow("WARNING: #{msg}").orange
    end

    def format_info(msg)
      Rainbow(msg.to_s).green
    end

    def clear
      @output = []
    end
  end
end

Version data entries

90 entries across 90 versions & 1 rubygems

Version Path
react_on_rails-3.0.2 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-3.0.1 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-3.0.0 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-3.0.0.rc.2 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-3.0.0.rc.1 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-3.0.0.beta.1 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-2.3.0 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-2.2.0 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-2.1.1 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-2.1.0 lib/generators/react_on_rails/generator_messages.rb