disk-stats 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'disk-stats'
3
- s.version = "0.0.1"
3
+ s.version = "0.0.2"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Edward Muller"]
@@ -51,6 +51,10 @@ module DiskStats
51
51
  end
52
52
  end
53
53
 
54
+ def devices
55
+ @devices.map { |d| d.name.to_sym }
56
+ end
57
+
54
58
  def update new_output
55
59
  parse! new_output.split("\n")
56
60
  end
@@ -31,6 +31,10 @@ describe DiskStats::Parser do
31
31
  @parser.count.must_equal 10
32
32
  end
33
33
 
34
+ it 'should know the devices it has' do
35
+ @parser.devices.must_equal [:ram0, :loop0, :loop1, :sda1, :sdb, :sdf8, :sdf1, :sde1, :md0, :'dm-0']
36
+ end
37
+
34
38
  it 'should be enumerable' do
35
39
  @parser.is_a? Enumerable
36
40
  end
@@ -41,6 +45,10 @@ describe DiskStats::Parser do
41
45
  end
42
46
  end
43
47
 
48
+ it 'should return nil for a disk that does not exist' do
49
+ @parser[:foozle].must_be_nil
50
+ end
51
+
44
52
  it 'should return a device when indexed by the device name' do
45
53
  @parser[:ram0].must_be_instance_of DiskStats::Device
46
54
  @parser[:ram0].name.must_equal 'ram0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: disk-stats
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:
@@ -13,7 +13,7 @@ date: 2012-01-26 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
16
- requirement: &70171135253500 !ruby/object:Gem::Requirement
16
+ requirement: &70255972279160 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70171135253500
24
+ version_requirements: *70255972279160
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &70171135253020 !ruby/object:Gem::Requirement
27
+ requirement: &70255972278580 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.1.rc
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70171135253020
35
+ version_requirements: *70255972278580
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70171135252540 !ruby/object:Gem::Requirement
38
+ requirement: &70255972274380 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70171135252540
46
+ version_requirements: *70255972274380
47
47
  description: Some stuff for dealing with /proc/diskstats
48
48
  email: edward@heroku.com
49
49
  executables: []