vagrantomatic 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e87545b4ceeb2375b37856c107092824afb24dca
4
- data.tar.gz: 9b2b57f73f09c98bf7164e5c29a8577ca6725064
3
+ metadata.gz: 234b0d7ded1e1f98b99b41372bd7efd7531a907e
4
+ data.tar.gz: f525a014bdf3210f5d8f0f3e1ab2cc1f539a2495
5
5
  SHA512:
6
- metadata.gz: 4be7d934d5e2dccd1072c6f9b5a3950b4758cb643b262448909fe8ec66ef6a576bab1210e9f1ad5e4950e95c2a9a43406e72d7612dcf2a6770fe82d9bab942e5
7
- data.tar.gz: dc7fa3a0ce1fed4c334cfd29cdcef9ffc5f3eec9461c977e18b9f539bc89c900075289973d0338dc92db91058552728e3f5d48b4525c5e5694fa8ed5ad0186b2
6
+ metadata.gz: 8eba14c17ac825c4a7c35f5654a59226ce38149c8cc147354629d491ea555ac182bbb5bbb3942cccb310e779bd42abc93d3570e89ac17ed18c0291de31d05c77
7
+ data.tar.gz: 2335da8d2ba1c8e5e81ec18036d7301ace216d0f3c30c28236e05703cbf22d6515f3cb1e1f4889526c87f57ada716327a7aa3e847b116973773665b0981374bf
@@ -137,19 +137,27 @@ module Vagrantomatic
137
137
  execute_and_log(:reload)
138
138
  end
139
139
 
140
+ def reset
141
+ execute_and_log(:destroy)
142
+ execute_and_log(:up)
143
+ end
144
+
140
145
  def run(command)
141
146
  # arrayify
142
147
  command = [command]
143
-
144
- # throw the command over the wall to derelect whatever the state of instance
145
148
  command.unshift("-c")
149
+
146
150
  messages = []
147
151
  vm = get_vm
152
+ # throw the command over the wall to derelect whatever the state of instance
153
+ # for now just support ssh - for windows we could do `powershell -c` or
154
+ # maybe even winRM
148
155
  executor = vm.execute(:ssh, command) { |stdout,stderr|
149
- @logger.debug "#{stdout}#{stderr}"
150
- messages << stdout << stderr
156
+ @logger.debug "#{stdout}#{stderr}".strip
157
+ messages << "#{stdout}#{stderr}".strip
151
158
  }
152
- { :status => executor.status, :messages => messages}
159
+ @logger.info("command '#{command}' resulted in #{messages.size} lines")
160
+ return executor.status, messages
153
161
  end
154
162
 
155
163
  end
@@ -10,7 +10,11 @@ module Vagrantomatic
10
10
  else
11
11
  @logger = ::Logger.new(STDOUT)
12
12
  @logger.formatter = proc do |severity, datetime, progname, msg|
13
- "#{severity}: #{msg}"
13
+ # depending on the source, some messages come in with new lines and
14
+ # some do not so strip off any exiting and then add our own for
15
+ # consistency
16
+ msg = msg.strip
17
+ "#{severity}: #{msg}\n"
14
18
  end
15
19
  end
16
20
  end
@@ -48,7 +48,7 @@ module Vagrantomatic
48
48
  end
49
49
 
50
50
  def instance(name)
51
- ::Vagrantomatic::Instance.new(@vagrant_vm_dir, name)
51
+ ::Vagrantomatic::Instance.new(@vagrant_vm_dir, name, logger: @logger)
52
52
  end
53
53
 
54
54
  end
@@ -1,3 +1,3 @@
1
1
  module Vagrantomatic
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrantomatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Williams
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-10 00:00:00.000000000 Z
11
+ date: 2017-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler