dynosaur 0.2.0 → 0.2.1

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: 1448d342f89404da10452e0e95176627f5c7ed56
4
- data.tar.gz: ffe0d95b07ad64c410d89e4645289faa107c7cf5
3
+ metadata.gz: c55b30b39a25e3fd07dcd4ea3d6f072cfe547ad0
4
+ data.tar.gz: ed34e4e6f4d2c16366aac029472b1a39a4d83305
5
5
  SHA512:
6
- metadata.gz: 06a80b1d43a568785eee94acab44b02a260d4a61e83bd2502886ab2abd1dc0c2c9bf647b37b8a23ddec22a260455024a66ffd4192df89fdb7139af767387cfce
7
- data.tar.gz: f0d630594d61500d65d7eafa207c33c36ac622d5af7f89fd63ebb0d7c6dda2649aa7ca20a1c65bcd198f92acf8bb4b4aaeaa2ad20bea3e9ff3593ffd0e18c030
6
+ metadata.gz: 3036a06f2185bf3c5549e2eaa18d3039d618df607087b7739897eddd9c087f67054830610c09c25b233386a4f3ed50d70d09add4d19698ed96423bd2fbe6f1d3
7
+ data.tar.gz: 6622d5cf172a80a443f48724e94b61217761aeb864ce1bab2ebdc894988e97b379ce4513b6f048cf621b7ecc43b65be7e8a995eb049f18561e4c43d28d523e9c
@@ -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'
@@ -6,7 +6,6 @@ require 'dynosaur/process/heroku/finder'
6
6
  require 'dynosaur/process/local'
7
7
  require 'dynosaur/process/local/finder'
8
8
 
9
- require 'dynosaur/utils/os'
10
9
  require 'dynosaur/utils/rake_command'
11
10
 
12
11
  # Spin up a rake task in a separate process
@@ -8,7 +8,7 @@ module Dynosaur
8
8
  end
9
9
 
10
10
  def running?
11
- klass = self.class.const_get('Finder')
11
+ klass = self.class::Finder
12
12
  finder = klass.new(rake_command: rake_command)
13
13
  finder.exists?
14
14
  end
@@ -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
- Utils::OS.structured_ps.any? do |process|
12
- Utils::RakeCommand.valid?(process.command) &&
13
- Utils::RakeCommand.parse(process.command) == rake_command
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
 
@@ -38,7 +38,7 @@ module Dynosaur
38
38
  end
39
39
 
40
40
  def ==(other)
41
- task == other.task && args.map(&:to_s) == other.args.map(&:to_s)
41
+ to_s == other.to_s
42
42
  end
43
43
  end
44
44
  end
@@ -1,4 +1,4 @@
1
1
  # Gem version number
2
2
  module Dynosaur
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
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.0
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:
@@ -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