Module: Softcover::Output

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.silentObject

Returns the value of attribute silent.



3
4
5
# File 'lib/softcover/output.rb', line 3

def silent
  @silent
end

.streamObject

Returns the value of attribute stream.



3
4
5
# File 'lib/softcover/output.rb', line 3

def stream
  @stream
end

.verbosity_levelObject

Returns the value of attribute verbosity_level.



3
4
5
# File 'lib/softcover/output.rb', line 3

def verbosity_level
  @verbosity_level
end

Class Method Details

.should_output?(level) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
24
# File 'lib/softcover/output.rb', line 21

def should_output?(level)
  !silent? ||
  !(level && defined?(@verbosity_level) && level < @verbosity_level)
end

.silence!Object



9
10
11
# File 'lib/softcover/output.rb', line 9

def silence!
  @silent = true
end

.silent?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/softcover/output.rb', line 17

def silent?
  defined?(@silent) && @silent
end

.unsilence!Object



13
14
15
# File 'lib/softcover/output.rb', line 13

def unsilence!
  @silent = false
end

Instance Method Details

#system(cmd) ⇒ Object



35
36
37
38
# File 'lib/softcover/output.rb', line 35

def system(cmd)
  output = `#{cmd}`
  puts output
end