Class: Gvcs::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/gvcs.rb

Overview

configuration elements for the library

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



26
27
28
29
# File 'lib/gvcs.rb', line 26

def initialize
  @showCommand = false
  @commandOut = STDOUT
end

Instance Method Details

#command_outputObject



46
47
48
# File 'lib/gvcs.rb', line 46

def command_output
  @commandOut
end

#is_show_vcs_command?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/gvcs.rb', line 42

def is_show_vcs_command?
  @showCommand
end

#show_vcs_command(val, out = STDOUT) ⇒ Object



31
32
33
34
35
36
37
38
39
40
# File 'lib/gvcs.rb', line 31

def show_vcs_command(val, out = STDOUT)
  if val == true or val == false
    @showCommand = val
    if @commandOut.respond_to?(:puts)
      @commandOut = out
    else
      raise Error, "Command output minimally need to support puts() call. Given #{@commandOut}"
    end
  end
end