Class: VagrantIE::RunIECommand

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-ie/run_ie_command.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/vagrant-ie/run_ie_command.rb', line 5

def execute
  options = {
    'kiosk' => true
  }

  opts = OptionParser.new do |o|
    o.banner = "Usage: vagrant run-ie [options] URL"

    o.on('--embedding') { |v| options['embedding'] = v }
    o.on('--extoff') { |v| options['extoff'] = v }
    o.on('--[no-]frame-merging') { |v| options['frame-merging'] = v }
    o.on('--[no-]session-merging') { |v| options['session-merging'] = v }
    o.on('--no-hang-recovery') { |v| options['hang-recovery'] = v }
    o.on('--private') { |v| options['private'] = v }
    o.on('-k', '--[no-]kiosk') { |v| options['kiosk'] = v }
  end

  argv = parse_options(opts)

  return unless argv

  PowerShell.open do |shell|
    shell.invoke_file({
      file: 'C:\Users\IEUser\vagrant-ie\RunIE.ps1',
      args: map_arguments(options).concat([
        argv[0]
      ])
    })
  end
end