dir_size 0.1.0 → 0.1.1

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: 15ad8d180938c54cf324288340d1f866f9fc73ed
4
- data.tar.gz: 822747bc1cf4e901e2d3e1a056fa0a286faa5dd9
3
+ metadata.gz: ff02f1c07d703daa13b77e8404c748dc2426a522
4
+ data.tar.gz: 37fead98f70c68e0adc3e09eb4e7136e62da8bd1
5
5
  SHA512:
6
- metadata.gz: f6e71a06b911ec9d558f52456c1a745f41e9b3b78098c578a965618b0f17223315f361a15d974c0c757e7c2487f537ea27b585ba1d0638f8a68175453bba5981
7
- data.tar.gz: 730bb7cc070eae20ebb86a9aab294046f4fbd8f2d9621484602c52d645a60d7464bc93af96820724cac12021937064d416ced2ca5c51e62edad57ba19cb63d6b
6
+ metadata.gz: 0beb2f013a2cecac964ad0b02ca9636d2389f90ff9c863a2b4e8ffcaa75ac12847f3e5c7334530d5f7cb0937254f61271658192c36a5365a11c0a720784cb98a
7
+ data.tar.gz: 6a7045b6a00ab417c88ce26d177105463b4a04ca3c6443c06ef0dda4b9f6214a47971846f88e6a0ccf3400b5b55c4fcb52f1a4f6f4c32bf9dcbf527cdf2fa33d
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'dir_size'
7
- spec.version = '0.1.0'
7
+ spec.version = '0.1.1'
8
8
  spec.date = Time.now.strftime('%Y-%m-%d')
9
9
  spec.authors = ['Bachue Zhou']
10
10
  spec.email = ['bachue.shu@gmail.com']
@@ -26,11 +26,8 @@ static int get_size(const char *path, unsigned long *psize) {
26
26
 
27
27
  static VALUE rb_get_size(VALUE rb_self, VALUE rb_path) {
28
28
  unsigned long lsize;
29
- char path[PATH_MAX + 1];
30
29
  Check_Type(rb_path, T_STRING);
31
- strncpy(path, RSTRING_PTR(rb_path), RSTRING_LEN(rb_path));
32
- path[RSTRING_LEN(rb_path)] = '\0';
33
- if (get_size(path, &lsize) == -1)
30
+ if (get_size(StringValueCStr(rb_path), &lsize) == -1)
34
31
  rb_raise(rb_eRuntimeError, "Dir.size error: %s", strerror(errno));
35
32
  else
36
33
  return ULONG2NUM(lsize);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dir_size
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bachue Zhou
@@ -98,4 +98,3 @@ signing_key:
98
98
  specification_version: 4
99
99
  summary: To calculate the directory size
100
100
  test_files: []
101
- has_rdoc: