google_drive 2.1.6 → 2.1.7
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/lib/google_drive/file.rb +1 -1
- data/lib/google_drive/spreadsheet.rb +24 -0
- data/lib/google_drive/worksheet.rb +8 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d1a4942b505b1a7c2b0c9f5c5ad4b6b07def0a52
|
|
4
|
+
data.tar.gz: 8a85586bb36e68b20d899fabdea7c10a1e60e3bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 32427d7303d783f1d846e81dc6eb201691e584550f6cb8a85a35b8fad129ba5993d79347504c94ff68c7b74d57dc9d29b26286a213fbd96d7b33f66b7ff94b4e
|
|
7
|
+
data.tar.gz: 56ec22afaab23abaf16ee0b398b65eadecb296353a44f6a0c81e30bc5a979a3890c75f908c11b460de276f1b7edacdf650f4d3f20b9b687bb817fba8751663e2
|
data/lib/google_drive/file.rb
CHANGED
|
@@ -198,7 +198,7 @@ module GoogleDrive
|
|
|
198
198
|
|
|
199
199
|
# Creates copy of this file with the given title.
|
|
200
200
|
def copy(title)
|
|
201
|
-
api_file = @session.drive.copy_file(id, { name: title },
|
|
201
|
+
api_file = @session.drive.copy_file(id, { name: title }, fields: '*')
|
|
202
202
|
@session.wrap_api_file(api_file)
|
|
203
203
|
end
|
|
204
204
|
|
|
@@ -79,5 +79,29 @@ module GoogleDrive
|
|
|
79
79
|
doc = @session.request(:post, worksheets_feed_url, data: xml)
|
|
80
80
|
Worksheet.new(@session, self, doc.root)
|
|
81
81
|
end
|
|
82
|
+
|
|
83
|
+
# Not available for GoogleDrive::Spreadsheet. Use export_as_file instead.
|
|
84
|
+
def download_to_file(path, params = {})
|
|
85
|
+
raise(
|
|
86
|
+
NotImplementedError,
|
|
87
|
+
"download_to_file is not available for GoogleDrive::Spreadsheet. " +
|
|
88
|
+
"Use export_as_file instead.")
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Not available for GoogleDrive::Spreadsheet. Use export_as_string instead.
|
|
92
|
+
def download_to_string(params = {})
|
|
93
|
+
raise(
|
|
94
|
+
NotImplementedError,
|
|
95
|
+
"download_to_string is not available for GoogleDrive::Spreadsheet. " +
|
|
96
|
+
"Use export_as_string instead.")
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Not available for GoogleDrive::Spreadsheet. Use export_to_io instead.
|
|
100
|
+
def download_to_io(io, params = {})
|
|
101
|
+
raise(
|
|
102
|
+
NotImplementedError,
|
|
103
|
+
"download_to_io is not available for GoogleDrive::Spreadsheet. " +
|
|
104
|
+
"Use export_to_io instead.")
|
|
105
|
+
end
|
|
82
106
|
end
|
|
83
107
|
end
|
|
@@ -15,6 +15,12 @@ module GoogleDrive
|
|
|
15
15
|
class Worksheet
|
|
16
16
|
include(Util)
|
|
17
17
|
|
|
18
|
+
# @api private
|
|
19
|
+
# A regexp which matches an invalid character in XML 1.0:
|
|
20
|
+
# https://en.wikipedia.org/wiki/Valid_characters_in_XML#XML_1.0
|
|
21
|
+
XML_INVAILD_CHAR_REGEXP =
|
|
22
|
+
/[^\u0009\u000a\u000d\u0020-\ud7ff\ue000-\ufffd\u{10000}-\u{10ffff}]/
|
|
23
|
+
|
|
18
24
|
# @api private
|
|
19
25
|
def initialize(session, spreadsheet, worksheet_feed_entry)
|
|
20
26
|
@session = session
|
|
@@ -513,8 +519,8 @@ module GoogleDrive
|
|
|
513
519
|
end
|
|
514
520
|
|
|
515
521
|
def validate_cell_value(value)
|
|
516
|
-
if value
|
|
517
|
-
fail(ArgumentError, 'Contains invalid character
|
|
522
|
+
if value =~ XML_INVAILD_CHAR_REGEXP
|
|
523
|
+
fail(ArgumentError, 'Contains invalid character %p for XML 1.0: %p' % [$&, value])
|
|
518
524
|
end
|
|
519
525
|
end
|
|
520
526
|
end
|
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: 2.1.
|
|
4
|
+
version: 2.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hiroshi Ichikawa
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-11-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|