webhdfs 0.6.0 → 0.7.0

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: 722d97c3cd885df9fcdf8d6dc6ffb53b85e0781c
4
- data.tar.gz: 7048f1a9c7346a7e82caa942e71a5680cc930dad
3
+ metadata.gz: 4f02131841ca6641fc326c7eb7edcc2597da3295
4
+ data.tar.gz: 39661fdfa5e70bd7ef8019df212ab77ebd76653f
5
5
  SHA512:
6
- metadata.gz: 404e0069c1e3b01fb74259ba9883ce5a3bb1655775af7481e5270ad8f148699cc689aa3049258161f8e86a6ae4f710509d994ac407323cd8e13fd36f47352efa
7
- data.tar.gz: e7765eb4be5c4629c7c1f5b5f9bda3721cfb3b90b99e8d170a72f8107a7c1160f73a463aa770005a8f250d49ca7528be403cc35a87def3791e593302686f2846
6
+ metadata.gz: 12bf9eef8c161e36f25181cfbd4de13c1a7e07ea6ae6f5a7f30d9878019fa06d558e79f765007b0c306e0336550235703bba51e258082ba83276d946fa289fe4
7
+ data.tar.gz: 4af18a7733419ad404b4f498d440db2dc98cd73097723b38dd71f5424947a35902e262600e49722a02bab17bde926358c8910bf1845a15b6f9023c4f48188315
data/README.md CHANGED
@@ -20,7 +20,7 @@ For client object interface:
20
20
  To create/append/read files:
21
21
 
22
22
  client.create('/path/to/file', data)
23
- client.create('/path/to/file', data, :overwrite => false, :blocksize => 268435456, :replication => 5, :permission => 0666)
23
+ client.create('/path/to/file', data, :overwrite => false, :blocksize => 268435456, :replication => 5, :permission => '0666')
24
24
 
25
25
  #This does not require whole data in memory, and it can be read chunk by chunk, ex: File data
26
26
  client.create('/path/to/file', file_IO_handle, :overwrite => false, :permission => 0666)
@@ -33,7 +33,7 @@ To create/append/read files:
33
33
  To mkdir/rename/delete directories or files:
34
34
 
35
35
  client.mkdir('/hdfs/dirname')
36
- client.mkdir('/hdfs/dirname', :permission => 0777)
36
+ client.mkdir('/hdfs/dirname', :permission => '0777')
37
37
 
38
38
  client.rename(original_path, dst_path)
39
39
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.7.0
@@ -1,6 +1,7 @@
1
1
  require 'net/http'
2
2
  require 'uri'
3
3
  require 'json'
4
+ require 'addressable/uri'
4
5
 
5
6
  require_relative 'exceptions'
6
7
 
@@ -280,6 +281,7 @@ module WebHDFS
280
281
  conn.open_timeout = @open_timeout if @open_timeout
281
282
  conn.read_timeout = @read_timeout if @read_timeout
282
283
 
284
+ path = Addressable::URI.escape(path) # make path safe for transmission via HTTP
283
285
  request_path = if op
284
286
  build_path(path, op, params)
285
287
  else
@@ -327,7 +329,7 @@ module WebHDFS
327
329
  res = conn.send_request(method, request_path, payload, header)
328
330
  end
329
331
 
330
- if @kerberos
332
+ if @kerberos and res.code == '307'
331
333
  itok = (res.header.get_fields('WWW-Authenticate') || ['']).pop.split(/\s+/).last
332
334
  unless itok
333
335
  raise WebHDFS::KerberosError, 'Server does not return WWW-Authenticate header'
@@ -20,4 +20,5 @@ Gem::Specification.new do |gem|
20
20
  gem.add_development_dependency "rdoc"
21
21
  gem.add_development_dependency "simplecov"
22
22
  gem.add_development_dependency "rr"
23
+ gem.add_runtime_dependency "addressable"
23
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webhdfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuki Ohta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-24 00:00:00.000000000 Z
11
+ date: 2015-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: addressable
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: Ruby WebHDFS/HttpFs client
70
84
  email: kazuki.ohta@gmail.com
71
85
  executables: []
@@ -107,10 +121,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
121
  version: '0'
108
122
  requirements: []
109
123
  rubyforge_project:
110
- rubygems_version: 2.2.2
124
+ rubygems_version: 2.4.5
111
125
  signing_key:
112
126
  specification_version: 4
113
127
  summary: Ruby WebHDFS/HttpFs client
114
128
  test_files:
115
129
  - test/test_helper.rb
116
130
  - test/webhdfs/fileutils.rb
131
+ has_rdoc: false