dir_size 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/dir_size.gemspec +1 -1
- data/ext/dir_size/dir_size.c +1 -4
- metadata +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff02f1c07d703daa13b77e8404c748dc2426a522
|
4
|
+
data.tar.gz: 37fead98f70c68e0adc3e09eb4e7136e62da8bd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0beb2f013a2cecac964ad0b02ca9636d2389f90ff9c863a2b4e8ffcaa75ac12847f3e5c7334530d5f7cb0937254f61271658192c36a5365a11c0a720784cb98a
|
7
|
+
data.tar.gz: 6a7045b6a00ab417c88ce26d177105463b4a04ca3c6443c06ef0dda4b9f6214a47971846f88e6a0ccf3400b5b55c4fcb52f1a4f6f4c32bf9dcbf527cdf2fa33d
|
data/dir_size.gemspec
CHANGED
@@ -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.
|
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']
|
data/ext/dir_size/dir_size.c
CHANGED
@@ -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
|
-
|
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.
|
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:
|