Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/lokale.rb,
lib/lokale/colorize.rb

Instance Method Summary collapse

Instance Method Details

#bg_blackObject



11
# File 'lib/lokale/colorize.rb', line 11

def bg_black;       "\e[40m#{self}\e[0m" end

#bg_blueObject



15
# File 'lib/lokale/colorize.rb', line 15

def bg_blue;        "\e[44m#{self}\e[0m" end

#bg_brownObject



14
# File 'lib/lokale/colorize.rb', line 14

def bg_brown;       "\e[43m#{self}\e[0m" end

#bg_cyanObject



17
# File 'lib/lokale/colorize.rb', line 17

def bg_cyan;        "\e[46m#{self}\e[0m" end

#bg_grayObject



18
# File 'lib/lokale/colorize.rb', line 18

def bg_gray;        "\e[47m#{self}\e[0m" end

#bg_greenObject



13
# File 'lib/lokale/colorize.rb', line 13

def bg_green;       "\e[42m#{self}\e[0m" end

#bg_magentaObject



16
# File 'lib/lokale/colorize.rb', line 16

def bg_magenta;     "\e[45m#{self}\e[0m" end

#bg_redObject



12
# File 'lib/lokale/colorize.rb', line 12

def bg_red;         "\e[41m#{self}\e[0m" end

#blackObject



2
# File 'lib/lokale/colorize.rb', line 2

def black;          "\e[30m#{self}\e[0m" end


23
# File 'lib/lokale/colorize.rb', line 23

def blink;          "\e[5m#{self}\e[25m" end

#blueObject



6
# File 'lib/lokale/colorize.rb', line 6

def blue;           "\e[34m#{self}\e[0m" end

#boldObject



20
# File 'lib/lokale/colorize.rb', line 20

def bold;           "\e[1m#{self}\e[22m" end

#brownObject



5
# File 'lib/lokale/colorize.rb', line 5

def brown;          "\e[33m#{self}\e[0m" end

#cyanObject



8
# File 'lib/lokale/colorize.rb', line 8

def cyan;           "\e[36m#{self}\e[0m" end

#grayObject



9
# File 'lib/lokale/colorize.rb', line 9

def gray;           "\e[37m#{self}\e[0m" end

#greenObject



4
# File 'lib/lokale/colorize.rb', line 4

def green;          "\e[32m#{self}\e[0m" end

#italicObject



21
# File 'lib/lokale/colorize.rb', line 21

def italic;         "\e[3m#{self}\e[23m" end

#localization_file?Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
# File 'lib/lokale.rb', line 14

def localization_file?
  File.directory?(self) == false &&
      (self =~ /\/Pods\//) == nil &&
      (self =~ /\.bundle\//) == nil &&
      (self =~ /\/(.{1,8})\.lproj\//)
end

#lpadded(count = 20) ⇒ Object



10
11
12
# File 'lib/lokale.rb', line 10

def lpadded(count=20)
  "%#{count}.#{count}s" % self
end

#magentaObject



7
# File 'lib/lokale/colorize.rb', line 7

def magenta;        "\e[35m#{self}\e[0m" end

#redObject



3
# File 'lib/lokale/colorize.rb', line 3

def red;            "\e[31m#{self}\e[0m" end

#reverse_colorObject



24
# File 'lib/lokale/colorize.rb', line 24

def reverse_color;  "\e[7m#{self}\e[27m" end

#rpadded(count = 20) ⇒ Object



6
7
8
# File 'lib/lokale.rb', line 6

def rpadded(count=20)
  "%-#{count}.#{count}s" % self
end

#source_file?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/lokale.rb', line 21

def source_file?
  (File.directory?(self) == false) && (self =~ /\/Pods\//).nil? && ((self =~ /\.(swift|h|m)$/) != nil)
end

#underlineObject



22
# File 'lib/lokale/colorize.rb', line 22

def underline;      "\e[4m#{self}\e[24m" end