google_drive 0.3.8 → 0.3.9

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: 0c0a003ba4da0e1d167511f39c06535363dcbb4d
4
- data.tar.gz: ac9177e9c140450d315c490af0d181445cb86df4
3
+ metadata.gz: cc0e2d33b8fcdc782842b3bc6799c8dde4c1f5f1
4
+ data.tar.gz: 53f5be85e460802eacaf145fbe9f7b95d224b042
5
5
  SHA512:
6
- metadata.gz: 98d1ce8a5029cad9aea862b0398dceafcc799329eeecc72a8ced9bcb1a11f8a8965b7d5ef369c8ebd09003006accea3c4098da25cb68d7eb54bb97ade6e966b9
7
- data.tar.gz: 9db7733d8d0e2edbb9916a5d6b14947413afeec206c3bff2660fcca7f664e44f7ffe71de74e08b6447abb4e75ffffa9873831e191226fa4708a951293665e0e8
6
+ metadata.gz: 941b66e85b5482414839ded28e11eafdf38dd8116268b3ded4015176ee2dce84199b848d8817ba7de9d2e70d1f6e404eb4f64e02731330e0127a77856e64ff3b
7
+ data.tar.gz: 323a27213b1770e72443a551a6698f2396cf59ff722b974a2b8e4ca3307b40b50d8a531931f9a8784d582202387a364dadaef93403c067a3f82c554d49b57d51
@@ -50,7 +50,7 @@ module GoogleDrive
50
50
 
51
51
  entry = AclEntry.new(entry) if entry.is_a?(Hash)
52
52
 
53
- header = {"GData-Version" => "3.0", "Content-Type" => "application/atom+xml"}
53
+ header = {"GData-Version" => "3.0", "Content-Type" => "application/atom+xml;charset=utf-8"}
54
54
  doc = @session.request(
55
55
  :post, @acls_feed_url, :data => entry.to_xml(), :header => header, :auth => :writely)
56
56
 
@@ -72,7 +72,7 @@ module GoogleDrive
72
72
 
73
73
  def update_role(entry) #:nodoc:
74
74
 
75
- header = {"GData-Version" => "3.0", "Content-Type" => "application/atom+xml"}
75
+ header = {"GData-Version" => "3.0", "Content-Type" => "application/atom+xml;charset=utf-8"}
76
76
  doc = @session.request(
77
77
  :put, entry.edit_url, :data => entry.to_xml(), :header => header, :auth => :writely)
78
78
 
@@ -26,6 +26,8 @@ module GoogleDrive
26
26
  http = @proxy.new(uri.host, uri.port)
27
27
  http.use_ssl = true
28
28
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
29
+ # No timeout. It can take long e.g., when it tries to fetch a large file.
30
+ http.read_timeout = nil
29
31
  http.start() do
30
32
  path = uri.path + (uri.query ? "?#{uri.query}" : "")
31
33
  header = auth_header(auth).merge(extra_header)
@@ -46,7 +46,7 @@ module GoogleDrive
46
46
 
47
47
  # Adds the given GoogleDrive::File to the collection.
48
48
  def add(file)
49
- header = {"GData-Version" => "3.0", "Content-Type" => "application/atom+xml"}
49
+ header = {"GData-Version" => "3.0", "Content-Type" => "application/atom+xml;charset=utf-8"}
50
50
  xml = <<-"EOS"
51
51
  <entry xmlns="http://www.w3.org/2005/Atom">
52
52
  <id>#{h(file.document_feed_url)}</id>
@@ -59,7 +59,7 @@ module GoogleDrive
59
59
 
60
60
  # Creates a sub-collection with given title. Returns GoogleDrive::Collection object.
61
61
  def create_subcollection(title)
62
- header = {"GData-Version" => "3.0", "Content-Type" => "application/atom+xml"}
62
+ header = {"GData-Version" => "3.0", "Content-Type" => "application/atom+xml;charset=utf-8"}
63
63
  xml = <<-EOS
64
64
  <entry xmlns="http://www.w3.org/2005/Atom">
65
65
  <category scheme="http://schemas.google.com/g/2005#kind"
@@ -157,7 +157,7 @@ module GoogleDrive
157
157
  contents_url = self.contents_url
158
158
  contents_url = concat_url(contents_url, "/-/#{type}") if type
159
159
  contents_url = concat_url(contents_url, "?" + encode_query(params))
160
- header = {"GData-Version" => "3.0", "Content-Type" => "application/atom+xml"}
160
+ header = {"GData-Version" => "3.0", "Content-Type" => "application/atom+xml;charset=utf-8"}
161
161
  doc = @session.request(:get, contents_url, :header => header, :auth => :writely)
162
162
  return doc.css("feed > entry").map(){ |e| @session.entry_element_to_file(e) }
163
163
  end
@@ -201,7 +201,7 @@ module GoogleDrive
201
201
  <atom:title>#{h(title)}</atom:title>
202
202
  </atom:entry>
203
203
  EOS
204
- header = {"Content-Type" => "application/atom+xml", "If-Match" => "*"}
204
+ header = {"Content-Type" => "application/atom+xml;charset=utf-8", "If-Match" => "*"}
205
205
  @session.request(:put, edit_url, :data => xml, :auth => :writely, :header => header)
206
206
  end
207
207
 
@@ -363,7 +363,7 @@ module GoogleDrive
363
363
  EOS
364
364
 
365
365
  default_initial_header = {
366
- "Content-Type" => "application/atom+xml",
366
+ "Content-Type" => "application/atom+xml;charset=utf-8",
367
367
  "X-Upload-Content-Type" => content_type,
368
368
  "X-Upload-Content-Length" => total_bytes.to_s(),
369
369
  }
@@ -427,7 +427,7 @@ module GoogleDrive
427
427
  if params[:header]
428
428
  extra_header = params[:header]
429
429
  elsif data
430
- extra_header = {"Content-Type" => "application/atom+xml"}
430
+ extra_header = {"Content-Type" => "application/atom+xml;charset=utf-8"}
431
431
  else
432
432
  extra_header = {}
433
433
  end
@@ -105,7 +105,7 @@ module GoogleDrive
105
105
  # Creates copy of this spreadsheet with the given title.
106
106
  def duplicate(new_title = nil)
107
107
  new_title ||= (self.title ? "Copy of " + self.title : "Untitled")
108
- header = {"GData-Version" => "3.0", "Content-Type" => "application/atom+xml"}
108
+ header = {"GData-Version" => "3.0", "Content-Type" => "application/atom+xml;charset=utf-8"}
109
109
  xml = <<-"EOS"
110
110
  <entry xmlns='http://www.w3.org/2005/Atom'>
111
111
  <id>#{h(self.document_feed_url)}</id>
@@ -276,7 +276,7 @@ module GoogleDrive
276
276
 
277
277
  @session.request(
278
278
  :put, edit_url, :data => xml,
279
- :header => {"Content-Type" => "application/atom+xml", "If-Match" => "*"})
279
+ :header => {"Content-Type" => "application/atom+xml;charset=utf-8", "If-Match" => "*"})
280
280
 
281
281
  @meta_modified = false
282
282
  sent = true
@@ -332,7 +332,7 @@ module GoogleDrive
332
332
  EOS
333
333
 
334
334
  batch_url = concat_url(@cells_feed_url, "/batch")
335
- result = @session.request(:post, batch_url, :data => xml, :header => {"If-Match" => "*"})
335
+ result = @session.request(:post, batch_url, :data => xml, :header => {"Content-Type" => "application/atom+xml;charset=utf-8", "If-Match" => "*"})
336
336
  for entry in result.css("atom|entry")
337
337
  interrupted = entry.css("batch|interrupted")[0]
338
338
  if interrupted
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_drive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Ichikawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-03 00:00:00.000000000 Z
11
+ date: 2014-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri