specinfra 0.3.1 → 0.3.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62817ce531572a444a7ddb053f70273d9edc65b4
4
- data.tar.gz: 76782c7e4aa98e1773fa93183fd51811bd125095
3
+ metadata.gz: ece2d3ebcdaf4b350c4d6cf055ee97ccde8a463e
4
+ data.tar.gz: ffd5b3944a6b80825c223e5bf7ea4243e8df1edd
5
5
  SHA512:
6
- metadata.gz: b331580ad78a8975549f9d76c5a5dd16505f3fc18ca43d7376a644d11c169d33a9cd2a1dfea4a320fbcf83fd95f37a34af698a104fb667734c51806454bfaf01
7
- data.tar.gz: 33405e454fbe91cddf69b16f151e346787a13448c1404de05b920cacf017c878588a2fe9b63fcbd9780a5e5a49048cb83900e0d5b4d15da6d5ead8b7bf02c5f0
6
+ metadata.gz: 2d9eb88d5b685a3022ff87d6da4abbe1ba99ab975efa02aff393e5aca05ef9c55f13bd941297f72af3ab3e85f8598e9765b3bb0d43b7935fd2b5f3cf68f2c86a
7
+ data.tar.gz: a2b43107e2d7e6e5b974852aeba201db255e0ead9700f13a83ea7660c5fa3721dc7524a49c6033a594ae9c4cb73131009c294ccf1984e8fae283dea7e203dc74
@@ -191,7 +191,18 @@ module SpecInfra
191
191
  elsif run_command('ls /etc/system-release')[:exit_status] == 0
192
192
  { :family => 'RedHat', :release => nil } # Amazon Linux
193
193
  elsif run_command('ls /etc/debian_version')[:exit_status] == 0
194
- distro = run_command("lsb_release -i | grep 'Distributor ID:' | awk '{print $3}'")[:stdout]
194
+ lsb_release = run_command("lsb_release -i")
195
+ if lsb_release[:exit_status] == 0
196
+ distro = $' if lsb_release[:stdout] =~ /:/
197
+ else
198
+ lsb_release = run_command("cat /etc/lsb-release")
199
+ if lsb_release[:exit_status] == 0
200
+ lsb_release[:stdout].each_line do |line|
201
+ distro = $' if line =~ /^DISTRIB_ID=/
202
+ end
203
+ end
204
+ end
205
+ distro ||= 'Debian'
195
206
  { :family => distro.strip, :release => nil }
196
207
  elsif run_command('ls /etc/gentoo-release')[:exit_status] == 0
197
208
  { :family => 'Gentoo', :release => nil }
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-13 00:00:00.000000000 Z
11
+ date: 2014-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler