class Omnitest::Psychic::Factories::PowerShellTaskFactory
Constants
- EXTENSIONS
- TASK_PRIORITY
Public Class Methods
new(psychic, opts = {})
click to toggle source
Calls superclass method
# File lib/omnitest/psychic/factories/powershell_factories.rb, line 10 def initialize(psychic, opts = {}) super @known_tasks = Dir["#{cwd}/scripts/*"].map do | script | File.basename(script, File.extname(script)) if EXTENSIONS.include?(File.extname(script)) end end
Public Instance Methods
active?()
click to toggle source
# File lib/omnitest/psychic/factories/powershell_factories.rb, line 23 def active? true if psychic.os_family == :windows end
task(task_alias)
click to toggle source
# File lib/omnitest/psychic/factories/powershell_factories.rb, line 17 def task(task_alias) task = task_alias.to_s script = Dir["#{cwd}/scripts/#{task}{.ps1}"].first relativize_cmd(script) if script end
Private Instance Methods
relativize_cmd(cmd)
click to toggle source
# File lib/omnitest/psychic/factories/powershell_factories.rb, line 29 def relativize_cmd(cmd) cmd = Omnitest::Core::FileSystem.relativize(cmd, cwd) "PowerShell -NoProfile -ExecutionPolicy Bypass -File \"#{cmd}\"" end