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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2334a97cc2c56d1bb062276061d4a651e92e017
4
- data.tar.gz: f9b5b8c1b1a2450c9ec7568e9a27380b14d9e2df
3
+ metadata.gz: bc2f4245c3eeed85cb4f0632f6cd33c38812141b
4
+ data.tar.gz: 45dc11b9f15569a8dfe919a436a42d30169dd971
5
5
  SHA512:
6
- metadata.gz: 82c4eb88663aaaaa49e78d4721e3e5d1f506bb8719890c1bf6e2b176b2d9657b0c2287308dcd4dcaada75d78fda54ac0b4ca97a66b44a7818c787ad173fe2033
7
- data.tar.gz: 3e24ea68b4c6a644a173df438b6c55ecead4e263d5f75a9df39e574177430b5b3386be7be6b5ace1af99d7f92ead7107271ec3a00aa285af8e7e33d462c67a41
6
+ metadata.gz: d7ebf7d28867545da67402e62fc631ea855caf07fcb9d2f9875f10d2d1de6621a6ad87732b6ce898bd08cf1af72fae000ccd832093d215dec2516df3175f73c9
7
+ data.tar.gz: 8f8c86049bfec34a7e5d6f375344ce32a1eed125397fdda499925d6f5317003bb6b72d737b6f1ed1c912de4dc61506cf67041f801cc6a4b40ae74a0b2e933fb4
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  Gemfile.lock
2
2
  doc/
3
3
  pkg/
4
+ coverage/
4
5
  vendor/cache/*.gem
5
6
  .yardoc/
6
- .idea/
7
+ .idea/
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
@@ -2,6 +2,8 @@ source 'http://rubygems.org/'
2
2
 
3
3
  gemspec
4
4
 
5
+ gem "codeclimate-test-reporter", group: :test, require: nil
6
+
5
7
  group :development do
6
8
  gem 'kramdown'
7
9
  end
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 the signal 0 to a given PID to check if any process with the given PID is running.
10
+ Sends a null signal to a process or a group of processes specified by pid to check if it exists.
8
11
 
9
- ## Examples
12
+ ## Usage
10
13
 
11
14
  require 'process_exists'
12
15
 
13
- pid = 278
14
- exists = Process.exists?(pid)
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 PID exists
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 # Operation not permitted (the process exists but it belongs to other user/group)
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
@@ -1,5 +1,5 @@
1
1
  # Contains the gem version
2
2
  module ProcessExists
3
3
  # process_exists version
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require "codeclimate-test-reporter"
2
+ CodeClimate::TestReporter.start
3
+
1
4
  require 'rspec'
2
5
  require 'process_exists/version'
3
6
 
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.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-04 00:00:00.000000000 Z
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