vagrant-global-status 0.1.2 → 0.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 537baddc988bd9bc449f111ee8c94bd8d9118f4e
4
- data.tar.gz: e1cc113d0b12dde7f9681e43098719fd103cd1e4
3
+ metadata.gz: b9b82bce8f896bb501164ce0b72d72f1b8639a1a
4
+ data.tar.gz: 6f4f74901453aaf4eabdc161da4e1c1a61f932d2
5
5
  SHA512:
6
- metadata.gz: c02f39254ac1810c76146130caa2a1ec3290ba3263b7ad89d46b878bf7c62685edb18ba09f9d8230f6888ed980d8b8dce25cec65ddf863683701aac4e84a036b
7
- data.tar.gz: cdfda8597da46b9348bd44fcdc0b78ae48932faaab6e40cd0c5c7256064474842cfdb4199e90d8ceca808af3b136ca87e8b572a82f0fca4dddd2a24a2e360155
6
+ metadata.gz: 6338106b306084a6024dd9a91d05f70a229015df55224a0e570615e2a967b302b7511cc237c8fcea3d01e6deedf23f030ad43ff656c8adc21b6be8fe7ec94c25
7
+ data.tar.gz: 375195848f9a539a98a026a3e5ed8c9c55a43b270bd8d7e18643a0d2d097fd5986052a6c55fee635e8531614953e13feaffbc4a6818a66376d0b8e72415ff392
@@ -1,8 +1,13 @@
1
- ## [0.1.2](https://github.com/fgrehm/vagrant-lxc/compare/v0.1.0...v0.1.1) (December 3, 2013)
1
+ ## [0.1.3](https://github.com/fgrehm/vagrant-global-status/compare/v0.1.2...v0.1.3) (December 17, 2013)
2
+
3
+ - Stop displaying non-running machines without -a option [GH-1]
4
+ - Remove non-existent entries from machine-environments.json automatically [GH-4]
5
+
6
+ ## [0.1.2](https://github.com/fgrehm/vagrant-global-status/compare/v0.1.1...v0.1.2) (December 3, 2013)
2
7
 
3
8
  - Nicely handle Multibyte path names [GH-5]
4
9
 
5
- ## [0.1.1](https://github.com/fgrehm/vagrant-lxc/compare/v0.0.3...v0.1.0) (March 27, 2013)
10
+ ## [0.1.1](https://github.com/fgrehm/vagrant-global-status/compare/v0.1.0...v0.1.1) (March 27, 2013)
6
11
 
7
12
  - Nicely handle removed directories [GH-2]
8
13
 
@@ -31,7 +31,7 @@ GIT
31
31
  PATH
32
32
  remote: .
33
33
  specs:
34
- vagrant-global-status (0.1.2)
34
+ vagrant-global-status (0.1.3.dev)
35
35
 
36
36
  GEM
37
37
  remote: https://rubygems.org/
@@ -19,8 +19,11 @@ module VagrantPlugins
19
19
 
20
20
  registry = GlobalRegistry.new(@env.home_path.join('machine-environments.json'))
21
21
  registry.environments.each do |env|
22
- @env.ui.info "\n#{env.path}"
23
- @env.ui.info "#{env.status(options[:all])}"
22
+ status = "#{env.status(options[:all])}"
23
+ if not status == ""
24
+ @env.ui.info "\n#{env.path}"
25
+ @env.ui.info status
26
+ end
24
27
  end
25
28
 
26
29
  0
@@ -16,7 +16,7 @@ module VagrantPlugins
16
16
 
17
17
  matches = vagrant_status.scan(/(\w[\w-]+)\s+(\w[\w\s]+)\s+\((\w+)\)/)
18
18
  matches.map do |vm, status, provider|
19
- if all || @machine_names.include?(vm)
19
+ if all || (@machine_names.include?(vm) and status == "running")
20
20
  " #{vm.ljust(15)} #{status} (#{provider})"
21
21
  end
22
22
  end.compact.join("\n")
@@ -21,10 +21,11 @@ module VagrantPlugins
21
21
 
22
22
  def initialize(statefile)
23
23
  @statefile = statefile
24
- @current_state = if @statefile.file?
25
- JSON.parse(@statefile.read(:encoding => Encoding::UTF_8))
24
+ if @statefile.file?
25
+ @current_state = JSON.parse(@statefile.read(:encoding => Encoding::UTF_8))
26
+ fix_current_status
26
27
  else
27
- { 'environments' => {} }
28
+ @current_state = { 'environments' => {} }
28
29
  end
29
30
  end
30
31
 
@@ -57,6 +58,15 @@ module VagrantPlugins
57
58
  write_statefile
58
59
  end
59
60
 
61
+ def fix_current_status
62
+ @current_state['environments'].each_with_object({}) do |(env, data), hash|
63
+ if not File.exist? env or not File.exist? env + "/Vagrantfile"
64
+ @current_state['environments'].delete(env)
65
+ end
66
+ end
67
+ write_statefile
68
+ end
69
+
60
70
  private
61
71
 
62
72
  def write_statefile
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module GlobalStatus
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-global-status
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Rehm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-03 00:00:00.000000000 Z
11
+ date: 2013-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -81,8 +81,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  version: '0'
82
82
  requirements: []
83
83
  rubyforge_project:
84
- rubygems_version: 2.1.5
84
+ rubygems_version: 2.0.6
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: Find out the status of all of the Vagrant VMs you manage
88
88
  test_files: []
89
+ has_rdoc: