process_exists 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +14 -13
- data/Gemfile +1 -7
- data/README.md +12 -6
- data/Rakefile +7 -31
- data/lib/process_exists/version.rb +1 -1
- data/process_exists.gemspec +16 -14
- data/spec/process_exists_spec.rb +1 -1
- data/spec/process_spec.rb +4 -4
- data/spec/spec_helper.rb +6 -5
- metadata +28 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c4e60daa3598dc2b341d6ff22ee09bf85649da68c6e60b6c44ab419aadaaa482
|
4
|
+
data.tar.gz: 613c166c96a5b58ac7bb72b0fd1012ba2f59cfaac32c2cf3fa1b4c42414b0588
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4edc8c1d24659fd85696a1c69b0b0a206e7702a62adf78c31006211a89462d865ce413161f66b605c106a2d1ce21fe75e4e813ce75f41158b1131138bcd6b85
|
7
|
+
data.tar.gz: 24ab02e2a4c8451de63ffdf38478fbebbc89a8de57ad9290860da6a342d726539cc1842064a64f5df44cce64edb89586a9785e8e5ff40ae208ad9a8fe9d6d6e0
|
data/.travis.yml
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
|
+
env:
|
4
|
+
global:
|
5
|
+
- CC_TEST_REPORTER_ID=60547bb26da976413277b29ddb8eadef1f563dff8ba2cf905618c8e6195c7f3e
|
6
|
+
|
3
7
|
rvm:
|
4
|
-
-
|
5
|
-
- 1.9.3
|
6
|
-
- 2.1.2
|
8
|
+
- 2.5.0
|
7
9
|
|
8
|
-
|
10
|
+
before_install: gem install bundler -v 1.16.1
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
before_script:
|
13
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
14
|
+
- chmod +x ./cc-test-reporter
|
15
|
+
- ./cc-test-reporter before-build
|
16
|
+
scripts:
|
17
|
+
- bundle exec rspec spec
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
repo_token: 60547bb26da976413277b29ddb8eadef1f563dff8ba2cf905618c8e6195c7f3e
|
19
|
+
after_script:
|
20
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# process_exists
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/process_exists.svg)](http://badge.fury.io/rb/process_exists)
|
4
|
-
[![Code Climate](https://codeclimate.com/github/wilsonsilva/process_exists/badges/gpa.svg)](https://codeclimate.com/github/wilsonsilva/process_exists)
|
5
4
|
[![Build Status](https://travis-ci.org/wilsonsilva/process_exists.svg?branch=master)](https://travis-ci.org/wilsonsilva/process_exists)
|
6
|
-
[![
|
5
|
+
[![Code Climate](https://codeclimate.com/github/wilsonsilva/process_exists/badges/gpa.svg)](https://codeclimate.com/github/wilsonsilva/process_exists)
|
6
|
+
[![Test Coverage](https://codeclimate.com/github/wilsonsilva/process_exists/badges/coverage.svg)](https://codeclimate.com/github/wilsonsilva/process_exists)
|
7
|
+
[![Depfu](https://badges.depfu.com/badges/ffec1fc2a9f213d8538dfc0d3958c788/overview.svg)](https://depfu.com/github/wilsonsilva/process_exists)
|
7
8
|
[![Inline docs](http://inch-ci.org/github/wilsonsilva/process_exists.png?branch=master)](http://inch-ci.org/github/wilsonsilva/process_exists)
|
8
9
|
|
9
10
|
## Description
|
@@ -12,10 +13,12 @@ Sends a null signal to a process or a group of processes specified by pid to che
|
|
12
13
|
|
13
14
|
## Usage
|
14
15
|
|
15
|
-
|
16
|
+
```ruby
|
17
|
+
require 'process_exists'
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
+
pid = 12
|
20
|
+
pid_exists = Process.exists?(pid)
|
21
|
+
```
|
19
22
|
|
20
23
|
## Requirements
|
21
24
|
|
@@ -23,4 +26,7 @@ A Unix-like operating system.
|
|
23
26
|
|
24
27
|
## Install
|
25
28
|
|
26
|
-
|
29
|
+
```bash
|
30
|
+
$ gem install process_exists
|
31
|
+
```
|
32
|
+
|
data/Rakefile
CHANGED
@@ -1,34 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
|
5
|
-
begin
|
6
|
-
require 'bundler'
|
7
|
-
rescue LoadError => e
|
8
|
-
warn e.message
|
9
|
-
warn "Run `gem install bundler` to install Bundler."
|
10
|
-
exit -1
|
11
|
-
end
|
12
|
-
|
13
|
-
begin
|
14
|
-
Bundler.setup(:development)
|
15
|
-
rescue Bundler::BundlerError => e
|
16
|
-
warn e.message
|
17
|
-
warn "Run `bundle install` to install missing gems."
|
18
|
-
exit e.status_code
|
19
|
-
end
|
20
|
-
|
21
|
-
require 'rake'
|
22
|
-
|
23
|
-
require 'rubygems/tasks'
|
24
|
-
Gem::Tasks.new
|
25
|
-
|
1
|
+
require 'bundler/gem_tasks'
|
26
2
|
require 'rspec/core/rake_task'
|
27
|
-
|
3
|
+
require 'yard'
|
28
4
|
|
29
|
-
|
30
|
-
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
6
|
+
YARD::Rake::YardocTask.new
|
31
7
|
|
32
|
-
|
33
|
-
|
34
|
-
task :
|
8
|
+
task default: :spec
|
9
|
+
task doc: :yard
|
10
|
+
task test: :spec
|
data/process_exists.gemspec
CHANGED
@@ -1,25 +1,27 @@
|
|
1
|
-
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
2
3
|
|
3
|
-
require
|
4
|
+
require 'process_exists/version'
|
4
5
|
|
5
6
|
Gem::Specification.new do |gem|
|
6
|
-
gem.name =
|
7
|
+
gem.name = 'process_exists'
|
7
8
|
gem.version = ProcessExists::VERSION
|
8
|
-
gem.summary =
|
9
|
-
gem.description =
|
10
|
-
gem.license =
|
11
|
-
gem.authors = [
|
12
|
-
gem.email =
|
13
|
-
gem.homepage =
|
9
|
+
gem.summary = 'Checks if a PID exists.'
|
10
|
+
gem.description = 'Sends a null signal to a process or a group of processes specified by pid to check if it exists.'
|
11
|
+
gem.license = 'MIT'
|
12
|
+
gem.authors = ['wilsonsilva']
|
13
|
+
gem.email = 'me@wilsonsilva.net'
|
14
|
+
gem.homepage = 'https://github.com/wilsonsilva/process_exists'
|
14
15
|
|
15
16
|
gem.files = `git ls-files`.split($/)
|
16
17
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
19
|
gem.require_paths = ['lib']
|
19
20
|
|
20
|
-
gem.add_development_dependency 'bundler', '~> 1.
|
21
|
-
gem.add_development_dependency 'rake', '~>
|
22
|
-
gem.add_development_dependency 'rspec', '~> 3.
|
23
|
-
gem.add_development_dependency '
|
24
|
-
gem.add_development_dependency '
|
21
|
+
gem.add_development_dependency 'bundler', '~> 1.16'
|
22
|
+
gem.add_development_dependency 'rake', '~> 12.3'
|
23
|
+
gem.add_development_dependency 'rspec', '~> 3.7'
|
24
|
+
gem.add_development_dependency 'simplecov', '~> 0.16'
|
25
|
+
gem.add_development_dependency 'simplecov-console', '~> 0.4'
|
26
|
+
gem.add_development_dependency 'yard', '~> 0.9'
|
25
27
|
end
|
data/spec/process_exists_spec.rb
CHANGED
data/spec/process_spec.rb
CHANGED
@@ -2,20 +2,20 @@ require 'spec_helper'
|
|
2
2
|
require 'process_exists'
|
3
3
|
|
4
4
|
describe Process do
|
5
|
-
it
|
5
|
+
it 'responds to :exists?' do
|
6
6
|
expect(subject).to respond_to(:exists?)
|
7
7
|
end
|
8
8
|
|
9
9
|
describe '.exists?' do
|
10
|
-
it
|
10
|
+
it 'returns false when a pid does not exist' do
|
11
11
|
expect(subject.exists?(-2)).to be false
|
12
12
|
end
|
13
13
|
|
14
|
-
it
|
14
|
+
it 'returns true when a pid exists' do
|
15
15
|
expect(subject.exists?(Process.pid)).to be true
|
16
16
|
end
|
17
17
|
|
18
|
-
it
|
18
|
+
it 'returns true when a pid exists and belongs to another user' do
|
19
19
|
# Process ID 1 is usually the init process primarily responsible for starting and shutting down the system.
|
20
20
|
expect(subject.exists?(1)).to be true
|
21
21
|
end unless running_specs_as_root?
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
require
|
2
|
-
|
1
|
+
require 'simplecov'
|
2
|
+
require 'simplecov-console'
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
SimpleCov.formatter = SimpleCov::Formatter::Console
|
5
|
+
SimpleCov.start
|
6
6
|
|
7
|
-
|
7
|
+
require 'rspec'
|
8
|
+
require 'process_exists'
|
8
9
|
|
9
10
|
def running_specs_as_root?
|
10
11
|
# The superuser normally has a UID of zero (0)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: process_exists
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wilsonsilva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,70 +16,84 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.16'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.16'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '12.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '12.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.7'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.7'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: simplecov
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0.
|
61
|
+
version: '0.16'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0.
|
68
|
+
version: '0.16'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov-console
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.4'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.4'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: yard
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0.
|
89
|
+
version: '0.9'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0.
|
96
|
+
version: '0.9'
|
83
97
|
description: Sends a null signal to a process or a group of processes specified by
|
84
98
|
pid to check if it exists.
|
85
99
|
email: me@wilsonsilva.net
|
@@ -123,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
137
|
version: '0'
|
124
138
|
requirements: []
|
125
139
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
140
|
+
rubygems_version: 2.7.6
|
127
141
|
signing_key:
|
128
142
|
specification_version: 4
|
129
143
|
summary: Checks if a PID exists.
|