lt-lcms 0.3.0 → 0.3.1

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
  SHA256:
3
- metadata.gz: b12fd4f69d31ee5b9f655a281b1b0bdb81cd94be792971a647d18bbbb8ccd0f9
4
- data.tar.gz: 353f480467a3508873833ef7a00e495f68bb87e19772340bfdd2d34195f0ae2a
3
+ metadata.gz: 4218af65b6387e63291c22563ea8afd65e674d1097f070f0e27100056d126de0
4
+ data.tar.gz: 3c288ecb99ac82616317f9195ff46b110375b857aa40d2fbb67ae9eebb1f099e
5
5
  SHA512:
6
- metadata.gz: a0032513cb0cfb940ae7762e20ee04167df2b7daac2a7159b16aced33c5b61fd3bca98c85948354b366e74e60fd19ef4796f3e1f535d58833071aeff86d9d975
7
- data.tar.gz: 3ba9532a34597760113c383404eabd8a57af3d9309d7796d91654ae33e7aff3b6fdb0b3aa6bfccb003295acef24d63c07f1f5bc791fae425910ddb74eda6e597
6
+ metadata.gz: 46c144afd69d0693fd59ac34034763f0ff0ce83f6244abcad89cbde11088446647d3b5eae419e85589c17cc100fd9f4bed99a84da3595fb42dca38472e096a0b
7
+ data.tar.gz: 2027cb6f6348e89d2fd6560dfd91cb29e8bb0255bc44635944d7f7c7de7dfb7b5c1c813212d468a192dd7731d55cb6aa4c30f5d7b89f65932189739bbc4e95e4
data/.gitignore CHANGED
@@ -10,5 +10,4 @@
10
10
  # Ignore IDE specific files
11
11
  .idea/
12
12
 
13
- Gemfile.lock
14
13
  .DS_Store
@@ -4,6 +4,11 @@ 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
+ ## [0.3.0](https://github.com/learningtapestry/lt-lcms/compare/v0.3.0...v0.3.1)
8
+
9
+ ### Fixed
10
+ - Fix the URLs inside links in the downloaded GDoc [#9](https://github.com/learningtapestry/lt-lcms/pull/9)
11
+
7
12
  ## [0.3.0](https://github.com/learningtapestry/lt-lcms/compare/v0.2.0...v0.3.0)
8
13
 
9
14
  ### Added
@@ -0,0 +1,105 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ lt-lcms (0.3.1)
5
+ google-api-client (~> 0.38)
6
+ httparty (~> 0.18)
7
+ lt-google-api (~> 0.1)
8
+ nokogiri (~> 1.10, >= 1.10.8)
9
+ rubyzip (~> 2)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ addressable (2.7.0)
15
+ public_suffix (>= 2.0.2, < 5.0)
16
+ ast (2.4.0)
17
+ childprocess (1.0.0)
18
+ declarative (0.0.20)
19
+ declarative-option (0.1.0)
20
+ faraday (1.0.1)
21
+ multipart-post (>= 1.2, < 3)
22
+ google-api-client (0.45.0)
23
+ addressable (~> 2.5, >= 2.5.1)
24
+ googleauth (~> 0.9)
25
+ httpclient (>= 2.8.1, < 3.0)
26
+ mini_mime (~> 1.0)
27
+ representable (~> 3.0)
28
+ retriable (>= 2.0, < 4.0)
29
+ rexml
30
+ signet (~> 0.12)
31
+ googleauth (0.13.1)
32
+ faraday (>= 0.17.3, < 2.0)
33
+ jwt (>= 1.4, < 3.0)
34
+ memoist (~> 0.16)
35
+ multi_json (~> 1.11)
36
+ os (>= 0.9, < 2.0)
37
+ signet (~> 0.14)
38
+ httparty (0.18.1)
39
+ mime-types (~> 3.0)
40
+ multi_xml (>= 0.5.2)
41
+ httpclient (2.8.3)
42
+ iniparse (1.5.0)
43
+ jaro_winkler (1.5.4)
44
+ jwt (2.2.2)
45
+ lt-google-api (0.1.1)
46
+ google-api-client
47
+ googleauth
48
+ memoist (0.16.2)
49
+ mime-types (3.3.1)
50
+ mime-types-data (~> 3.2015)
51
+ mime-types-data (3.2020.0512)
52
+ mini_mime (1.0.2)
53
+ mini_portile2 (2.4.0)
54
+ multi_json (1.15.0)
55
+ multi_xml (0.6.0)
56
+ multipart-post (2.1.1)
57
+ nokogiri (1.10.10)
58
+ mini_portile2 (~> 2.4.0)
59
+ os (1.1.1)
60
+ overcommit (0.49.1)
61
+ childprocess (>= 0.6.3, < 2.0)
62
+ iniparse (~> 1.4)
63
+ parallel (1.19.1)
64
+ parser (2.7.1.2)
65
+ ast (~> 2.4.0)
66
+ powerpack (0.1.2)
67
+ public_suffix (4.0.6)
68
+ rainbow (3.0.0)
69
+ rake (13.0.1)
70
+ representable (3.0.4)
71
+ declarative (< 0.1.0)
72
+ declarative-option (< 0.2.0)
73
+ uber (< 0.2.0)
74
+ retriable (3.1.2)
75
+ rexml (3.2.4)
76
+ rubocop (0.59.2)
77
+ jaro_winkler (~> 1.5.1)
78
+ parallel (~> 1.10)
79
+ parser (>= 2.5, != 2.5.1.1)
80
+ powerpack (~> 0.1)
81
+ rainbow (>= 2.2.2, < 4.0)
82
+ ruby-progressbar (~> 1.7)
83
+ unicode-display_width (~> 1.0, >= 1.0.1)
84
+ ruby-progressbar (1.10.1)
85
+ rubyzip (2.3.0)
86
+ signet (0.14.0)
87
+ addressable (~> 2.3)
88
+ faraday (>= 0.17.3, < 2.0)
89
+ jwt (>= 1.5, < 3.0)
90
+ multi_json (~> 1.10)
91
+ uber (0.1.0)
92
+ unicode-display_width (1.7.0)
93
+
94
+ PLATFORMS
95
+ ruby
96
+
97
+ DEPENDENCIES
98
+ bundler (~> 1.16)
99
+ lt-lcms!
100
+ overcommit (~> 0.49.1)
101
+ rake (~> 13.0)
102
+ rubocop (~> 0.59.2)
103
+
104
+ BUNDLED WITH
105
+ 1.17.3
@@ -8,6 +8,7 @@ module Lt
8
8
  module Downloader
9
9
  class Gdoc < Base
10
10
  GOOGLE_DRAWING_RE = %r{https?://docs\.google\.com/?[^"]*/drawings/[^"]*}i
11
+ GOOGLE_URL_RE = %r{https://www\.google\.com/url\?q=([^&]*)&?.*}i
11
12
  MIME_TYPE = 'application/vnd.google-apps.document'
12
13
  MIME_TYPE_EXPORT = 'text/html'
13
14
 
@@ -16,7 +17,9 @@ module Lt
16
17
  end
17
18
 
18
19
  def download
19
- super(&method(:handle_google_drawings))
20
+ super do |html|
21
+ fix_links handle_google_drawings(html)
22
+ end
20
23
  end
21
24
 
22
25
  private
@@ -25,6 +28,16 @@ module Lt
25
28
  BASE_DPI = 72.0
26
29
  private_constant :BASE_DPI
27
30
 
31
+ def fix_links(html)
32
+ doc = Nokogiri::HTML(html)
33
+ doc.css('a').each do |link|
34
+ next if link['href'].blank?
35
+
36
+ link['href'] = CGI.unescape_html(link['href']).gsub GOOGLE_URL_RE, '\1'
37
+ end
38
+ doc.to_s
39
+ end
40
+
28
41
  def handle_google_drawings(html)
29
42
  return html unless (match = html.scan(GOOGLE_DRAWING_RE))
30
43
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lt
4
4
  module Lcms
5
- VERSION = '0.3.0'
5
+ VERSION = '0.3.1'
6
6
  end
7
7
  end
@@ -31,14 +31,14 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
31
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
32
  spec.require_paths = ['lib']
33
33
 
34
- spec.add_dependency 'google-api-client', '~> 0.36'
35
- spec.add_dependency 'httparty', '~> 0.17'
34
+ spec.add_dependency 'google-api-client', '~> 0.38'
35
+ spec.add_dependency 'httparty', '~> 0.18'
36
36
  spec.add_dependency 'lt-google-api', '~> 0.1'
37
+ spec.add_dependency 'nokogiri', '~> 1.10', '>= 1.10.8'
37
38
  spec.add_dependency 'rubyzip', '~> 2'
38
39
 
39
40
  spec.add_development_dependency 'bundler', '~> 1.16'
40
- spec.add_development_dependency 'bundler-audit'
41
41
  spec.add_development_dependency 'overcommit', '~> 0.49.1'
42
- spec.add_development_dependency 'rake', '~> 10.0'
42
+ spec.add_development_dependency 'rake', '~> 13.0'
43
43
  spec.add_development_dependency 'rubocop', '~> 0.59.2'
44
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lt-lcms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
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-05-05 00:00:00.000000000 Z
11
+ date: 2020-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.36'
19
+ version: '0.38'
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.36'
26
+ version: '0.38'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: httparty
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.17'
33
+ version: '0.18'
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.17'
40
+ version: '0.18'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: lt-google-api
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -53,47 +53,53 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.1'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rubyzip
56
+ name: nokogiri
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2'
61
+ version: '1.10'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 1.10.8
62
65
  type: :runtime
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
66
69
  - - "~>"
67
70
  - !ruby/object:Gem::Version
68
- version: '2'
71
+ version: '1.10'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 1.10.8
69
75
  - !ruby/object:Gem::Dependency
70
- name: bundler
76
+ name: rubyzip
71
77
  requirement: !ruby/object:Gem::Requirement
72
78
  requirements:
73
79
  - - "~>"
74
80
  - !ruby/object:Gem::Version
75
- version: '1.16'
76
- type: :development
81
+ version: '2'
82
+ type: :runtime
77
83
  prerelease: false
78
84
  version_requirements: !ruby/object:Gem::Requirement
79
85
  requirements:
80
86
  - - "~>"
81
87
  - !ruby/object:Gem::Version
82
- version: '1.16'
88
+ version: '2'
83
89
  - !ruby/object:Gem::Dependency
84
- name: bundler-audit
90
+ name: bundler
85
91
  requirement: !ruby/object:Gem::Requirement
86
92
  requirements:
87
- - - ">="
93
+ - - "~>"
88
94
  - !ruby/object:Gem::Version
89
- version: '0'
95
+ version: '1.16'
90
96
  type: :development
91
97
  prerelease: false
92
98
  version_requirements: !ruby/object:Gem::Requirement
93
99
  requirements:
94
- - - ">="
100
+ - - "~>"
95
101
  - !ruby/object:Gem::Version
96
- version: '0'
102
+ version: '1.16'
97
103
  - !ruby/object:Gem::Dependency
98
104
  name: overcommit
99
105
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +120,14 @@ dependencies:
114
120
  requirements:
115
121
  - - "~>"
116
122
  - !ruby/object:Gem::Version
117
- version: '10.0'
123
+ version: '13.0'
118
124
  type: :development
119
125
  prerelease: false
120
126
  version_requirements: !ruby/object:Gem::Requirement
121
127
  requirements:
122
128
  - - "~>"
123
129
  - !ruby/object:Gem::Version
124
- version: '10.0'
130
+ version: '13.0'
125
131
  - !ruby/object:Gem::Dependency
126
132
  name: rubocop
127
133
  requirement: !ruby/object:Gem::Requirement
@@ -152,6 +158,7 @@ files:
152
158
  - ".ruby-version"
153
159
  - CHANGELOG.md
154
160
  - Gemfile
161
+ - Gemfile.lock
155
162
  - LICENSE
156
163
  - README.md
157
164
  - Rakefile