specinfra 0.6.1 → 0.7.0

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: 4edf711fedec4ac8b873a6f3698ef68b792762d0
4
- data.tar.gz: 12d3b163ba24a99de3e37724860234ca02050207
3
+ metadata.gz: d7305e313da41e92515a147b79088c2fd10c5ec8
4
+ data.tar.gz: 73d74b156b1ffbc104058c3460a950981a8271f8
5
5
  SHA512:
6
- metadata.gz: c43bb18d55dfb26ee354efe87ea8207b2c1de0d3c12b7fd44c0cf3de4a7afec67f879cb555af77c6e256cea8ba1020c180de2e289f41ae3791dfbbf6a8556e22
7
- data.tar.gz: d83048aa45d2ade94d94dc546d16b0a9c09a0f3fb457e6cdb6b081ca25d5d5d587772e78c154ad07c502ef8ef78bacc8c8a143960b668dac1ae24243ccf13055
6
+ metadata.gz: 3154a2b02e09a6e0a202db602ae883835a46408f5b8dbc45bb4fa75829376c7bb29385762ed19b2dd4914a20bd20b221bb13ba4d60b58bf87957ca0320e74be8
7
+ data.tar.gz: 06efb9ba8734e8bc077f359cdcbf0a2d42f801b933be28228fac8997b77d683297b3761a7447d51469d498c02aa1de4bb84a78d413ad02ad10992d77e2c022cc
@@ -189,6 +189,12 @@ module SpecInfra
189
189
  { :family => 'RedHat', :release => release }
190
190
  elsif run_command('ls /etc/system-release').success?
191
191
  { :family => 'RedHat', :release => nil } # Amazon Linux
192
+ elsif run_command('ls /etc/SuSE-release').success?
193
+ line = run_command('cat /etc/SuSE-release').stdout
194
+ if line =~ /SUSE Linux Enterprise Server (\d+)/
195
+ release = $1
196
+ end
197
+ { :family => 'SuSE', :release => release }
192
198
  elsif run_command('ls /etc/debian_version').success?
193
199
  lsb_release = run_command("lsb_release -i")
194
200
  if lsb_release.success?
@@ -7,6 +7,7 @@ require "specinfra/command/ubuntu"
7
7
  require "specinfra/command/gentoo"
8
8
  require "specinfra/command/plamo"
9
9
  require "specinfra/command/redhat"
10
+ require "specinfra/command/suse"
10
11
 
11
12
  # Solaris
12
13
  require "specinfra/command/solaris"
@@ -0,0 +1,27 @@
1
+ module SpecInfra
2
+ module Command
3
+ class SuSE < Linux
4
+ def check_enabled(service, level=3)
5
+ "chkconfig --list #{escape(service)} | grep #{level}:on"
6
+ end
7
+
8
+ def check_installed(package,version=nil)
9
+ cmd = "rpm -q #{escape(package)}"
10
+ if version
11
+ cmd = "#{cmd} | grep -w -- #{escape(version)}"
12
+ end
13
+ cmd
14
+ end
15
+
16
+ alias :check_installed_by_rpm :check_installed
17
+
18
+ def install(package)
19
+ cmd = "zypper -n install #{package}"
20
+ end
21
+
22
+ def get_package_version(package, opts=nil)
23
+ "rpm -qi #{package} | grep Version | awk '{print $3}'"
24
+ end
25
+ end
26
+ end
27
+ end
@@ -10,6 +10,7 @@ module SpecInfra
10
10
  'Gentoo',
11
11
  'Plamo',
12
12
  'RedHat',
13
+ 'SuSE',
13
14
  'SmartOS',
14
15
  'Solaris',
15
16
  'Solaris10',
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "0.6.1"
2
+ VERSION = "0.7.0"
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.6.1
4
+ version: 0.7.0
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-02-22 00:00:00.000000000 Z
11
+ date: 2014-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -117,6 +117,7 @@ files:
117
117
  - lib/specinfra/command/solaris.rb
118
118
  - lib/specinfra/command/solaris10.rb
119
119
  - lib/specinfra/command/solaris11.rb
120
+ - lib/specinfra/command/suse.rb
120
121
  - lib/specinfra/command/ubuntu.rb
121
122
  - lib/specinfra/command/windows.rb
122
123
  - lib/specinfra/command_result.rb