jstorimer-deep-test 1.2.0 → 1.3.0

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.3.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jstorimer-deep-test}
8
- s.version = "1.2.0"
8
+ s.version = "1.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Josh Nichols"]
@@ -17,7 +17,7 @@ module DeepTest
17
17
  attr_accessor *VALID_OPTIONS.map {|o| o.name}
18
18
 
19
19
  def number_of_agents
20
- return CpuInfo.new.count unless @number_of_agents
20
+ cpu_count unless @number_of_agents
21
21
  @number_of_agents
22
22
  end
23
23
 
@@ -101,6 +101,19 @@ module DeepTest
101
101
  def server
102
102
  Server.remote_reference(origin_hostname, server_port)
103
103
  end
104
+
105
+ def cpu_count
106
+ case RUBY_PLATFORM
107
+ when /darwin/
108
+ output = `sysctl -n hw.ncpu`
109
+ output.strip.to_i
110
+ when /linux/
111
+ File.readlines("/proc/cpuinfo").inject(0) do |count, line|
112
+ next count + 1 if line =~ /processor\s*:\s*\d+/
113
+ count
114
+ end
115
+ end
116
+ end
104
117
 
105
118
  protected
106
119
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jstorimer-deep-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Nichols