lab 0.0.6 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,12 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lab (0.0.1)
4
+ lab (0.1.0)
5
+ net-scp
6
+ net-ssh
5
7
  nokogiri
6
8
 
7
9
  GEM
8
10
  remote: http://rubygems.org/
9
11
  specs:
12
+ net-scp (1.0.4)
13
+ net-ssh (>= 1.99.1)
14
+ net-ssh (2.3.0)
10
15
  nokogiri (1.5.0)
11
16
 
12
17
  PLATFORMS
@@ -112,28 +112,27 @@ class VmDriver
112
112
  private
113
113
 
114
114
  def scp_to(local,remote)
115
- #require 'net/scp'
116
- #::Net::SCP.start(@hostname, @vm_user, :password => @vm_pass) do |scp|
117
- # scp.upload!(from,to)
118
- #end
115
+ ::Net::SCP.start(@hostname, @vm_user, :password => @vm_pass) do |scp|
116
+ scp.upload!(from,to)
117
+ end
119
118
 
120
- system_command("scp #{local} #{@vm_user}@#{@hostname}:#{remote}")
119
+ #system_command("scp #{local} #{@vm_user}@#{@hostname}:#{remote}")
121
120
  end
122
121
 
123
122
  def scp_from(local,remote)
124
- #require 'net/scp'
125
123
  # download a file from a remote server
126
- #::Net::SCP.start(@hostname, @vm_user, :password => @vm_pass) do |scp|
127
- # scp.download!(from,to)
128
- #end
124
+ ::Net::SCP.start(@hostname, @vm_user, :password => @vm_pass) do |scp|
125
+ scp.download!(from,to)
126
+ end
129
127
 
130
- system_command("scp #{@vm_user}@#{@hostname}:#{remote} #{local}")
131
-
128
+ #system_command("scp #{@vm_user}@#{@hostname}:#{remote} #{local}")
132
129
  end
133
130
 
134
131
  def ssh_exec(command)
135
-
136
- ::Net::SSH.start(@hostname, @vm_user, :password => @vm_pass) do |ssh|
132
+
133
+ puts "DEBUG: ssh command: #{command}"
134
+
135
+ Net::SSH.start(@hostname, @vm_user, :password => @vm_pass) do |ssh|
137
136
  result = ssh.exec!(command)
138
137
  end
139
138
 
@@ -166,7 +165,7 @@ private
166
165
  # the ability to still run clean (controlled entirely by us)
167
166
  # command lines.
168
167
  def system_command(command)
169
- #puts "DEBUG: system command #{command}"
168
+ puts "DEBUG: system command #{command}"
170
169
  system(command)
171
170
  end
172
171
 
data/lib/lab/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lab
2
- VERSION = "0.0.6"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -21,6 +21,9 @@ require 'controllers'
21
21
  require 'drivers'
22
22
  require 'modifiers'
23
23
 
24
+ require 'net/scp'
25
+ require 'net/ssh'
26
+
24
27
  module Lab
25
28
  module Controllers
26
29
  class VmController
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &16117340 !ruby/object:Gem::Requirement
16
+ requirement: &21378460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,11 +21,34 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *16117340
25
- description: Start/Stop/Revert and do other cool stuff w/ Vmware, Virtualbox, and
26
- ESXi vms
24
+ version_requirements: *21378460
25
+ - !ruby/object:Gem::Dependency
26
+ name: net-ssh
27
+ requirement: &21378040 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *21378040
36
+ - !ruby/object:Gem::Dependency
37
+ name: net-scp
38
+ requirement: &21377620 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *21377620
47
+ description: ! 'Start/Stop/Revert and do other cool stuff w/ Vmware, Virtualbox, and
48
+ ESXi vms. This gem wraps common CLI utilities and other gems to create a common
49
+ inteface for vms. '
27
50
  email:
28
- - jcran@pentestify.com
51
+ - jcran@rapid7.com
29
52
  executables: []
30
53
  extensions: []
31
54
  extra_rdoc_files: []
@@ -35,7 +58,6 @@ files:
35
58
  - README.md
36
59
  - Rakefile
37
60
  - TODO
38
- - lab.gemspec
39
61
  - lib/lab.rb
40
62
  - lib/lab/controller/dynagen_controller.rb
41
63
  - lib/lab/controller/fog_controller.rb
@@ -62,7 +84,7 @@ files:
62
84
  - lib/lab/vm.rb
63
85
  - lib/lab/vm_controller.rb
64
86
  - test/.gitkeep
65
- homepage: http://www.pentestify.com/projects/lab
87
+ homepage: http://www.github.com/rapid7/lab/wiki
66
88
  licenses: []
67
89
  post_install_message:
68
90
  rdoc_options: []
@@ -85,5 +107,5 @@ rubyforge_project: lab
85
107
  rubygems_version: 1.8.10
86
108
  signing_key:
87
109
  specification_version: 3
88
- summary: Manage vms like a boss.
110
+ summary: Manage VMs like a boss
89
111
  test_files: []
data/lab.gemspec DELETED
@@ -1,24 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "lab/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "lab"
7
- s.version = Lab::VERSION
8
- s.authors = ["Jonathan Cran"]
9
- s.email = ["jcran@pentestify.com"]
10
- s.homepage = "http://www.pentestify.com/projects/lab"
11
- s.summary = %q{Manage vms like a boss.}
12
- s.description = %q{Start/Stop/Revert and do other cool stuff w/ Vmware, Virtualbox, and ESXi vms}
13
-
14
- s.rubyforge_project = "lab"
15
-
16
- s.files = `git ls-files`.split("\n")
17
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
- s.require_paths = ["lib"]
20
-
21
- # specify any dependencies here; for example:
22
- # s.add_development_dependency "rspec"
23
- s.add_runtime_dependency "nokogiri"
24
- end