Top Level Namespace
Instance Method Summary collapse
- #alcapon_message(string) ⇒ Object
- #capez_puts_done ⇒ Object
- #ezp5? ⇒ Boolean
- #ezp_legacy_path(path = '') ⇒ Object
- #print_dotted(message, options = {}) ⇒ Object
- #start_spinner ⇒ Object
-
#stop_spinner ⇒ Object
stops the spinner and backspaces over last displayed character.
- #unindent(string) ⇒ Object
Instance Method Details
#alcapon_message(string) ⇒ Object
52 53 54 |
# File 'lib/utils.rb', line 52 def (string) puts( "[alcapon]".green+" #{string}" ) end |
#capez_puts_done ⇒ Object
6 7 8 |
# File 'lib/utils.rb', line 6 def capez_puts_done puts '✔'.green end |
#ezp5? ⇒ Boolean
34 35 36 |
# File 'lib/utils.rb', line 34 def ezp5? return ( fetch( :ezpublish_version, nil ) == 5 ) end |
#ezp_legacy_path(path = '') ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/utils.rb', line 38 def ezp_legacy_path(path='') elements = Array.new if( fetch( :ezp_legacy, "" ) != "" ) elements += [ "#{ezp_legacy}" ] end if( path != '' ) elements += [ "#{path}" ] end return File.join( elements ) end |
#print_dotted(message, options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/utils.rb', line 10 def print_dotted( , ={} ) = { :eol => false, :sol => false, :max_length => 40, :eol_msg => false } = .merge( ) = "#{} " + "." * [0,[:max_length]-.length-1].max if [:sol] = "\n#{}" end if [:eol_msg] += " #{[:eol_msg]}" end if [:eol] puts else print end end |
#start_spinner ⇒ Object
17 18 19 20 |
# File 'lib/ext/spinner.rb', line 17 def start_spinner @spinner_running = true @spinner.wakeup end |
#stop_spinner ⇒ Object
stops the spinner and backspaces over last displayed character
23 24 25 26 |
# File 'lib/ext/spinner.rb', line 23 def stop_spinner @spinner_running = false print "\b" end |
#unindent(string) ⇒ Object
1 2 3 4 |
# File 'lib/utils.rb', line 1 def unindent(string) indentation = string[/\A\s*/] string.strip.gsub(/^#{indentation}/, "") end |