wocker 0.2.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96539742fe041e73f0544b5a44a8b7d8072165412a81908a6f8a840e0f0ef8e2
4
- data.tar.gz: 42d930064b2def1c191c72f850899d9c603d8a95d43843e850e0ebbd1b286fed
3
+ metadata.gz: edebd22ba00be6730c4138c5891ddae248e570a5ea86cd4390300500f2e4406a
4
+ data.tar.gz: 63d38e68a52df9550d61ee07bf5f4da159be8be268f138aed1b80d3e32cd5c44
5
5
  SHA512:
6
- metadata.gz: dba213b3934dcaf89015784030ae45bd8321a17e6add8d2e61f3d888003755110422ccc465c4da8d732f03a0def32d8e0999980e0d93c4fc4446d32a619c9cad
7
- data.tar.gz: aacf8431c627a49f07548e974a8f12374478ad37142a57eeacd42b6d1d148fccb5bebecf3b22e6e47f41978e735d717102bab7a4dafea945365f12d3bebd8f0f
6
+ metadata.gz: 2d57f8cd7a34383ebab3c8794fbf2b249f999ddfa21d0b6940f4c7be05d6fde9eaf4e4d5e4fcb5bdcdb2035784f9ba55bd0d0ff8dfb49b1f8e8a41027af75933
7
+ data.tar.gz: d4fe66cc5a4d6f40d67993c2d250bd0683c142e985b8de686af9e981636ed4ccc3611428bad57df9ccd765917a2ea6164cb3520494496deabe5ec83a1bc5875b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wocker (0.2.5)
4
+ wocker (0.3.0)
5
5
  clamp
6
6
 
7
7
  GEM
data/lib/wocker.rb CHANGED
@@ -14,3 +14,4 @@ require_relative "wocker/wockerfile"
14
14
  require_relative "wocker/vagrant"
15
15
  require_relative "wocker/vagrantfile"
16
16
  require_relative "wocker/vagrantfile_template"
17
+ require_relative "wocker/virtualbox"
data/lib/wocker/cli.rb CHANGED
@@ -16,5 +16,6 @@ require_relative "cli/stop_command"
16
16
  require_relative "cli/ps_command"
17
17
  require_relative "cli/port_command"
18
18
  require_relative "cli/init_command"
19
+ require_relative "cli/keyboard_command"
19
20
 
20
21
  require_relative "cli/root_command"
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wocker
4
+ module Cli
5
+ class KeyboardCommand < Clamp::Command
6
+ class KeyCommand < Clamp::Command
7
+ parameter "KEY ...", "control alt del"
8
+
9
+ def execute
10
+ first_vm_name = Wocker::Virtualbox.first_running_vm_name
11
+
12
+ scancodes = case key_list
13
+ when ["control","alt","del"]
14
+ "1d 38 53 d3 b8 9d"
15
+ when ["enter"]
16
+ "1c"
17
+ else
18
+ puts "unknown: #{key_list.inspect}"
19
+ exit 1
20
+ end
21
+
22
+ `VBoxManage controlvm #{first_vm_name} keyboardputscancode #{scancodes}`
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wocker
4
+ module Cli
5
+ class KeyboardCommand < Clamp::Command
6
+ class WriteCommand < Clamp::Command
7
+ parameter "STRING", "string"
8
+
9
+ def execute
10
+ first_vm_name = Wocker::Virtualbox.first_running_vm_name
11
+
12
+ `VBoxManage controlvm #{first_vm_name} keyboardputstring #{string}`
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+ require_relative "keyboard/key_command"
3
+ require_relative "keyboard/write_command"
4
+
5
+ module Wocker
6
+ module Cli
7
+ class KeyboardCommand < Clamp::Command
8
+ subcommand ["key"], "press keys", KeyboardCommand::KeyCommand
9
+ subcommand ["write"], "write string", KeyboardCommand::WriteCommand
10
+
11
+ def execute
12
+ puts "see --help"
13
+ end
14
+ end
15
+ end
16
+ end
17
+
@@ -20,6 +20,7 @@ module Wocker
20
20
  subcommand ["port"], "port", PortCommand
21
21
  subcommand ["restart"], "restart", RestartCommand
22
22
  subcommand ["init"], "init", InitCommand
23
+ subcommand ["keyboard"], "keyboard", KeyboardCommand
23
24
 
24
25
  def self.run
25
26
  super
@@ -1,3 +1,3 @@
1
1
  module Wocker
2
- VERSION = "0.2.5"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -0,0 +1,11 @@
1
+ require 'fileutils'
2
+
3
+ module Wocker
4
+ class Virtualbox
5
+ def self.first_running_vm_name
6
+ output = `VBoxManage list runningvms`
7
+ vm_name, _ = output.split(' ')
8
+ vm_name
9
+ end
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wocker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matti Paksula
@@ -92,6 +92,9 @@ files:
92
92
  - lib/wocker/cli/build_command.rb
93
93
  - lib/wocker/cli/exec_command.rb
94
94
  - lib/wocker/cli/init_command.rb
95
+ - lib/wocker/cli/keyboard/key_command.rb
96
+ - lib/wocker/cli/keyboard/write_command.rb
97
+ - lib/wocker/cli/keyboard_command.rb
95
98
  - lib/wocker/cli/port_command.rb
96
99
  - lib/wocker/cli/ps_command.rb
97
100
  - lib/wocker/cli/restart_command.rb
@@ -104,6 +107,7 @@ files:
104
107
  - lib/wocker/vagrantfile.rb
105
108
  - lib/wocker/vagrantfile_template.rb
106
109
  - lib/wocker/version.rb
110
+ - lib/wocker/virtualbox.rb
107
111
  - lib/wocker/wockerfile.rb
108
112
  - scripts/wocker-install-chocolatey.ps1
109
113
  - templates/Vagrantfile