linux-kstat 0.1.2-universal-linux → 0.1.3-universal-linux

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: b7152bf2ad1918fbb6c0a2d777d978ae958ef5e5
4
- data.tar.gz: 67b2b4a27a5973cbb1c091a8e01129f3ac4f477a
3
+ metadata.gz: 95930e43f1dee6734e273dcb7ab65ddb653fc310
4
+ data.tar.gz: cfba5ef8611d792e1874e421a017f5183188c516
5
5
  SHA512:
6
- metadata.gz: 9d94b4d69430e3514656ea72a01501b1ef690cfcd32f55cb1a4fa495c70b94946b8b37a74ff16ed14e057592d0319657720e1fe0d82046ab95ffe04494e7f5ab
7
- data.tar.gz: 3ec88008079bb815c4964ef695f7d194842950df5f770699da0b2a266d263f63e4badf7cadf280ce35301fd2c1ad48b1f86df3a63665b8ce4dccc3d13371f23f
6
+ metadata.gz: 22b61750e3cfd5942f6f9f173194cda9ca602e09b1d41f2203d78d2ce52af245044ff7a46455e666dceb340c0ff495318b94fb5529f2347a4cf3c0c14a91d35d
7
+ data.tar.gz: 71c368743ae0ef6045b2935b0b2a01a47ab794ba03be5de21c19c2bbc1e051c77c9336ef60999f8b73b1696bd063e051c5f5cb4987661b1bedeab28776fd5094
data/CHANGES CHANGED
@@ -1,3 +1,6 @@
1
+ = 0.1.3 - 18-Dec-2014
2
+ * Now properly ignores blank lines. Thanks go to "onlinehead" for the patch.
3
+
1
4
  = 0.1.2 - 2-Nov-2014
2
5
  * Updates to the gemspec and Rakefile.
3
6
 
data/Rakefile CHANGED
@@ -1,32 +1,36 @@
1
- require 'rake'
2
- require 'rake/clean'
3
- require 'rake/testtask'
4
-
5
- CLEAN.include('**/*.gem', '**/*.rbc')
6
-
7
- namespace :gem do
8
- desc 'Build the linux-kstat gem'
9
- task :create => [:clean] do
10
- spec = eval(IO.read('linux-kstat.gemspec'))
11
- if Gem::VERSION < "2.0"
12
- Gem::Builder.new(spec).build
13
- else
14
- require 'rubygems/package'
15
- Gem::Package.build(spec)
16
- end
17
- end
18
-
19
- desc "Install the linux-kstat gem"
20
- task :install => [:create] do
21
- file = Dir["*.gem"].first
22
- sh "gem install -l #{file}"
23
- end
24
- end
25
-
26
- Rake::TestTask.new do |t|
27
- task :test => :clean
28
- t.warning = true
29
- t.verbose = true
30
- end
31
-
32
- task :default => :test
1
+ require 'rake'
2
+ require 'rake/clean'
3
+ require 'rake/testtask'
4
+
5
+ CLEAN.include('**/*.gem', '**/*.rbc')
6
+
7
+ namespace :gem do
8
+ desc 'Build the linux-kstat gem'
9
+ task :create => [:clean] do
10
+ spec = eval(IO.read('linux-kstat.gemspec'))
11
+ if Gem::VERSION < "2.0"
12
+ Gem::Builder.new(spec).build
13
+ else
14
+ require 'rubygems/package'
15
+ Gem::Package.build(spec)
16
+ end
17
+ end
18
+
19
+ desc "Install the linux-kstat gem"
20
+ task :install => [:create] do
21
+ file = Dir["*.gem"].first
22
+ if RUBY_PLATFORM == 'java'
23
+ sh "jruby -S gem install -l #{file}"
24
+ else
25
+ sh "gem install -l #{file}"
26
+ end
27
+ end
28
+ end
29
+
30
+ Rake::TestTask.new do |t|
31
+ task :test => :clean
32
+ t.warning = true
33
+ t.verbose = true
34
+ end
35
+
36
+ task :default => :test
data/lib/linux/kstat.rb CHANGED
@@ -7,7 +7,7 @@ module Linux
7
7
  extend Forwardable
8
8
 
9
9
  # The version of the linux-kstat library
10
- VERSION = '0.1.2'
10
+ VERSION = '0.1.3'
11
11
 
12
12
  # :stopdoc:
13
13
 
@@ -51,21 +51,23 @@ module Linux
51
51
 
52
52
  IO.readlines('/proc/stat').each{ |line|
53
53
  info = line.split
54
- if info.first =~ /^cpu/i
55
- hash[info.first.to_sym] = {
56
- :user => info[1].to_i,
57
- :nice => info[2].to_i,
58
- :system => info[3].to_i,
59
- :idle => info[4].to_i,
60
- :iowait => info[5].to_i,
61
- :irq => info[6].to_i,
62
- :softirq => info[7].to_i
63
- }
64
- else
65
- if info.size > 2
66
- hash[info.first.to_sym] = info[1..-1].map{ |e| e.to_i }
54
+ unless info.empty?
55
+ if info.first =~ /^cpu/i
56
+ hash[info.first.to_sym] = {
57
+ :user => info[1].to_i,
58
+ :nice => info[2].to_i,
59
+ :system => info[3].to_i,
60
+ :idle => info[4].to_i,
61
+ :iowait => info[5].to_i,
62
+ :irq => info[6].to_i,
63
+ :softirq => info[7].to_i
64
+ }
67
65
  else
68
- hash[info.first.to_sym] = info[1].to_i
66
+ if info.size > 2
67
+ hash[info.first.to_sym] = info[1..-1].map{ |e| e.to_i }
68
+ else
69
+ hash[info.first.to_sym] = info[1].to_i
70
+ end
69
71
  end
70
72
  end
71
73
  }
data/linux-kstat.gemspec CHANGED
@@ -3,7 +3,7 @@ require 'rbconfig'
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = 'linux-kstat'
6
- gem.version = '0.1.2'
6
+ gem.version = '0.1.3'
7
7
  gem.license = 'Artistic 2.0'
8
8
  gem.author = 'Daniel J. Berger'
9
9
  gem.email = 'djberg96@gmail.com'
@@ -12,7 +12,7 @@ class TC_Linux_Kstat < Test::Unit::TestCase
12
12
  end
13
13
 
14
14
  test "version constant is set to the expected value" do
15
- assert_equal('0.1.2', Linux::Kstat::VERSION)
15
+ assert_equal('0.1.3', Linux::Kstat::VERSION)
16
16
  end
17
17
 
18
18
  test "kstat object can be accessed like a hash" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linux-kstat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: universal-linux
6
6
  authors:
7
7
  - Daniel J. Berger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-02 00:00:00.000000000 Z
11
+ date: 2014-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  version: '0'
63
63
  requirements: []
64
64
  rubyforge_project:
65
- rubygems_version: 2.4.2
65
+ rubygems_version: 2.4.5
66
66
  signing_key:
67
67
  specification_version: 4
68
68
  summary: Ruby interface for Linux kernel stats in /proc/stat