vmserver 0.3.5 → 0.3.6

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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/vmserver.rb +10 -10
  3. data/vmserver.gemspec +1 -1
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.5
1
+ 0.3.6
@@ -152,7 +152,7 @@ class VMServer
152
152
 
153
153
  def mkdir(dir)
154
154
  command = 'createDirectoryInGuest'
155
- vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" '#{dir}'}
155
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" "#{dir}"}
156
156
  log vm_command
157
157
  result = system(vm_command)
158
158
  result ? log("Directory created successfully in guest.") : log("Error! Directory could not be created.")
@@ -165,7 +165,7 @@ class VMServer
165
165
 
166
166
  def rmdir(dir)
167
167
  command = 'deleteDirectoryInGuest'
168
- vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" '#{dir}'}
168
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" "#{dir}"}
169
169
  log vm_command
170
170
  result = system(vm_command)
171
171
  result ? log("Directory deleted successfully.") : log("Error! Failed to delete directory.")
@@ -178,7 +178,7 @@ class VMServer
178
178
 
179
179
  def rmfile(file)
180
180
  command = 'deleteFileInGuest'
181
- vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" '#{file}'}
181
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" "#{file}"}
182
182
  log vm_command
183
183
  result = system(vm_command)
184
184
  result ? log("File deleted successfully.") : log("Error! Failed to delete file.")
@@ -191,7 +191,7 @@ class VMServer
191
191
 
192
192
  def ls(dir)
193
193
  command = 'listDirectoryInGuest'
194
- entries = `#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} \'#{@datastore}\' \'#{dir}\'`
194
+ entries = `#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} \"#{@datastore}\" \"#{dir}\"`
195
195
  # The entries would be a list of entries separated by new line. Convert this to an array.
196
196
  entries = entries.split("\n")
197
197
  entries
@@ -202,7 +202,7 @@ class VMServer
202
202
  # Checks if a file exists in the guest OS
203
203
 
204
204
  def file_exists_in_guest?(file)
205
- output = `#{@base_command} -gu #{@guest_user} -gp #{@guest_password} fileExistsInGuest "#{datastore}" '#{file}'`
205
+ output = `#{@base_command} -gu #{@guest_user} -gp #{@guest_password} fileExistsInGuest "#{datastore}" "#{file}"`
206
206
  # output = system(vm_command)
207
207
  if output =~ /The file exists/
208
208
  return true
@@ -217,7 +217,7 @@ class VMServer
217
217
 
218
218
  def copy_file_from_host_to_guest(src, dest)
219
219
  command = 'copyFileFromHostToGuest'
220
- vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" '#{src}' '#{dest}'}
220
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" "#{src}" "#{dest}"}
221
221
  log vm_command
222
222
  result = system(vm_command)
223
223
  result ? log("Copy successful.") : log("Error! Copy failed.")
@@ -230,7 +230,7 @@ class VMServer
230
230
 
231
231
  def copy_file_from_guest_to_host(src,dest)
232
232
  command = 'copyFileFromGuestToHost'
233
- vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" '#{src}' '#{dest}'}
233
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" "#{src}" "#{dest}"}
234
234
  log vm_command
235
235
  result = system(vm_command)
236
236
  result ? log("Copy successful.") : log("Error! Copy failed.")
@@ -243,7 +243,7 @@ class VMServer
243
243
 
244
244
  def get_processes_in_guest
245
245
  command = 'listProcessesInGuest'
246
- processes = `#{@base_command} -gu #{@guest_user} -gp #{guest_password} #{command} \'#{@datastore}\'`
246
+ processes = `#{@base_command} -gu #{@guest_user} -gp #{guest_password} #{command} \"#{@datastore}\"`
247
247
  processes
248
248
  end
249
249
 
@@ -254,7 +254,7 @@ class VMServer
254
254
  def run_program_in_guest(program,prog_args={})
255
255
  command = 'runProgramInGuest'
256
256
  prog_args = prog_args[:prog_args]
257
- vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" -activeWindow '#{program}' #{prog_args}}
257
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" -activeWindow "#{program}" #{prog_args}}
258
258
  log vm_command
259
259
  result = system(vm_command)
260
260
  result ? log("Program executed successfully in guest.") : log("Error! Failed to execute program in guest.")
@@ -280,7 +280,7 @@ class VMServer
280
280
 
281
281
  def capture_screen(output_file)
282
282
  command = 'captureScreen'
283
- vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" '#{output_file}'}
283
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} "#{@datastore}" "#{output_file}"}
284
284
  log vm_command
285
285
  result = system(vm_command)
286
286
  result ? log("File deleted successfully.") : log("Error! Failed to delete file.")
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{vmserver}
8
- s.version = "0.3.5"
8
+ s.version = "0.3.6"
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"]
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: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 5
10
- version: 0.3.5
9
+ - 6
10
+ version: 0.3.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sriram Varahan