machine 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/machine.rb CHANGED
@@ -7,5 +7,7 @@ when /linux/
7
7
  require_relative 'machine/linux/info'
8
8
  when /darwin/
9
9
  require_relative 'machine/darwin/info'
10
+ when /freebsd/
11
+ require_relative 'machine/freebsd/info'
10
12
  end
11
13
  require_relative 'machine/process_status'
@@ -0,0 +1,20 @@
1
+ # encoding: UTF-8
2
+ module Machine
3
+ class Info
4
+ class Cpu < CpuDefault
5
+ class << self
6
+ def cores_size
7
+ `sysctl -n hw.ncpu`.to_i
8
+ end
9
+ end
10
+ end
11
+
12
+ class Memory
13
+ class << self
14
+ def mem_total
15
+ `sysctl -n hw.realmem`.to_i
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  module Machine
2
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
3
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: machine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-16 00:00:00.000000000 Z
12
+ date: 2012-10-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sys-proctable
@@ -39,6 +39,7 @@ files:
39
39
  - lib/machine.rb
40
40
  - lib/machine/darwin/info.rb
41
41
  - lib/machine/default/info.rb
42
+ - lib/machine/freebsd/info.rb
42
43
  - lib/machine/linux/info.rb
43
44
  - lib/machine/process_status.rb
44
45
  - lib/machine/version.rb