google_drive 2.1.9 → 2.1.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 865c482b6edbfefd86f4a5e9658b9487e70b99c6
4
- data.tar.gz: da516192ff4de976a61327eaa61602dc1df51dd5
3
+ metadata.gz: 32452d844765d65e08e064814d3b4ca9731bbeec
4
+ data.tar.gz: e8e7491fa46f85ca5aff1e9eb934dd71f327c6a1
5
5
  SHA512:
6
- metadata.gz: a31cb6ce83639300b5e182b36146dbb4132ce182cd520a44dd1474f105d81e54eeb9cea4522b7b205a57c7530eefcb2e9c872a0766e1aa021232d72cd15c9c0d
7
- data.tar.gz: 81986aea9ec0ebd102808fa49c82ae9910ea9bb31b9e7c135e34eb66a1218222a5a09071254a1606839cfd013edfe432dd5f82ec1a00429289d198f84df1cf2b
6
+ metadata.gz: 8cd5aa173b2de2a9e0625630754b5f4dad3f0fbdc0ed526bd8e16144734ff4eebebdbed638f7a2a145ba037056a88964bb84b2268f6f00924abc3f4817f46310
7
+ data.tar.gz: 1ad90a9190a4d4e8216a9f3ce6f1ba7c65c6cfd032168c3a451637420c50a3cd5fda28ca555411f6aae76c5cf013184d81d2efb6ca4b951416e23edbaca81481
@@ -20,7 +20,9 @@ module GoogleDrive
20
20
  def initialize(session, file)
21
21
  @session = session
22
22
  @file = file
23
- api_permissions = @session.drive.list_permissions(@file.id, fields: '*')
23
+ api_permissions = @session.drive.list_permissions(
24
+ @file.id, fields: '*', supports_team_drives: true
25
+ )
24
26
  @entries =
25
27
  api_permissions.permissions.map { |perm| AclEntry.new(perm, self) }
26
28
  end
@@ -68,7 +70,9 @@ module GoogleDrive
68
70
  entry = params_or_entry.is_a?(AclEntry) ?
69
71
  params_or_entry : AclEntry.new(params_or_entry)
70
72
  api_permission = @session.drive.create_permission(
71
- @file.id, entry.params, { fields: '*' }.merge(options)
73
+ @file.id,
74
+ entry.params,
75
+ { fields: '*', supports_team_drives: true }.merge(options)
72
76
  )
73
77
  new_entry = AclEntry.new(api_permission, self)
74
78
  @entries.push(new_entry)
@@ -80,14 +84,20 @@ module GoogleDrive
80
84
  # e.g.
81
85
  # spreadsheet.acl.delete(spreadsheet.acl[1])
82
86
  def delete(entry)
83
- @session.drive.delete_permission(@file.id, entry.id)
87
+ @session.drive.delete_permission(
88
+ @file.id, entry.id, supports_team_drives: true
89
+ )
84
90
  @entries.delete(entry)
85
91
  end
86
92
 
87
93
  # @api private
88
94
  def update_role(entry)
89
95
  api_permission = @session.drive.update_permission(
90
- @file.id, entry.id, { role: entry.role }, fields: '*'
96
+ @file.id,
97
+ entry.id,
98
+ { role: entry.role },
99
+ fields: '*',
100
+ supports_team_drives: true
91
101
  )
92
102
  entry.api_permission = api_permission
93
103
  entry
@@ -184,7 +184,7 @@ module GoogleDrive
184
184
 
185
185
  # Reads content from +io+ and updates the file with the content.
186
186
  def update_from_io(io, params = {})
187
- params = { upload_source: io }.merge(params)
187
+ params = { upload_source: io, supports_team_drives: true }.merge(params)
188
188
  @session.drive.update_file(id, nil, params)
189
189
  nil
190
190
  end
@@ -193,16 +193,20 @@ module GoogleDrive
193
193
  # If +permanent+ is +true+, deletes the file permanently.
194
194
  def delete(permanent = false)
195
195
  if permanent
196
- @session.drive.delete_file(id)
196
+ @session.drive.delete_file(id, supports_team_drives: true)
197
197
  else
198
- @session.drive.update_file(id, { trashed: true }, {})
198
+ @session.drive.update_file(
199
+ id, { trashed: true }, supports_team_drives: true
200
+ )
199
201
  end
200
202
  nil
201
203
  end
202
204
 
203
205
  # Renames title of the file.
204
206
  def rename(title)
205
- @session.drive.update_file(id, { name: title }, {})
207
+ @session.drive.update_file(
208
+ id, { name: title }, supports_team_drives: true
209
+ )
206
210
  nil
207
211
  end
208
212
 
@@ -210,7 +214,9 @@ module GoogleDrive
210
214
 
211
215
  # Creates copy of this file with the given title.
212
216
  def copy(title)
213
- api_file = @session.drive.copy_file(id, { name: title }, fields: '*')
217
+ api_file = @session.drive.copy_file(
218
+ id, { name: title }, fields: '*', supports_team_drives: true
219
+ )
214
220
  @session.wrap_api_file(api_file)
215
221
  end
216
222
 
@@ -427,7 +427,9 @@ module GoogleDrive
427
427
  name: title,
428
428
  mime_type: 'application/vnd.google-apps.spreadsheet'
429
429
  }
430
- file = drive.create_file(file_metadata, fields: '*')
430
+ file = drive.create_file(
431
+ file_metadata, fields: '*', supports_team_drives: true
432
+ )
431
433
  wrap_api_file(file)
432
434
  end
433
435
 
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.9
4
+ version: 2.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Ichikawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-02 00:00:00.000000000 Z
11
+ date: 2018-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri