Module: Bemonrails::ConsoleMessages
- Included in:
- Bem
- Defined in:
- lib/bem-on-rails/build/console_messages.rb
Instance Method Summary collapse
Instance Method Details
#check_argument_data_type(argument, type) ⇒ Object
21 22 23 |
# File 'lib/bem-on-rails/build/console_messages.rb', line 21 def check_argument_data_type(argument, type) raise ("#{argument} must be a #{type.to_s}", 'red') unless argument.kind_of? type end |
#print_message(message, color) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bem-on-rails/build/console_messages.rb', line 4 def (, color) check_argument_data_type(, String) check_argument_data_type(color, String) color = case color when 'green' then "\e[0;32m" when 'red' then "\e[0;31m" when 'blue' then "\e[0;34m" when 'cyan' then "\e[0;36m" when 'purple' then "\e[0;35m" when 'yellow' then "\e[1;33m" else '' end puts "#{color + } \e[0m" end |