dynosaur 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dynosaur.gemspec +1 -0
- data/lib/dynosaur.rb +0 -1
- data/lib/dynosaur/process.rb +1 -1
- data/lib/dynosaur/process/local/finder.rb +5 -3
- data/lib/dynosaur/utils/rake_command.rb +1 -1
- data/lib/dynosaur/version.rb +1 -1
- metadata +15 -2
- data/lib/dynosaur/utils/os.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c55b30b39a25e3fd07dcd4ea3d6f072cfe547ad0
|
4
|
+
data.tar.gz: ed34e4e6f4d2c16366aac029472b1a39a4d83305
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3036a06f2185bf3c5549e2eaa18d3039d618df607087b7739897eddd9c087f67054830610c09c25b233386a4f3ed50d70d09add4d19698ed96423bd2fbe6f1d3
|
7
|
+
data.tar.gz: 6622d5cf172a80a443f48724e94b61217761aeb864ce1bab2ebdc894988e97b379ce4513b6f048cf621b7ecc43b65be7e8a995eb049f18561e4c43d28d523e9c
|
data/dynosaur.gemspec
CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
20
|
spec.add_runtime_dependency 'platform-api', '~> 0'
|
21
|
+
spec.add_runtime_dependency 'sys-proctable', '~> 0.9'
|
21
22
|
|
22
23
|
spec.add_development_dependency 'bundler', '~> 1.8'
|
23
24
|
spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
|
data/lib/dynosaur.rb
CHANGED
data/lib/dynosaur/process.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'sys/proctable'
|
2
|
+
|
1
3
|
# Detects if a running process is currently executing the rake command
|
2
4
|
module Dynosaur
|
3
5
|
class Process
|
@@ -8,9 +10,9 @@ module Dynosaur
|
|
8
10
|
end
|
9
11
|
|
10
12
|
def exists?
|
11
|
-
|
12
|
-
Utils::RakeCommand.valid?(
|
13
|
-
Utils::RakeCommand.parse(
|
13
|
+
Sys::ProcTable.ps.map(&:cmdline).any? do |command|
|
14
|
+
Utils::RakeCommand.valid?(command) &&
|
15
|
+
Utils::RakeCommand.parse(command) == rake_command
|
14
16
|
end
|
15
17
|
end
|
16
18
|
|
data/lib/dynosaur/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynosaur
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Collier
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sys-proctable
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.9'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.9'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,7 +134,6 @@ files:
|
|
120
134
|
- lib/dynosaur/process/heroku/finder.rb
|
121
135
|
- lib/dynosaur/process/local.rb
|
122
136
|
- lib/dynosaur/process/local/finder.rb
|
123
|
-
- lib/dynosaur/utils/os.rb
|
124
137
|
- lib/dynosaur/utils/rake_command.rb
|
125
138
|
- lib/dynosaur/version.rb
|
126
139
|
homepage:
|
data/lib/dynosaur/utils/os.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# Utility methods for interacting with the underlying OS
|
2
|
-
module Dynosaur
|
3
|
-
module Utils
|
4
|
-
module OS
|
5
|
-
class << self
|
6
|
-
# @return [Array] Object instances, which respond to #command, for all
|
7
|
-
# locally running processes returned by the ps command
|
8
|
-
def structured_ps
|
9
|
-
ps_array = command_ps.split("\n").map(&:strip)
|
10
|
-
ps_array.shift # Remove the header row
|
11
|
-
ps_array.map do |command|
|
12
|
-
Struct.new(:command).new(command)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def command_ps
|
19
|
-
`ps -o command`
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|