Class: ScoutAgent::Assignment::Configuration

Inherits:
ScoutAgent::Assignment show all
Defined in:
lib/scout_agent/assignment/configuration.rb

Instance Attribute Summary

Attributes inherited from ScoutAgent::Assignment

#group, #other_args, #switches, #user

Instance Method Summary collapse

Methods inherited from ScoutAgent::Assignment

#initialize, #prepare_and_execute

Methods included from Tracked

#clear_status, #force_status_database_reload, #status, #status_database, #status_log

Constructor Details

This class inherits a constructor from ScoutAgent::Assignment

Instance Method Details

#executeObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/scout_agent/assignment/configuration.rb', line 7

def execute
  puts "Configuration"
  puts "============="
  puts 
  settings = [:agent_key] + Plan.defaults.map { |name, _| name }
  size     = settings.map { |name| name.to_s.size }.max
  settings.each do |name|
    value = case v = Plan.send(name)
            when Pathname
              if name.to_s =~ /\Aos_/
                v.relative_path_from(Plan.prefix_path).to_s.inspect
              else
                v.to_s.inspect
              end
            when Array
              "%w[#{v.join(' ')}]"
            else
              v.inspect
            end
    puts "config.%-#{size}s = %s" % [name, value]
  end
end