specinfra 2.45.0 → 2.46.0

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: 06c018dd730f80d2cef8eb5eba3a7a40f245c274
4
- data.tar.gz: 60d3aced300232771352b7eea3397af1e8742c7c
3
+ metadata.gz: 2be7a5840b1a9c51c56e2eec4d3b01f5ea5ba2e7
4
+ data.tar.gz: 83d9f2ea7813982d5476cfcb340ceb44d332427a
5
5
  SHA512:
6
- metadata.gz: 38dab03863445a1176e0a1dac2356e17a6b97bc91267f902872d452697ba241db2d9f45037c14d1172e124b028a0aecb26b56bd268d26efe9604385f22ef793d
7
- data.tar.gz: 8a93046edf17402d9a54d565c13ee3f354ed0bbe9d86ec0c048576979f49f9ad18fbd9d9556eda829f8f01f19edf553e01cfc0252ac7f84207e6ec66ddb11249
6
+ metadata.gz: bb59d2db2b2fda6eef22fea2e17907e6c18c40e2ce7a9c6e7eb1cf0d399ced6c798185ab1a0edd8ad75ec2282a571f55a85097db692660fd4c02d320283e0f66
7
+ data.tar.gz: f0f5b0185cebee12b9266eac2df3dba1c2b9144e85ab29909cf6a5bd82b625f687a1436632182ffe46c6c5087bee14bf584f415de303c7b2a4032dca07d764ac
@@ -4,6 +4,10 @@ class Specinfra::Command::Base::Process < Specinfra::Command::Base
4
4
  "ps -C #{escape(process)} -o #{opts[:format]} | head -1"
5
5
  end
6
6
 
7
+ def count(process)
8
+ "ps aux | grep -w -- #{escape(process)} | grep -v grep | wc -l"
9
+ end
10
+
7
11
  def check_is_running(process)
8
12
  "ps aux | grep -w -- #{escape(process)} | grep -qv grep"
9
13
  end
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.45.0"
2
+ VERSION = "2.46.0"
3
3
  end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, { :family => nil }
4
+
5
+ describe get_command(:count_process, 'foo') do
6
+ it { should eq 'ps aux | grep -w -- foo | grep -v grep | wc -l' }
7
+ 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.45.0
4
+ version: 2.46.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: 2015-12-13 00:00:00.000000000 Z
11
+ date: 2015-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp
@@ -475,6 +475,7 @@ files:
475
475
  - spec/command/base/localhost_spec.rb
476
476
  - spec/command/base/mail_alias.rb
477
477
  - spec/command/base/package_spec.rb
478
+ - spec/command/base/process_spec.rb
478
479
  - spec/command/base/user_spec.rb
479
480
  - spec/command/cumulus/ppa_cumuluslinux_spec.rb
480
481
  - spec/command/cumulus/ppa_cumulusnetworks_spec.rb
@@ -581,6 +582,7 @@ test_files:
581
582
  - spec/command/base/localhost_spec.rb
582
583
  - spec/command/base/mail_alias.rb
583
584
  - spec/command/base/package_spec.rb
585
+ - spec/command/base/process_spec.rb
584
586
  - spec/command/base/user_spec.rb
585
587
  - spec/command/cumulus/ppa_cumuluslinux_spec.rb
586
588
  - spec/command/cumulus/ppa_cumulusnetworks_spec.rb