process_exists 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.travis.yml +19 -0
- data/Gemfile +2 -0
- data/README.md +7 -5
- data/lib/process_exists/core_ext/process.rb +2 -2
- data/lib/process_exists/version.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc2f4245c3eeed85cb4f0632f6cd33c38812141b
|
4
|
+
data.tar.gz: 45dc11b9f15569a8dfe919a436a42d30169dd971
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7ebf7d28867545da67402e62fc631ea855caf07fcb9d2f9875f10d2d1de6621a6ad87732b6ce898bd08cf1af72fae000ccd832093d215dec2516df3175f73c9
|
7
|
+
data.tar.gz: 8f8c86049bfec34a7e5d6f375344ce32a1eed125397fdda499925d6f5317003bb6b72d737b6f1ed1c912de4dc61506cf67041f801cc6a4b40ae74a0b2e933fb4
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
rvm:
|
4
|
+
- jruby
|
5
|
+
- 1.9.3
|
6
|
+
- 2.1.2
|
7
|
+
|
8
|
+
script: 'bundle exec rake'
|
9
|
+
|
10
|
+
notifications:
|
11
|
+
email:
|
12
|
+
recipients:
|
13
|
+
- wilson.dsigns@gmail.com
|
14
|
+
on_failure: change
|
15
|
+
on_success: never
|
16
|
+
|
17
|
+
addons:
|
18
|
+
code_climate:
|
19
|
+
repo_token: 60547bb26da976413277b29ddb8eadef1f563dff8ba2cf905618c8e6195c7f3e
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
# process_exists
|
2
2
|
|
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
|
+
[![Build Status](https://travis-ci.org/wilsonsilva/process_exists.svg?branch=master)](https://travis-ci.org/wilsonsilva/process_exists)
|
3
6
|
[![Dependency Status](https://gemnasium.com/wilsonsilva/process_exists.svg)](https://gemnasium.com/wilsonsilva/process_exists)
|
4
7
|
|
5
8
|
## Description
|
6
9
|
|
7
|
-
Sends
|
10
|
+
Sends a null signal to a process or a group of processes specified by pid to check if it exists.
|
8
11
|
|
9
|
-
##
|
12
|
+
## Usage
|
10
13
|
|
11
14
|
require 'process_exists'
|
12
15
|
|
13
|
-
pid =
|
14
|
-
|
15
|
-
puts exists ? 1 : 0
|
16
|
+
pid = 12
|
17
|
+
pid_exists = Process.exists?(pid)
|
16
18
|
|
17
19
|
## Requirements
|
18
20
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# The Process module is a collection of methods used to manipulate processes.
|
2
2
|
module Process
|
3
|
-
# Checks if a
|
3
|
+
# Checks if a process exists
|
4
4
|
# @param pid the process id
|
5
5
|
def self.exists?(pid)
|
6
6
|
Process.kill(0, pid.to_i)
|
7
7
|
true
|
8
8
|
rescue Errno::ESRCH # No such process
|
9
9
|
false
|
10
|
-
rescue Errno::EPERM #
|
10
|
+
rescue Errno::EPERM # The process exists, but you dont have permission to send the signal to it.
|
11
11
|
true
|
12
12
|
end
|
13
13
|
end
|
data/spec/spec_helper.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wilsonsilva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- ".document"
|
91
91
|
- ".gitignore"
|
92
92
|
- ".rspec"
|
93
|
+
- ".travis.yml"
|
93
94
|
- ".yardopts"
|
94
95
|
- Gemfile
|
95
96
|
- LICENSE
|