Module: Template

Overview

Template module is a module for stringIO.

Constant Summary

Constants included from Color

Color::COLORS

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.checker(boolean, str) ⇒ Object



15
16
17
# File 'lib/umu/beautifica/assets/template.rb', line 15

def checker(boolean, str)
  boolean ? "(○) #{syan(str)}" : "( ) #{str}"
end

.command(generator_name, target_name = '', sub_items = '', options = '') ⇒ Object



23
24
25
26
27
28
# File 'lib/umu/beautifica/assets/template.rb', line 23

def command(generator_name, target_name = '', sub_items = '', options = '')
  target_name = " #{target_name}" unless target_name.empty?
  sub_items = " #{sub_items}" unless sub_items.empty?
  options = " #{options}" unless options.empty?
  "rails generate #{generator_name}" + target_name + sub_items + options
end

.cover(num) ⇒ Object



11
12
13
# File 'lib/umu/beautifica/assets/template.rb', line 11

def cover(num)
  puts "\e[#{num}A\e[0J\e[1A"
end

.hover(boolen, str) ⇒ Object



19
20
21
# File 'lib/umu/beautifica/assets/template.rb', line 19

def hover(boolen, str)
  boolen ? green(str) : str
end

.pointer(boolean) ⇒ Object



7
8
9
# File 'lib/umu/beautifica/assets/template.rb', line 7

def pointer(boolean)
  boolean ? ' > ' : '   '
end

.show_command(generator_name, target_name = '', sub_items = '', options = '') ⇒ Object



30
31
32
# File 'lib/umu/beautifica/assets/template.rb', line 30

def show_command(generator_name, target_name = '', sub_items = '', options = '')
  puts green('>') + " #{command(generator_name, target_name, sub_items, options)}"
end

Instance Method Details

#logoObject



34
35
36
37
38
39
40
41
42
43
# File 'lib/umu/beautifica/assets/template.rb', line 34

def 
  print <<-'UMU'
   _   _
  | | | |_ __ ___  _   _ 
  | | | | '_ ` _ \| | | |
  | |_| | | | | | | |_| |
   \___/|_| |_| |_|\__,_|

  UMU
end