bloopletech-webstats 0.2.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
- :minor: 2
4
- :patch: 4
3
+ :minor: 3
4
+ :patch: 0
@@ -1,5 +1,5 @@
1
1
  #include <ruby.h>
2
- #include <sys/vfs.h>
2
+ #include <sys/statvfs.h>
3
3
 
4
4
  static VALUE get_disk_usage(VALUE self, VALUE mount_point)
5
5
  {
@@ -9,12 +9,12 @@ static VALUE get_disk_usage(VALUE self, VALUE mount_point)
9
9
  rb_hash_aset(out_hash, rb_str_new2("free"), Qnil);
10
10
  rb_hash_aset(out_hash, rb_str_new2("total"), Qnil);
11
11
 
12
- struct statfs result;
12
+ struct statvfs result;
13
13
 
14
- if(statfs(mount_point_str, &result) == 0)
14
+ if(statvfs(mount_point_str, &result) == 0)
15
15
  {
16
- rb_hash_aset(out_hash, rb_str_new2("free"), LL2NUM((long long)result.f_bfree * (long long)result.f_bsize));
17
- rb_hash_aset(out_hash, rb_str_new2("total"), LL2NUM((long long)result.f_blocks * (long long)result.f_bsize));
16
+ rb_hash_aset(out_hash, rb_str_new2("free"), LL2NUM((long long)result.f_bavail * (long long)result.f_frsize));
17
+ rb_hash_aset(out_hash, rb_str_new2("total"), LL2NUM((long long)result.f_blocks * (long long)result.f_frsize));
18
18
  }
19
19
 
20
20
  return out_hash;
data/webstats.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{webstats}
5
- s.version = "0.2.4"
5
+ s.version = "0.3.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Brenton Fletcher"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bloopletech-webstats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brenton Fletcher