ruby-hdfs-cdh4 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/LICENSE +1 -3
  2. data/ext/hdfs/hdfs.c +10 -5
  3. metadata +2 -2
data/LICENSE CHANGED
@@ -1,5 +1,3 @@
1
- Copyright (c) 2010 Alexander Staubo
2
-
3
1
  Permission is hereby granted, free of charge, to any person obtaining
4
2
  a copy of this software and associated documentation files (the
5
3
  "Software"), to deal in the Software without restriction, including
@@ -17,4 +15,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
15
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
16
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
17
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/ext/hdfs/hdfs.c CHANGED
@@ -321,18 +321,23 @@ VALUE HDFS_File_System_list_directory(VALUE self, VALUE path) {
321
321
  Data_Get_Struct(self, FSData, data);
322
322
  VALUE file_infos = rb_ary_new();
323
323
  int num_files = 0;
324
- hdfsFileInfo* infos = hdfsListDirectory(data->fs, RSTRING_PTR(path),
325
- &num_files);
324
+ hdfsFileInfo* infos = hdfsListDirectory(data->fs, RSTRING_PTR(path), &num_files);
325
+
326
326
  if (infos == NULL) {
327
- rb_raise(e_does_not_exist, "Directory does not exist: %s",
328
- RSTRING_PTR(path));
329
- return Qnil;
327
+ if (hdfsExists(data->fs, RSTRING_PTR(path)) == 0) {
328
+ return file_infos;
329
+ } else {
330
+ rb_raise(e_does_not_exist, "Directory does not exist: %s", RSTRING_PTR(path));
331
+ return Qnil;
332
+ }
330
333
  }
334
+
331
335
  int i;
332
336
  for (i = 0; i < num_files; i++) {
333
337
  hdfsFileInfo* cur_info = infos + i;
334
338
  rb_ary_push(file_infos, wrap_hdfsFileInfo(cur_info));
335
339
  }
340
+
336
341
  hdfsFreeFileInfo(infos, num_files);
337
342
  return file_infos;
338
343
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-hdfs-cdh4
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-06-21 00:00:00.000000000 Z
14
+ date: 2014-02-07 00:00:00.000000000 Z
15
15
  dependencies: []
16
16
  description: ruby hadoop libhdfs client with support for cdh4
17
17
  email: