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 +4 -4
- data/lib/vagrantomatic/instance.rb +13 -5
- data/lib/vagrantomatic/logger.rb +5 -1
- data/lib/vagrantomatic/vagrantomatic.rb +1 -1
- data/lib/vagrantomatic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 234b0d7ded1e1f98b99b41372bd7efd7531a907e
|
4
|
+
data.tar.gz: f525a014bdf3210f5d8f0f3e1ab2cc1f539a2495
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
156
|
+
@logger.debug "#{stdout}#{stderr}".strip
|
157
|
+
messages << "#{stdout}#{stderr}".strip
|
151
158
|
}
|
152
|
-
{
|
159
|
+
@logger.info("command '#{command}' resulted in #{messages.size} lines")
|
160
|
+
return executor.status, messages
|
153
161
|
end
|
154
162
|
|
155
163
|
end
|
data/lib/vagrantomatic/logger.rb
CHANGED
@@ -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
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2017-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|