Class: GitHook::IO

Inherits:
Object
  • Object
show all
Defined in:
lib/git_hook/io.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeIO

Returns a new instance of IO.



7
8
9
10
# File 'lib/git_hook/io.rb', line 7

def initialize
  @tty = STDOUT
  @verbose = false
end

Instance Attribute Details

#ttyObject

Returns the value of attribute tty.



5
6
7
# File 'lib/git_hook/io.rb', line 5

def tty
  @tty
end

Instance Method Details

#error(msg) ⇒ Object



24
25
26
# File 'lib/git_hook/io.rb', line 24

def error(msg)
  say(msg, :red)
end

#info(msg) ⇒ Object



16
17
18
# File 'lib/git_hook/io.rb', line 16

def info(msg)
  say(msg, nil)
end

#verbose!(bool) ⇒ Object



12
13
14
# File 'lib/git_hook/io.rb', line 12

def verbose!(bool)
  @verbose = !!bool
end

#warn(msg) ⇒ Object



20
21
22
# File 'lib/git_hook/io.rb', line 20

def warn(msg)
  @verbose && say(msg, :yellow)
end