cucumber-chef 2.1.0.rc.9 → 2.1.0.rc.10

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.
@@ -27,7 +27,7 @@ module Cucumber
27
27
  class Vagrant
28
28
  # attr_accessor :env, :vm
29
29
 
30
- INVALID_STATES = %w(not_created aborted).map(&:to_sym)
30
+ INVALID_STATES = %w(not_created aborted unknown).map(&:to_sym)
31
31
  RUNNING_STATES = %w(running).map(&:to_sym)
32
32
  SHUTDOWN_STATES = %w(paused saved poweroff).map(&:to_sym)
33
33
  VALID_STATES = RUNNING_STATES+SHUTDOWN_STATES
@@ -131,7 +131,7 @@ module Cucumber
131
131
  ################################################################################
132
132
 
133
133
  def exists?
134
- ((self.vagrant_cli("status").output =~ /not created/) ? false : true)
134
+ (self.state != :not_created)
135
135
  end
136
136
 
137
137
  def alive?
@@ -150,8 +150,15 @@ module Cucumber
150
150
  end
151
151
 
152
152
  def state
153
- # @vm.state.to_sym
154
- "unknown"
153
+ output = self.vagrant_cli("status").output
154
+ result = :unknown
155
+ (VALID_STATES+INVALID_STATES).each do |state|
156
+ if output =~ /#{state}/
157
+ result = state
158
+ break
159
+ end
160
+ end
161
+ result.to_sym
155
162
  end
156
163
 
157
164
  def username
@@ -24,7 +24,7 @@ module Cucumber
24
24
 
25
25
  ################################################################################
26
26
 
27
- VERSION = "2.1.0.rc.9" unless const_defined?(:VERSION)
27
+ VERSION = "2.1.0.rc.10" unless const_defined?(:VERSION)
28
28
 
29
29
  ################################################################################
30
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0.rc.9
4
+ version: 2.1.0.rc.10
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: