lt-google-api 0.2.0 → 0.2.4

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
  SHA256:
3
- metadata.gz: e9444e503f8be57c766e0c911d17bcad4a1ae91f9c0cedb41e6fe7c2aaac22b4
4
- data.tar.gz: 26594726c1328938016457e9d1c418d31b1bf870f1c79099ee2f2df8051386a0
3
+ metadata.gz: 203073cba74046037ecc29511af5eb80b60bcb27a4590a5fe9fde1f9334e7355
4
+ data.tar.gz: 0e61efbb1603bec389c470395637b31f8e81b3cbe50bb97b4a2a396bfaf375da
5
5
  SHA512:
6
- metadata.gz: 20c99bfa0afea23058e415ac0514117864c7232f6590a583e589fdcf8f4c3809e726939dc1b4bac317f24801ab25cd4245b4ca40983f03f38dc7acad28f8cb45
7
- data.tar.gz: b5a6fdc5a4b4471a374f8f7abf75079892dcfed5647abef945ad7cffb85d743115ff58462aa02858d0f3263cd2b6b9095b764fe2c602c9fb34a230dae727e9a2
6
+ metadata.gz: dad5b20560975ce5037b9a07bf472fdc5ab3c1e3cd69ede699bd3d0d72cbc9b4c49abdfff7fd939b702ad67204285ccd1191ce811d40aa7b0d27e4421560830a
7
+ data.tar.gz: f1d8ad2e964132b96317848f5f2413e9115af93c115f8e5888abc722d856d333f9d1786d46c0d14dac747e17aa59a84a2c866da892855c9ae29122d4ddba58d8
@@ -1,6 +1,6 @@
1
1
  name: "Rubocop"
2
2
 
3
- on: push
3
+ on: pull_request
4
4
 
5
5
  jobs:
6
6
  rubocop:
data/CHANGELOG.md CHANGED
@@ -4,7 +4,31 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [Unreleased](https://github.com/learningtapestry/lt-google-api/compare/v0.2.0...HEAD)
7
+ ## [Unreleased](https://github.com/learningtapestry/lt-google-api/compare/v0.2.4...HEAD)
8
+
9
+ ## [0.2.4](https://github.com/learningtapestry/lt-lcms/compare/v0.2.3...v0.2.4) - 2021-07-16
10
+
11
+ ### Fixed
12
+
13
+ - Fix for Google Query ([#13](https://github.com/learningtapestry/lt-google-api/pull/13))
14
+
15
+ ## [0.2.3](https://github.com/learningtapestry/lt-lcms/compare/v0.2.2...v0.2.3) - 2021-07-02
16
+
17
+ ### Fixed
18
+
19
+ - Fix Google API query when object name contains special characters like " ' " ([#11](https://github.com/learningtapestry/lt-google-api/pull/11))
20
+
21
+ ## [0.2.2](https://github.com/learningtapestry/lt-lcms/compare/v0.2.1...v0.2.2) - 2020-12-25
22
+
23
+ ### Fixed
24
+
25
+ - Fix Google API namespace ([#9](https://github.com/learningtapestry/lt-google-api/pull/9))
26
+
27
+ ## [0.2.1](https://github.com/learningtapestry/lt-lcms/compare/v0.2.0...v0.2.1) - 2020-10-15
28
+
29
+ ### Fixed
30
+
31
+ - Correctly fetches content of Google Shared Drives ([#8](https://github.com/learningtapestry/lt-google-api/pull/8))
8
32
 
9
33
  ## [0.2.0](https://github.com/learningtapestry/lt-lcms/compare/v0.1.1...v0.2.0) - 2020-10-15
10
34
 
data/Gemfile.lock CHANGED
@@ -1,31 +1,64 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lt-google-api (0.1.1)
5
- google-api-client
6
- googleauth
4
+ lt-google-api (0.2.4)
5
+ google-api-client (~> 0.46)
6
+ googleauth (~> 0.14)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- addressable (2.7.0)
11
+ activesupport (6.1.4)
12
+ concurrent-ruby (~> 1.0, >= 1.0.2)
13
+ i18n (>= 1.6, < 2)
14
+ minitest (>= 5.1)
15
+ tzinfo (~> 2.0)
16
+ zeitwerk (~> 2.3)
17
+ addressable (2.8.0)
12
18
  public_suffix (>= 2.0.2, < 5.0)
13
- ast (2.4.1)
14
- childprocess (4.0.0)
19
+ ast (2.4.2)
20
+ childprocess (4.1.0)
21
+ concurrent-ruby (1.1.9)
15
22
  declarative (0.0.20)
16
- declarative-option (0.1.0)
17
- faraday (1.0.1)
23
+ faraday (1.5.1)
24
+ faraday-em_http (~> 1.0)
25
+ faraday-em_synchrony (~> 1.0)
26
+ faraday-excon (~> 1.1)
27
+ faraday-httpclient (~> 1.0.1)
28
+ faraday-net_http (~> 1.0)
29
+ faraday-net_http_persistent (~> 1.1)
30
+ faraday-patron (~> 1.0)
18
31
  multipart-post (>= 1.2, < 3)
19
- google-api-client (0.46.1)
32
+ ruby2_keywords (>= 0.0.4)
33
+ faraday-em_http (1.0.0)
34
+ faraday-em_synchrony (1.0.0)
35
+ faraday-excon (1.1.0)
36
+ faraday-httpclient (1.0.1)
37
+ faraday-net_http (1.0.1)
38
+ faraday-net_http_persistent (1.2.0)
39
+ faraday-patron (1.0.0)
40
+ gems (1.2.0)
41
+ google-api-client (0.53.0)
42
+ google-apis-core (~> 0.1)
43
+ google-apis-generator (~> 0.1)
44
+ google-apis-core (0.4.0)
20
45
  addressable (~> 2.5, >= 2.5.1)
21
- googleauth (~> 0.9)
22
- httpclient (>= 2.8.1, < 3.0)
46
+ googleauth (>= 0.16.2, < 2.a)
47
+ httpclient (>= 2.8.1, < 3.a)
23
48
  mini_mime (~> 1.0)
24
49
  representable (~> 3.0)
25
- retriable (>= 2.0, < 4.0)
50
+ retriable (>= 2.0, < 4.a)
26
51
  rexml
27
- signet (~> 0.12)
28
- googleauth (0.14.0)
52
+ webrick
53
+ google-apis-discovery_v1 (0.6.0)
54
+ google-apis-core (>= 0.4, < 2.a)
55
+ google-apis-generator (0.4.0)
56
+ activesupport (>= 5.0)
57
+ gems (~> 1.2)
58
+ google-apis-core (>= 0.4, < 2.a)
59
+ google-apis-discovery_v1 (~> 0.5)
60
+ thor (>= 0.20, < 2.a)
61
+ googleauth (0.16.2)
29
62
  faraday (>= 0.17.3, < 2.0)
30
63
  jwt (>= 1.4, < 3.0)
31
64
  memoist (~> 0.16)
@@ -33,29 +66,33 @@ GEM
33
66
  os (>= 0.9, < 2.0)
34
67
  signet (~> 0.14)
35
68
  httpclient (2.8.3)
69
+ i18n (1.8.10)
70
+ concurrent-ruby (~> 1.0)
36
71
  iniparse (1.5.0)
37
- jwt (2.2.2)
72
+ jwt (2.2.3)
38
73
  memoist (0.16.2)
39
- mini_mime (1.0.2)
74
+ mini_mime (1.1.0)
75
+ minitest (5.14.4)
40
76
  multi_json (1.15.0)
41
77
  multipart-post (2.1.1)
42
78
  os (1.1.1)
43
- overcommit (0.57.0)
79
+ overcommit (0.58.0)
44
80
  childprocess (>= 0.6.3, < 5)
45
81
  iniparse (~> 1.4)
46
- parallel (1.19.2)
47
- parser (2.7.2.0)
82
+ rexml (~> 3.2)
83
+ parallel (1.20.1)
84
+ parser (3.0.1.1)
48
85
  ast (~> 2.4.1)
49
86
  public_suffix (4.0.6)
50
87
  rainbow (3.0.0)
51
- rake (13.0.1)
52
- regexp_parser (1.8.2)
53
- representable (3.0.4)
88
+ rake (13.0.3)
89
+ regexp_parser (2.1.1)
90
+ representable (3.1.1)
54
91
  declarative (< 0.1.0)
55
- declarative-option (< 0.2.0)
92
+ trailblazer-option (>= 0.1.1, < 0.2.0)
56
93
  uber (< 0.2.0)
57
94
  retriable (3.1.2)
58
- rexml (3.2.4)
95
+ rexml (3.2.5)
59
96
  rubocop (0.93.1)
60
97
  parallel (~> 1.10)
61
98
  parser (>= 2.7.1.5)
@@ -65,16 +102,23 @@ GEM
65
102
  rubocop-ast (>= 0.6.0)
66
103
  ruby-progressbar (~> 1.7)
67
104
  unicode-display_width (>= 1.4.0, < 2.0)
68
- rubocop-ast (0.8.0)
69
- parser (>= 2.7.1.5)
70
- ruby-progressbar (1.10.1)
71
- signet (0.14.0)
105
+ rubocop-ast (1.7.0)
106
+ parser (>= 3.0.1.1)
107
+ ruby-progressbar (1.11.0)
108
+ ruby2_keywords (0.0.5)
109
+ signet (0.15.0)
72
110
  addressable (~> 2.3)
73
111
  faraday (>= 0.17.3, < 2.0)
74
112
  jwt (>= 1.5, < 3.0)
75
113
  multi_json (~> 1.10)
114
+ thor (1.1.0)
115
+ trailblazer-option (0.1.1)
116
+ tzinfo (2.0.4)
117
+ concurrent-ruby (~> 1.0)
76
118
  uber (0.1.0)
77
119
  unicode-display_width (1.7.0)
120
+ webrick (1.7.0)
121
+ zeitwerk (2.4.2)
78
122
 
79
123
  PLATFORMS
80
124
  ruby
@@ -37,7 +37,7 @@ module Lt
37
37
  else
38
38
  service.copy_file(
39
39
  id,
40
- Google::Apis::DriveV3::File.new(name: f.name, parents: [folder_id]),
40
+ ::Google::Apis::DriveV3::File.new(name: f.name, parents: [folder_id]),
41
41
  supports_all_drives: true
42
42
  )
43
43
  end
@@ -62,7 +62,7 @@ module Lt
62
62
  next if current_files.detect { |f| f.name == file.name }
63
63
 
64
64
  # copy if it's a new file
65
- new_file = Google::Apis::DriveV3::File.new(name: file.name, parents: [target_id])
65
+ new_file = ::Google::Apis::DriveV3::File.new(name: file.name, parents: [target_id])
66
66
  service.copy_file(file.id, new_file, supports_all_drives: true)
67
67
  end
68
68
  end
@@ -85,9 +85,11 @@ module Lt
85
85
  page_token = nil
86
86
  loop do
87
87
  response = service.list_files(
88
- q: "'#{folder_id}' in parents and trashed = false",
88
+ q: %("#{folder_id}" in parents and trashed = false),
89
89
  fields: 'files(id, mime_type), nextPageToken',
90
- page_token: page_token
90
+ page_token: page_token.to_s,
91
+ include_items_from_all_drives: true,
92
+ supports_all_drives: true
91
93
  )
92
94
  break if response.nil?
93
95
 
@@ -107,8 +109,9 @@ module Lt
107
109
 
108
110
  def fetch_folders(name, folder_id)
109
111
  service.list_files(
110
- q: "'#{folder_id}' in parents and name = '#{name}' and mimeType = '#{MIME_FOLDER}' and trashed = false",
112
+ q: %("#{folder_id}" in parents and name = "#{name}" and mimeType = "#{MIME_FOLDER}" and trashed = false),
111
113
  fields: 'files(id)',
114
+ include_items_from_all_drives: true,
112
115
  supports_all_drives: true
113
116
  )&.files
114
117
  end
@@ -117,8 +120,9 @@ module Lt
117
120
 
118
121
  def list(folder_id)
119
122
  service.list_files(
120
- q: "'#{folder_id}' in parents and mimeType = '#{MIME_FILE}' and trashed = false",
123
+ q: %("#{folder_id}" in parents and mimeType = "#{MIME_FILE}" and trashed = false),
121
124
  fields: 'files(id, name)',
125
+ include_items_from_all_drives: true,
122
126
  supports_all_drives: true
123
127
  )&.files
124
128
  end
@@ -3,7 +3,7 @@
3
3
  module Lt
4
4
  module Google
5
5
  module Api
6
- VERSION = '0.2.0'
6
+ VERSION = '0.2.4'
7
7
  end
8
8
  end
9
9
  end
@@ -33,8 +33,8 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
33
33
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
34
  spec.require_paths = ['lib']
35
35
 
36
- spec.add_dependency 'google-api-client'
37
- spec.add_dependency 'googleauth'
36
+ spec.add_dependency 'google-api-client', '~> 0.46'
37
+ spec.add_dependency 'googleauth', '~> 0.14'
38
38
 
39
39
  spec.add_development_dependency 'bundler', '~> 1.16'
40
40
  spec.add_development_dependency 'overcommit', '~> 0.57'
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lt-google-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kuznetsov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-15 00:00:00.000000000 Z
11
+ date: 2021-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '0.46'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '0.46'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: googleauth
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '0.14'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '0.14'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  requirements: []
148
- rubygems_version: 3.0.6
148
+ rubygems_version: 3.2.21
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: Provides the set of classes to simplify work with Google services