Sha256: 9491e5c704d6ae4925cf9553fa6e5db17bc6d4e2a625c74ad28d7e805d0c2d2e

Contents?: true

Size: 642 Bytes

Versions: 91

Compression:

Stored size: 642 Bytes

Contents

# frozen_string_literal: true

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

91 entries across 91 versions & 1 rubygems

Version Path
react_on_rails-13.3.5 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-13.3.4 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-13.3.3 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-13.3.2 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-13.3.1 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-13.3.0 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-13.2.0 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-13.1.0 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-13.0.2 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-13.0.1 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-13.0.0 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-13.0.0.beta.0 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-12.6.0 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-12.5.2 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-12.5.1 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-12.5.0 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-12.4.0 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-12.4.0.rc.0 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-12.3.0 lib/generators/react_on_rails/generator_messages.rb
react_on_rails-12.2.0 lib/generators/react_on_rails/generator_messages.rb