oswitch 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/oswitch.rb +11 -7
  3. data/oswitch.gemspec +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bbe3ef281a84b86f6912113be364ff1db6c2732d
4
- data.tar.gz: 9abab4b1888052a8ad92c097dca8a238e743f7ea
3
+ metadata.gz: 6bde84f91e815e002f15c9427f385fcdaecc3dfd
4
+ data.tar.gz: 3feed23cc87a21c9c367086db2a5d699807b9c2f
5
5
  SHA512:
6
- metadata.gz: 702620d1e4c891b48ad70d846ec8c744e8f370cde50820f83035e86120357566030cb091b1036eb4449ef9e35aa5f9c0e2306285c0240938736f4e854b919e20
7
- data.tar.gz: f8a1ed6d3b66716f2bff1caad751f3f21421c76f7ecaafb8b26fc562077a045c7b0455103b9cb85c3298c474469bbe3b40718807f0accddc46932e79db8c562c
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 {|entry| File.directory? entry}.
149
- map {|pkg|
150
- pkg.gsub("#{DOTDIR}/", '')
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 << "#{shell} -c \"echo #{motd}; #{shell} -i\""
183
+ cmdline << "\"echo #{motd}; #{shell} -i\""
180
184
  else
181
- cmdline << "#{shell} -c \"#{command}\""
185
+ cmdline << "\"#{command}\""
182
186
  end
183
187
  Kernel.exec cmdline
184
188
  end
data/oswitch.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  # meta
3
3
  s.name = 'oswitch'
4
- s.version = '0.2.1'
4
+ s.version = '0.2.2'
5
5
  s.authors = ['Anurag Priyam', 'Bruno Vieira', 'Yannick Wurm']
6
6
  s.email = ['anurag08priyam@gmail.com']
7
7
  s.homepage = 'https://github.com/yeban/oswitch'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oswitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anurag Priyam