Class: Devkitkat::Main
- Inherits:
-
Object
- Object
- Devkitkat::Main
- Defined in:
- lib/devkitkat/main.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ Main
constructor
A new instance of Main.
Constructor Details
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
3 4 5 |
# File 'lib/devkitkat/main.rb', line 3 def command @command end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/devkitkat/main.rb', line 3 def config @config end |
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/devkitkat/main.rb', line 10 def execute if command.tty? && target_services.count > 1 raise ArgumentError, 'TTY mode accepts only one service' end log_paths = target_services.map(&:log_path) puts %Q{See the log at \n#{log_paths.join("\n")}} if target_services.count == 1 # If the target is only one, it could be console access (TTY) # so we can't run in parallel. service = target_services.first execute_for(service) else Parallel.map(target_services, progress: 'Executing', in_processes: 8) do |service| execute_for(service) end end end |