oswitch 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/oswitch.rb +11 -7
- data/oswitch.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bde84f91e815e002f15c9427f385fcdaecc3dfd
|
4
|
+
data.tar.gz: 3feed23cc87a21c9c367086db2a5d699807b9c2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd0562b5a9c4aff52e3bd2d8103289978d40014dd431910ed8dfab28310972122f114006f93fbd44acc7e3634664e7c78f3fdc86c5386a9f76f4b58d8ee98cd8
|
7
|
+
data.tar.gz: 3f848cd7d793a626860a77347939b8812b72f42dfbf8f6bb0daaeb82764b904fe23bc9ab09b0b1618972d9292c1af59795440fc50a09795b4f40f8f216395614
|
data/lib/oswitch.rb
CHANGED
@@ -144,11 +144,15 @@ class OSwitch
|
|
144
144
|
private :new
|
145
145
|
|
146
146
|
def packages
|
147
|
-
Dir["#{DOTDIR}/*"].
|
148
|
-
select {|
|
149
|
-
|
150
|
-
|
151
|
-
|
147
|
+
Dir["#{DOTDIR}/*"].map do |rep|
|
148
|
+
pkgs = Dir["#{rep}/*"].select {|pkg| File.directory?(pkg)}
|
149
|
+
pkgs = [rep] if pkgs.empty?
|
150
|
+
pkgs
|
151
|
+
end.
|
152
|
+
flatten.
|
153
|
+
map {|pkg|
|
154
|
+
pkg.gsub("#{DOTDIR}/", '')
|
155
|
+
}
|
152
156
|
end
|
153
157
|
end
|
154
158
|
|
@@ -176,9 +180,9 @@ class OSwitch
|
|
176
180
|
" -w #{cwd} #{mountargs} #{imgname} "
|
177
181
|
if command.empty?
|
178
182
|
# Display motd and run interactive shell.
|
179
|
-
cmdline << "
|
183
|
+
cmdline << "\"echo #{motd}; #{shell} -i\""
|
180
184
|
else
|
181
|
-
cmdline << "
|
185
|
+
cmdline << "\"#{command}\""
|
182
186
|
end
|
183
187
|
Kernel.exec cmdline
|
184
188
|
end
|
data/oswitch.gemspec
CHANGED