sahara 0.0.10 → 0.0.11
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 +4 -4
- data/README.md +9 -1
- data/lib/sahara/session.rb +8 -8
- data/lib/sahara/version.rb +1 -1
- data/sahara.gemspec +1 -2
- metadata +7 -7
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sahara (0.0.
|
4
|
+
sahara (0.0.11)
|
5
5
|
popen4 (~> 0.1.2)
|
6
6
|
thor (~> 0.14.6)
|
7
|
-
vagrant (~> 0
|
7
|
+
vagrant (~> 1.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
@@ -27,9 +27,9 @@ GEM
|
|
27
27
|
open4 (>= 0.4.0)
|
28
28
|
rake (0.9.2.2)
|
29
29
|
thor (0.14.6)
|
30
|
-
vagrant (0.
|
30
|
+
vagrant (1.0.2)
|
31
31
|
archive-tar-minitar (= 0.5.2)
|
32
|
-
childprocess (~> 0.3.
|
32
|
+
childprocess (~> 0.3.1)
|
33
33
|
erubis (~> 2.7.0)
|
34
34
|
i18n (~> 0.6.0)
|
35
35
|
json (~> 1.5.1)
|
data/README.md
CHANGED
@@ -16,4 +16,12 @@ Many kudos go to the creators of [vagrant](http://vagrantup.com)
|
|
16
16
|
|
17
17
|
This is now available as gem:
|
18
18
|
|
19
|
-
<pre>gem install sahara</pre>
|
19
|
+
<pre>gem install sahara</pre>
|
20
|
+
|
21
|
+
# Windows Notes
|
22
|
+
|
23
|
+
It works on Windows, but you need to have:
|
24
|
+
|
25
|
+
- Vagrant 1.0.x installed (with patch for [issue#817](https://github.com/mitchellh/vagrant/issues/817))
|
26
|
+
- VBoxManage.exe in the PATH <pre>set PATH=C:\Program Files\Oracle\VirtualBox\;%PATH%</pre>
|
27
|
+
- grep.exe and cut.exe in the PATH: <pre>set PATH=D:\vagrant\embedded\bin;%PATH%</pre>
|
data/lib/sahara/session.rb
CHANGED
@@ -40,7 +40,7 @@ module Sahara
|
|
40
40
|
#Creating a snapshot
|
41
41
|
puts "[#{boxname}] - Enabling sandbox"
|
42
42
|
|
43
|
-
execute("#{@vboxcmd} snapshot
|
43
|
+
execute("#{@vboxcmd} snapshot \"#{instance_uuid}\" take \"#{@sandboxname}\" --pause")
|
44
44
|
end
|
45
45
|
|
46
46
|
end
|
@@ -59,12 +59,12 @@ module Sahara
|
|
59
59
|
|
60
60
|
#Discard snapshot so current state is the latest state
|
61
61
|
puts "[#{boxname}] - unwinding sandbox"
|
62
|
-
execute("#{@vboxcmd} snapshot
|
62
|
+
execute("#{@vboxcmd} snapshot \"#{instance_uuid}\" delete \"#{@sandboxname}\"")
|
63
63
|
|
64
64
|
#Now retake the snapshot
|
65
65
|
puts "[#{boxname}] - fastforwarding sandbox"
|
66
66
|
|
67
|
-
execute("#{@vboxcmd} snapshot
|
67
|
+
execute("#{@vboxcmd} snapshot \"#{instance_uuid}\" take \"#{@sandboxname}\" --pause")
|
68
68
|
|
69
69
|
end
|
70
70
|
|
@@ -85,7 +85,7 @@ module Sahara
|
|
85
85
|
puts "[#{boxname}] - powering off machine"
|
86
86
|
|
87
87
|
#Poweroff machine
|
88
|
-
execute("#{@vboxcmd} controlvm
|
88
|
+
execute("#{@vboxcmd} controlvm \"#{instance_uuid}\" poweroff")
|
89
89
|
|
90
90
|
#Poweroff takes a second or so to complete; Virtualbox will throw errors
|
91
91
|
#if you try to restore a snapshot before it's ready.
|
@@ -94,7 +94,7 @@ module Sahara
|
|
94
94
|
puts "[#{boxname}] - roll back machine"
|
95
95
|
|
96
96
|
#Rollback until snapshot
|
97
|
-
execute("#{@vboxcmd} snapshot
|
97
|
+
execute("#{@vboxcmd} snapshot \"#{instance_uuid}\" restore \"#{@sandboxname}\"")
|
98
98
|
|
99
99
|
puts "[#{boxname}] - starting the machine again"
|
100
100
|
|
@@ -115,7 +115,7 @@ module Sahara
|
|
115
115
|
boot_mode='headless'
|
116
116
|
end
|
117
117
|
|
118
|
-
execute("#{@vboxcmd} startvm --type #{boot_mode}
|
118
|
+
execute("#{@vboxcmd} startvm --type #{boot_mode} \"#{instance_uuid}\" ")
|
119
119
|
|
120
120
|
end
|
121
121
|
|
@@ -140,7 +140,7 @@ module Sahara
|
|
140
140
|
# We might wanna check for sandbox changes or not
|
141
141
|
|
142
142
|
#Discard snapshot
|
143
|
-
execute("#{@vboxcmd} snapshot
|
143
|
+
execute("#{@vboxcmd} snapshot \"#{instance_uuid}\" delete \"#{@sandboxname}\" ")
|
144
144
|
|
145
145
|
end
|
146
146
|
|
@@ -166,7 +166,7 @@ module Sahara
|
|
166
166
|
|
167
167
|
instance_uuid="#{@vagrant_env.vms[boxname.to_sym].uuid}"
|
168
168
|
snapshotlist=Array.new
|
169
|
-
snapshotresult=execute("#{@vboxcmd} showvminfo --machinereadable
|
169
|
+
snapshotresult=execute("#{@vboxcmd} showvminfo --machinereadable \"#{instance_uuid}\" |grep ^SnapshotName| cut -d '=' -f 2")
|
170
170
|
snapshotresult.each do |result|
|
171
171
|
clean=result.gsub(/\"/,'').chomp
|
172
172
|
snapshotlist << clean
|
data/lib/sahara/version.rb
CHANGED
data/sahara.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.required_rubygems_version = ">= 1.3.6"
|
15
15
|
s.rubyforge_project = "sahara"
|
16
16
|
|
17
|
-
s.add_dependency "vagrant", "~> 0
|
17
|
+
s.add_dependency "vagrant", "~> 1.0"
|
18
18
|
s.add_dependency "popen4", "~> 0.1.2"
|
19
19
|
s.add_dependency "thor", "~> 0.14.6"
|
20
20
|
|
@@ -24,4 +24,3 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
25
25
|
s.require_path = 'lib'
|
26
26
|
end
|
27
|
-
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sahara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 11
|
10
|
+
version: 0.0.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Patrick Debois
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-03-27 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
type: :runtime
|
@@ -24,11 +24,11 @@ dependencies:
|
|
24
24
|
requirements:
|
25
25
|
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
hash:
|
27
|
+
hash: 15
|
28
28
|
segments:
|
29
|
+
- 1
|
29
30
|
- 0
|
30
|
-
|
31
|
-
version: "0.9"
|
31
|
+
version: "1.0"
|
32
32
|
prerelease: false
|
33
33
|
name: vagrant
|
34
34
|
version_requirements: *id001
|