vmserver 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/vmserver.rb +43 -2
  3. data/vmserver.gemspec +2 -2
  4. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
data/lib/vmserver.rb CHANGED
@@ -103,7 +103,48 @@ class VMServer
103
103
  result
104
104
  end
105
105
 
106
-
106
+
107
+ # -------------------------------------- VM Server Snapshots -------------------------------------------------
108
+
109
+ ##
110
+ # Take a snapshot of the Virtual Machine
111
+
112
+ def snapshot(name="snapshot_#{Time.now.strftime("%m%d")}")
113
+ command = 'snapshot'
114
+ vm_command = "#{@base_command} #{command} \'#{@datastore}\' #{name}"
115
+ log vm_command
116
+ result = system(vm_command)
117
+ result ? log("SnapShot successful") : log("Error! VM SnapShot failed.")
118
+ result
119
+ end
120
+
121
+
122
+ ##
123
+ # Revert to previous snapshot
124
+
125
+ def revert_to_snapshot(name)
126
+ command = 'revertToSnapshot'
127
+ vm_command = "#{@base_command} #{command} \'#{@datastore}\' #{name}"
128
+ log vm_command
129
+ result = system(vm_command)
130
+ result ? log("Revert SnapShot successful") : log("Error! VM Revert SnapShot failed.")
131
+ result
132
+ end
133
+
134
+
135
+ ##
136
+ # Delete snapshot of the Virtual Machine
137
+
138
+ def delete_snapshot(name)
139
+ command = 'deleteSnapshot'
140
+ vm_command = "#{@base_command} #{command} \'#{@datastore}\' #{name}"
141
+ log vm_command
142
+ result = system(vm_command)
143
+ result ? log("SnapShot deleted successful") : log("Error! VM SnapShot delete failed.")
144
+ result
145
+ end
146
+
147
+
107
148
  # -------------------------------------- Working with Files and Directory in Guest OS -------------------------
108
149
  #
109
150
  ##
@@ -214,7 +255,7 @@ class VMServer
214
255
  def run_program_in_guest(program,prog_args={})
215
256
  command = 'runProgramInGuest'
216
257
  prog_args = prog_args[:prog_args]
217
- vm_command = "#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} \'#{@datastore}\' -activeWindow #{program} #{prog_args}"
258
+ vm_command = "#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} \'#{@datastore}\' -activeWindow \'#{program}\' #{prog_args}"
218
259
  log vm_command
219
260
  result = system(vm_command)
220
261
  result ? log("Program executed successfully in guest.") : log("Error! Failed to execute program in guest.")
data/vmserver.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{vmserver}
8
- s.version = "0.2.0"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sriram Varahan"]
12
- s.date = %q{2010-08-26}
12
+ s.date = %q{2010-08-27}
13
13
  s.description = %q{This gem simplifies the interaction of ruby code with VMServer. You need to have VMServer installed and running to use this gem.}
14
14
  s.email = %q{sriram.varahan@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmserver
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 0.2.0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sriram Varahan
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-26 00:00:00 +05:30
18
+ date: 2010-08-27 00:00:00 +05:30
19
19
  default_executable:
20
20
  dependencies: []
21
21