Class: Voodoo::PeopleTools

Inherits:
Object
  • Object
show all
Defined in:
lib/voodoo/peopletools.rb

Direct Known Subclasses

AppDesigner, AppEngine, DataMover

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePeopleTools

Returns a new instance of PeopleTools.



11
12
13
14
15
# File 'lib/voodoo/peopletools.rb', line 11

def initialize
  set_base_parameters
  @tools_bin = File.join(Voodoo.configuration[:ps_home], %w{bin client winx86}).gsub!(File::SEPARATOR, File::ALT_SEPARATOR)
  LOG.debug("Tools bin is set to #{@tools_bin}")
end

Instance Attribute Details

#command_line_optionsObject

Returns the value of attribute command_line_options.



9
10
11
# File 'lib/voodoo/peopletools.rb', line 9

def command_line_options
  @command_line_options
end

#executableObject

Returns the value of attribute executable.



9
10
11
# File 'lib/voodoo/peopletools.rb', line 9

def executable
  @executable
end

Instance Method Details

#append(args) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/voodoo/peopletools.rb', line 17

def append(args)
  args.each_pair do |k, v|
    @command_line_options.push case
      when k == :db_type
        '-CT ' + v
      when k == :env_name
        '-CD ' + v
      when k == :env_username
        '-CO ' + v
      when k == :env_password
        '-CP ' + v
      when k == :compare_project
        '-PJM ' + v
      when k == :archive_project
        '-PJTF ' + v
      when k == :copy_project
        '-PJC ' + v
      when k == :build_project
        '-PJB ' + v
      when k == :target_name
        '-TD ' + v
      when k == :target_username
        '-TO ' + v
      when k == :target_password
        '-TP ' + v
      when k == :log_file
        '-LF ' + v
      when k == :tgt
        '-TGT ' + v
      when k == :cmxml
        '-CMXML ' + v
      when k == :compare_folder
        '-ROD ' + v
      when k == :exp
        '-EXP ' + v
      when k == :obj
        '-OBJ ' + v
      when k == :r
        '-R ' + v
      when k == :ae_name
        '-AI ' + v
      when k == :output_folder
        '-FP ' + v
    end
  end
end

#call_executableObject



64
65
66
67
68
69
70
71
72
73
74
# File 'lib/voodoo/peopletools.rb', line 64

def call_executable
  LOG.debug("Executable is set to #{@executable}")
  LOG.debug("Command line options are set to #{@command_line_options.join(" ")}")

  f = IO.popen(@executable + " " + @command_line_options.join(" "))
  f.readlines.each { |line| puts ("#{line.chomp}")}
  f.close

  @command_line_options.clear
  set_base_parameters
end