specinfra 1.16.0 → 1.17.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: 9221619e2e00d7dffaebfda670799d5b7bed705b
4
- data.tar.gz: 705c63cb967646ab60eb7be4563a6bcfffa9589d
3
+ metadata.gz: 503cb07ff9fcc9ed440393c188c5d2fa2b450ea5
4
+ data.tar.gz: 698244c3d5ee408384a9ef267b85fedf5ae0d9b3
5
5
  SHA512:
6
- metadata.gz: d58f2342c2ea6b385e6c98e22b8c1820780f7a46772db9af00bcea6145b5bcc883d8b23ad4a0cc80a7f2888a939f72ca8c5f9d484e8f8927604f8e12d8662b38
7
- data.tar.gz: 4b73dfc35161b43d10acbd6b7627ce5d32810cb95c6690279f2a4963061758ccd96aa112fbb3f4837054412361902da4183c87a03b19a6d192c5d7b90e1af461
6
+ metadata.gz: 01aa282f36ffff21bd1dced28763206f9e2700a704119d392e394131ad64e283b9af5151cf216f0cd6d03f8383189b087fce1da97fb28c5fb90904535aa78ab1
7
+ data.tar.gz: 335d080054ee2a04987a5a21a35c03dbdee988b415403fb00d10e8a2f34c6d7232219cd1c29bcfdadc03591d1a1a07510f9d938a0d0464e4087a65ea856c8cd6
@@ -236,6 +236,8 @@ module SpecInfra
236
236
  { :family => 'Gentoo', :release => nil, :arch => arch }
237
237
  elsif run_command('ls /usr/lib/setup/Plamo-*').success?
238
238
  { :family => 'Plamo', :release => nil, :arch => arch }
239
+ elsif run_command('ls /var/run/current-system/sw').success?
240
+ { :family => 'NixOS', :release => nil, :arch => arch }
239
241
  elsif run_command('uname -s').stdout =~ /AIX/i
240
242
  { :family => 'AIX', :release => nil, :arch => arch }
241
243
  elsif ( uname = run_command('uname -sr').stdout) && uname =~ /SunOS/i
@@ -59,6 +59,10 @@ module SpecInfra
59
59
  "test -f #{escape(file)}"
60
60
  end
61
61
 
62
+ def get_file_mtime(file)
63
+ "stat -c %Y #{escape(file)}"
64
+ end
65
+
62
66
  def check_socket(file)
63
67
  "test -S #{escape(file)}"
64
68
  end
@@ -0,0 +1,28 @@
1
+ module SpecInfra
2
+ module Command
3
+ class NixOS < Linux
4
+ def check_enabled(service,level=3)
5
+ level = "multi-user.target" if level == 3
6
+ "systemctl --plain list-dependencies #{escape(level)} | grep '#{escape(service)}.service$'"
7
+ end
8
+
9
+ def check_installed(package, version=nil)
10
+ if version
11
+ "nix-store -q --references /var/run/current-system/sw | grep #{escape(package)}-#{escape(version)}"
12
+ else
13
+ "nix-store -q --references /var/run/current-system/sw | grep #{escape(package)}"
14
+ end
15
+ end
16
+
17
+ alias :check_installed_by_nix :check_installed
18
+
19
+ def check_running(service)
20
+ "systemctl is-active #{escape(service)}.service"
21
+ end
22
+
23
+ def install(package)
24
+ "nix-env -i #{package}"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -12,6 +12,7 @@ require "specinfra/command/redhat7"
12
12
  require "specinfra/command/suse"
13
13
  require "specinfra/command/opensuse"
14
14
  require "specinfra/command/fedora"
15
+ require "specinfra/command/nixos"
15
16
 
16
17
  # Solaris
17
18
  require "specinfra/command/solaris"
@@ -10,6 +10,7 @@ module SpecInfra
10
10
  'FreeBSD',
11
11
  'FreeBSD10',
12
12
  'Gentoo',
13
+ 'NixOS',
13
14
  'OpenBSD',
14
15
  'Plamo',
15
16
  'RedHat',
@@ -1,3 +1,3 @@
1
1
  module SpecInfra
2
- VERSION = "1.16.0"
2
+ VERSION = "1.17.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: 1.16.0
4
+ version: 1.17.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-06-08 00:00:00.000000000 Z
11
+ date: 2014-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -103,6 +103,7 @@ files:
103
103
  - lib/specinfra/command/freebsd10.rb
104
104
  - lib/specinfra/command/gentoo.rb
105
105
  - lib/specinfra/command/linux.rb
106
+ - lib/specinfra/command/nixos.rb
106
107
  - lib/specinfra/command/openbsd.rb
107
108
  - lib/specinfra/command/opensuse.rb
108
109
  - lib/specinfra/command/plamo.rb