Module: Template
- Includes:
- Color
- Included in:
- ApplicationRecordMaker, BenchmarkMaker, ChannelMaker, ControllerMaker, HelperMaker, JobMaker, MailboxMaker, MailerMaker, MigrationMaker, ModelMaker, ResourceMaker, TaskMaker, Umu::Inputter, Umu::LanguageSetting, Umu::Selector
- Defined in:
- lib/umu/beautifica/assets/template.rb
Overview
Template module is a module for stringIO.
Constant Summary
Constants included from Color
Class Method Summary collapse
- .checker(boolean, str) ⇒ Object
- .command(generator_name, target_name = '', sub_items = '', options = '') ⇒ Object
- .cover(num) ⇒ Object
- .hover(boolen, str) ⇒ Object
- .pointer(boolean) ⇒ Object
- .show_command(generator_name, target_name = '', sub_items = '', options = '') ⇒ Object
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 = '', = '') target_name = " #{target_name}" unless target_name.empty? sub_items = " #{sub_items}" unless sub_items.empty? = " #{}" unless .empty? "rails generate #{generator_name}" + target_name + sub_items + 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 = '', = '') puts green('>') + " #{command(generator_name, target_name, sub_items, )}" end |
Instance Method Details
#logo ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/umu/beautifica/assets/template.rb', line 34 def logo print <<-'UMU' _ _ | | | |_ __ ___ _ _ | | | | '_ ` _ \| | | | | |_| | | | | | | |_| | \___/|_| |_| |_|\__,_| UMU end |