vagrant-snap 0.06 → 0.08

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.
@@ -0,0 +1,9 @@
1
+ * 0.08
2
+ 2011-07-18
3
+ * No change but only increment version number for mistake in release.
4
+ * 0.07
5
+ 2011-07-18
6
+ * snapshot name is now start from 0 instead of 001 for less key stroke.
7
+ 2011-07-18 Fix following bug, thanks to Ches Martin
8
+ * Trying to create a snap with a name given when no previous snapshots exist failed.
9
+ * Spaces in the name of a VM or in a snapshot name passed as -n 'initial build' caused failures.
data/Manifest CHANGED
@@ -3,5 +3,6 @@ Manifest
3
3
  README.md
4
4
  Rakefile
5
5
  VERSION
6
+ CHANGELOG
6
7
  lib/vagrant_init.rb
7
8
  lib/vagrant_snap.rb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.06
1
+ 0.08
@@ -7,9 +7,9 @@ module Snap
7
7
  def tree
8
8
  @@tree
9
9
  end
10
-
10
+
11
11
  Snap = Struct.new(:name, :time_stamp, :description, :uuid, :current)
12
-
12
+
13
13
  def init
14
14
  @@current = nil
15
15
  @@tree = nil
@@ -69,6 +69,7 @@ module Snap
69
69
  end
70
70
 
71
71
  def include?(name)
72
+ return false unless tree
72
73
  tree.flatten.map(&:name).include? name
73
74
  end
74
75
 
@@ -90,8 +91,8 @@ module Snap
90
91
  end #}}}
91
92
  end
92
93
 
93
- class Command < Vagrant::Command::GroupBase
94
- register "snap","Manages a snap"
94
+ class Command < Vagrant::Command::GroupBase
95
+ register "snap","Manages a snap"
95
96
 
96
97
  no_tasks {
97
98
  def env
@@ -113,8 +114,8 @@ module Snap
113
114
  end
114
115
  }
115
116
 
116
- desc "list", "list snapshot"
117
- def list(target=nil)
117
+ desc "list", "list snapshot"
118
+ def list(target=nil)
118
119
  with_target(target) do |vmname, vagvmname|
119
120
  puts "[#{vagvmname}]"
120
121
  VBox::SnapShot.parse_tree( vmname )
@@ -125,10 +126,10 @@ module Snap
125
126
  end
126
127
  puts result
127
128
  end
128
- end
129
+ end
129
130
 
130
- desc "go SNAP_NAME", "go to specified snapshot"
131
- def go(snapshot_name, target=nil)
131
+ desc "go SNAP_NAME", "go to specified snapshot"
132
+ def go(snapshot_name, target=nil)
132
133
  with_target(target) do |vmname, vagvmname|
133
134
  puts "[#{vagvmname}]"
134
135
  VBox::SnapShot.parse_tree( vmname )
@@ -140,22 +141,22 @@ module Snap
140
141
  warn "#{snapshot_name} is not exist".red
141
142
  end
142
143
  end
143
- end
144
+ end
144
145
 
145
- desc "back", "back to current snapshot"
146
- def back(target=nil)
146
+ desc "back", "back to current snapshot"
147
+ def back(target=nil)
147
148
  with_target(target) do |vmname, vagvmname|
148
149
  puts "[#{vagvmname}]"
149
150
  system "VBoxManage controlvm #{vmname} poweroff"
150
151
  system "VBoxManage snapshot #{vmname} restorecurrent"
151
152
  system "VBoxManage startvm #{vmname} --type headless"
152
153
  end
153
- end
154
+ end
154
155
 
155
- desc "take [TARGET] [-n SNAP_NAME] [-d DESC]", "take snapshot"
156
+ desc "take [TARGET] [-n SNAP_NAME] [-d DESC]", "take snapshot"
156
157
  method_option :desc, :type => :string, :aliases => "-d"
157
158
  method_option :name, :type => :string, :aliases => "-n"
158
- def take(target=nil)
159
+ def take(target=nil)
159
160
  with_target(target) do |vmname, vagvmname|
160
161
  puts "[#{vagvmname}]"
161
162
  VBox::SnapShot.parse_tree( vmname )
@@ -170,7 +171,7 @@ module Snap
170
171
  unless new_name
171
172
  lastname = VBox::SnapShot.lastname
172
173
  new_name = if lastname.nil?
173
- "001"
174
+ "0"
174
175
  else
175
176
  n = lastname.succ
176
177
  n = n.succ while VBox::SnapShot.include? n
@@ -178,12 +179,12 @@ module Snap
178
179
  end
179
180
  end
180
181
  desc = options.desc ? " --description '#{options.desc}'" : ""
181
- system "VBoxManage snapshot #{vmname} take #{new_name} #{desc} --pause"
182
+ system "VBoxManage snapshot '#{vmname}' take '#{new_name}' #{desc} --pause"
182
183
  end
183
- end
184
+ end
184
185
 
185
- desc "delete SNAP_NAME", "delete snapshot"
186
- def delete(snapshot_name, target=nil)
186
+ desc "delete SNAP_NAME", "delete snapshot"
187
+ def delete(snapshot_name, target=nil)
187
188
  with_target(target) do |vmname, vagvmname|
188
189
  puts "[#{vagvmname}]"
189
190
  VBox::SnapShot.parse_tree( vmname )
@@ -193,6 +194,6 @@ module Snap
193
194
  warn "#{snapshot_name} is not exist".red
194
195
  end
195
196
  end
196
- end
197
- end
197
+ end
198
+ end
198
199
  end
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{vagrant-snap}
5
- s.version = "0.06"
5
+ s.version = "0.08"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["t9md"]
9
- s.date = %q{2011-06-08}
9
+ s.date = %q{2011-07-18}
10
10
  s.description = %q{vagrant snapshot managemen plugin}
11
11
  s.email = %q{taqumd@gmail.com}
12
- s.extra_rdoc_files = ["LICENSE.txt", "README.md", "lib/vagrant_init.rb", "lib/vagrant_snap.rb"]
13
- s.files = ["LICENSE.txt", "Manifest", "README.md", "Rakefile", "VERSION", "lib/vagrant_init.rb", "lib/vagrant_snap.rb", "vagrant-snap.gemspec"]
12
+ s.extra_rdoc_files = ["LICENSE.txt", "README.md", "CHANGELOG", "lib/vagrant_init.rb", "lib/vagrant_snap.rb"]
13
+ s.files = ["LICENSE.txt", "Manifest", "README.md", "Rakefile", "VERSION", "CHANGELOG", "lib/vagrant_init.rb", "lib/vagrant_snap.rb", "vagrant-snap.gemspec"]
14
14
  s.homepage = %q{http://github.com/t9md/vagrant-snap}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Vagrant-snap", "--main", "README.md"]
16
16
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-snap
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 6
9
- version: "0.06"
8
+ - 8
9
+ version: "0.08"
10
10
  platform: ruby
11
11
  authors:
12
12
  - t9md
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-06-08 00:00:00 +09:00
17
+ date: 2011-07-18 00:00:00 +09:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -54,6 +54,7 @@ extensions: []
54
54
  extra_rdoc_files:
55
55
  - LICENSE.txt
56
56
  - README.md
57
+ - CHANGELOG
57
58
  - lib/vagrant_init.rb
58
59
  - lib/vagrant_snap.rb
59
60
  files:
@@ -62,6 +63,7 @@ files:
62
63
  - README.md
63
64
  - Rakefile
64
65
  - VERSION
66
+ - CHANGELOG
65
67
  - lib/vagrant_init.rb
66
68
  - lib/vagrant_snap.rb
67
69
  - vagrant-snap.gemspec