specinfra 2.78.2 → 2.79.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: 8e7223e5e9c508da25149354717b67fbd9978796
4
- data.tar.gz: 85bf507038941c6643a13e6f4ea59b211abe5616
3
+ metadata.gz: afc22c3532ecda9e643a95e94bac7e0e974e7b9e
4
+ data.tar.gz: 4839b3aaeb660b1a3e291d69a7c3adf07e528e82
5
5
  SHA512:
6
- metadata.gz: 57cd1068ae0c5e1d3e91319c62fae42f3b0b6508d0c027575454b490f8dd0464ded1342bcba88ad5a968e38ceb2f7f766073feefa673ad84ff550e22cbfbc54d
7
- data.tar.gz: 94476cb3ed48bd694a55b0f119ecbe9e3bd3da296523b048e1cdcda3cd3914e667219a431afdb262e3414933866bf15008872c219a00a4603e0dc3bb7a126a5e
6
+ metadata.gz: a54e500e1a91766181b1a780a2f04de85fca3b6724249dfc9b0043556439c9f8e678fa335728e7f56c9f646f4fc83123bfad4599614d25258430863848efcb1b
7
+ data.tar.gz: e2d497d63638869e70625ce4cfab74c42a49f5ab29983ddaa1b26bea18914ead2faff74df938445b21a6f0192bcb40e92ae8f85448a4f5b262243fe725aa7434
@@ -144,6 +144,12 @@ require 'specinfra/command/arch/base'
144
144
  require 'specinfra/command/arch/base/service'
145
145
  require 'specinfra/command/arch/base/package'
146
146
 
147
+ # Clear Linux (inherit Linux)
148
+ require 'specinfra/command/clearlinux'
149
+ require 'specinfra/command/clearlinux/base'
150
+ require 'specinfra/command/clearlinux/base/package'
151
+ require 'specinfra/command/clearlinux/base/service'
152
+
147
153
  # CoreOS (inherit Linux)
148
154
  require 'specinfra/command/coreos'
149
155
  require 'specinfra/command/coreos/base'
@@ -0,0 +1 @@
1
+ class Specinfra::Command::Clearlinux; end
@@ -0,0 +1,2 @@
1
+ class Specinfra::Command::Clearlinux::Base < Specinfra::Command::Linux::Base
2
+ end
@@ -0,0 +1,21 @@
1
+ class Specinfra::Command::Clearlinux::Base::Package < Specinfra::Command::Linux::Base::Package
2
+ class << self
3
+ def check_is_installed(package, version=nil)
4
+ "swupd bundle-list --quiet | grep -w #{escape(package)}"
5
+ end
6
+
7
+ alias :check_is_installed_by_swupd :check_is_installed
8
+
9
+ def get_version(package, opts=nil)
10
+ "true"
11
+ end
12
+
13
+ def install(package, version=nil, option='')
14
+ "swupd bundle-add --quiet #{package}"
15
+ end
16
+
17
+ def remove(package, option='')
18
+ "swupd bundle-remove --quiet #{option} #{package}"
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,5 @@
1
+ class Specinfra::Command::Clearlinux::Base::Service < Specinfra::Command::Linux::Base::Service
2
+ class << self
3
+ include Specinfra::Command::Module::Systemd
4
+ end
5
+ end
@@ -23,6 +23,7 @@ end
23
23
  require 'specinfra/helper/detect_os/aix'
24
24
  require 'specinfra/helper/detect_os/alpine'
25
25
  require 'specinfra/helper/detect_os/arch'
26
+ require 'specinfra/helper/detect_os/clearlinux'
26
27
  require 'specinfra/helper/detect_os/coreos'
27
28
  require 'specinfra/helper/detect_os/darwin'
28
29
  require 'specinfra/helper/detect_os/debian'
@@ -0,0 +1,12 @@
1
+ class Specinfra::Helper::DetectOs::Clearlinux < Specinfra::Helper::DetectOs
2
+ def detect
3
+ swupd_info = run_command('swupd info')
4
+ if swupd_info.success?
5
+ release = nil
6
+ swupd_info.stdout.each_line do |line|
7
+ release = line.gsub(/\s+/, '').split(':').last if line =~ /^Installed version:/
8
+ end
9
+ { :family => 'clearlinux', :release => release }
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.78.2"
2
+ VERSION = "2.79.0"
3
3
  end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ property[:os] = nil
4
+ set :os, { :family => 'clearlinux' }
5
+
6
+ describe get_command(:check_package_is_installed, 'vim') do
7
+ it { should eq "swupd bundle-list --quiet | grep -w vim" }
8
+ end
9
+
10
+ describe get_command(:install_package, 'vim') do
11
+ it { should eq "swupd bundle-add --quiet vim" }
12
+ end
13
+
14
+ describe get_command(:remove_package, 'vim') do
15
+ it { should eq "swupd bundle-remove --quiet vim" }
16
+ end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+ require 'specinfra/helper/detect_os/clearlinux'
3
+
4
+ describe Specinfra::Helper::DetectOs::Clearlinux do
5
+ clearlinux = Specinfra::Helper::DetectOs::Clearlinux.new(:exec)
6
+ it 'Should return clearlinux & release when clearlinux is installed.' do
7
+ allow(clearlinux).to receive(:run_command) {
8
+ CommandResult.new(:stdout => 'Installed version: 30340', :exit_status => 0)
9
+ }
10
+ expect(clearlinux.detect).to include(
11
+ :family => 'clearlinux',
12
+ :release => '30340'
13
+ )
14
+ end
15
+
16
+ it 'Should return clearlinux but not the release when the command returns the wrong line' do
17
+ allow(clearlinux).to receive(:run_command) {
18
+ CommandResult.new(:stdout => 'Foobar version: 30340', :exit_status => 0)
19
+ }
20
+ expect(clearlinux.detect).to include(
21
+ :family => 'clearlinux',
22
+ :release => nil
23
+ )
24
+ end
25
+ 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: 2.78.2
4
+ version: 2.79.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: 2019-07-05 00:00:00.000000000 Z
11
+ date: 2019-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp
@@ -203,6 +203,10 @@ files:
203
203
  - lib/specinfra/command/base/user.rb
204
204
  - lib/specinfra/command/base/yumrepo.rb
205
205
  - lib/specinfra/command/base/zfs.rb
206
+ - lib/specinfra/command/clearlinux.rb
207
+ - lib/specinfra/command/clearlinux/base.rb
208
+ - lib/specinfra/command/clearlinux/base/package.rb
209
+ - lib/specinfra/command/clearlinux/base/service.rb
206
210
  - lib/specinfra/command/coreos.rb
207
211
  - lib/specinfra/command/coreos/base.rb
208
212
  - lib/specinfra/command/coreos/base/service.rb
@@ -442,6 +446,7 @@ files:
442
446
  - lib/specinfra/helper/detect_os/aix.rb
443
447
  - lib/specinfra/helper/detect_os/alpine.rb
444
448
  - lib/specinfra/helper/detect_os/arch.rb
449
+ - lib/specinfra/helper/detect_os/clearlinux.rb
445
450
  - lib/specinfra/helper/detect_os/coreos.rb
446
451
  - lib/specinfra/helper/detect_os/darwin.rb
447
452
  - lib/specinfra/helper/detect_os/debian.rb
@@ -508,6 +513,7 @@ files:
508
513
  - spec/command/base/package_spec.rb
509
514
  - spec/command/base/process_spec.rb
510
515
  - spec/command/base/user_spec.rb
516
+ - spec/command/clearlinux/package_spec.rb
511
517
  - spec/command/cumulus/ppa_cumuluslinux_spec.rb
512
518
  - spec/command/cumulus/ppa_cumulusnetworks_spec.rb
513
519
  - spec/command/darwin/file_spec.rb
@@ -564,6 +570,7 @@ files:
564
570
  - spec/command/windows/service_spec.rb
565
571
  - spec/configuration_spec.rb
566
572
  - spec/helper/detect_os/aix_spec.rb
573
+ - spec/helper/detect_os/clearlinux_spec.rb
567
574
  - spec/helper/detect_os/darwin_spec.rb
568
575
  - spec/helper/detect_os/debian_spec.rb
569
576
  - spec/helper/detect_os/eos_spec.rb
@@ -641,6 +648,7 @@ test_files:
641
648
  - spec/command/base/package_spec.rb
642
649
  - spec/command/base/process_spec.rb
643
650
  - spec/command/base/user_spec.rb
651
+ - spec/command/clearlinux/package_spec.rb
644
652
  - spec/command/cumulus/ppa_cumuluslinux_spec.rb
645
653
  - spec/command/cumulus/ppa_cumulusnetworks_spec.rb
646
654
  - spec/command/darwin/file_spec.rb
@@ -697,6 +705,7 @@ test_files:
697
705
  - spec/command/windows/service_spec.rb
698
706
  - spec/configuration_spec.rb
699
707
  - spec/helper/detect_os/aix_spec.rb
708
+ - spec/helper/detect_os/clearlinux_spec.rb
700
709
  - spec/helper/detect_os/darwin_spec.rb
701
710
  - spec/helper/detect_os/debian_spec.rb
702
711
  - spec/helper/detect_os/eos_spec.rb