curation 1.7 → 1.8

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: e3e4d559a2583393e2d58cba1bfe30ef8870733ce013c00780b29706b9bfce68
4
- data.tar.gz: 5802c61d564cfc2568f9173f6b270e3e288f4dbdfcfec624b02205bd01a81aaf
3
+ metadata.gz: b8086e74a861e147bce3a73dcec3cebef7d5d98ede440c911f57757feaaac354
4
+ data.tar.gz: 3d6ff271bcfbf8599a76653d60b2c26ed3832c1c174885d114912f95a7707ee7
5
5
  SHA512:
6
- metadata.gz: 7cd290b2f9b5d9188c9db0bd07a9f88ce564faac927c3590af5c88cf11be0a848dd209fd7c0dd48e5af103bc8f05822911e7ffbe94c9a35dab0732e9e7d70a21
7
- data.tar.gz: 0bcd9304b78f9ddb362ef7809831fe5065454adc64aa117df302d8a0ec384d92d7aac64e2dc1e8ebc3caf12267d78dbf7150f9fe12254a2b1d31509644e1e62e
6
+ metadata.gz: '084c4c3fbdf3491530cd4ca6ca0fdc736df69a22a49cce40b0d7c8d169f6a45e7c5f01f280957016e32bedca93d593bb2d9e60141e148ee4f110935877543168'
7
+ data.tar.gz: 3fe95dde59a8cb2268a1f93ff1e8b7ccbca9212a7b0cdc0093c16925549545df422945db25ab29f250fcc05242b5d7b01eb822f3c97b4e2b96d19653d70dff39
data/Gemfile.lock CHANGED
@@ -1,61 +1,85 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- curation (1.7)
4
+ curation (1.8)
5
5
  metainspector
6
6
  nokogiri
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- addressable (2.7.0)
11
+ addressable (2.8.0)
12
12
  public_suffix (>= 2.0.2, < 5.0)
13
13
  ansi (1.5.0)
14
14
  builder (3.2.4)
15
15
  byebug (11.1.3)
16
16
  domain_name (0.5.20190701)
17
17
  unf (>= 0.0.5, < 1.0.0)
18
- faraday (1.0.1)
19
- multipart-post (>= 1.2, < 3)
20
- faraday-cookie_jar (0.0.6)
21
- faraday (>= 0.7.4)
18
+ faraday (1.9.3)
19
+ faraday-em_http (~> 1.0)
20
+ faraday-em_synchrony (~> 1.0)
21
+ faraday-excon (~> 1.1)
22
+ faraday-httpclient (~> 1.0)
23
+ faraday-multipart (~> 1.0)
24
+ faraday-net_http (~> 1.0)
25
+ faraday-net_http_persistent (~> 1.0)
26
+ faraday-patron (~> 1.0)
27
+ faraday-rack (~> 1.0)
28
+ faraday-retry (~> 1.0)
29
+ ruby2_keywords (>= 0.0.4)
30
+ faraday-cookie_jar (0.0.7)
31
+ faraday (>= 0.8.0)
22
32
  http-cookie (~> 1.0.0)
33
+ faraday-em_http (1.0.0)
34
+ faraday-em_synchrony (1.0.0)
23
35
  faraday-encoding (0.0.5)
24
36
  faraday
37
+ faraday-excon (1.1.0)
25
38
  faraday-http-cache (2.2.0)
26
39
  faraday (>= 0.8)
27
- faraday_middleware (1.0.0)
40
+ faraday-httpclient (1.0.1)
41
+ faraday-multipart (1.0.3)
42
+ multipart-post (>= 1.2, < 3)
43
+ faraday-net_http (1.0.1)
44
+ faraday-net_http_persistent (1.2.0)
45
+ faraday-patron (1.0.0)
46
+ faraday-rack (1.0.0)
47
+ faraday-retry (1.0.3)
48
+ faraday_middleware (1.2.0)
28
49
  faraday (~> 1.0)
29
- fastimage (2.1.7)
30
- http-cookie (1.0.3)
50
+ fastimage (2.2.6)
51
+ http-cookie (1.0.4)
31
52
  domain_name (~> 0.5)
32
- metainspector (5.10.1)
33
- addressable (~> 2.7.0)
34
- faraday (~> 1.0.0)
35
- faraday-cookie_jar (~> 0.0.6)
36
- faraday-encoding (~> 0.0.5)
37
- faraday-http-cache (~> 2.2.0)
38
- faraday_middleware (~> 1.0.0)
39
- fastimage (~> 2.1.7)
40
- nesty (~> 1.0.2)
41
- nokogiri (~> 1.10.9)
42
- mini_portile2 (2.4.0)
43
- minitest (5.14.1)
44
- minitest-reporters (1.4.2)
53
+ metainspector (5.11.2)
54
+ addressable (~> 2.7)
55
+ faraday (~> 1.4)
56
+ faraday-cookie_jar (~> 0.0)
57
+ faraday-encoding (~> 0.0)
58
+ faraday-http-cache (~> 2.2)
59
+ faraday_middleware (~> 1.0)
60
+ fastimage (~> 2.2)
61
+ nesty (~> 1.0)
62
+ nokogiri (~> 1.11)
63
+ mini_portile2 (2.7.1)
64
+ minitest (5.15.0)
65
+ minitest-reporters (1.5.0)
45
66
  ansi
46
67
  builder
47
68
  minitest (>= 5.0)
48
69
  ruby-progressbar
49
70
  multipart-post (2.1.1)
50
71
  nesty (1.0.2)
51
- nokogiri (1.10.10)
52
- mini_portile2 (~> 2.4.0)
53
- public_suffix (4.0.5)
72
+ nokogiri (1.13.1)
73
+ mini_portile2 (~> 2.7.0)
74
+ racc (~> 1.4)
75
+ public_suffix (4.0.6)
76
+ racc (1.6.0)
54
77
  rake (12.3.3)
55
- ruby-progressbar (1.10.1)
78
+ ruby-progressbar (1.11.0)
79
+ ruby2_keywords (0.0.5)
56
80
  unf (0.1.4)
57
81
  unf_ext
58
- unf_ext (0.0.7.7)
82
+ unf_ext (0.0.8)
59
83
 
60
84
  PLATFORMS
61
85
  ruby
@@ -1,3 +1,3 @@
1
1
  module Curation
2
- VERSION = "1.7"
2
+ VERSION = "1.8"
3
3
  end
data/lib/curation.rb CHANGED
@@ -20,7 +20,7 @@ module Curation
20
20
  ]
21
21
 
22
22
  def initialize(url, html = nil)
23
- @url = url
23
+ @url = url.to_s.gsub('http://', 'https://')
24
24
  @html = html
25
25
  end
26
26
 
@@ -156,6 +156,7 @@ module Curation
156
156
  begin
157
157
  options = nokogiri.css('[type="application/ld+json"]')
158
158
  options.each do |option|
159
+ # require 'byebug'; byebug
159
160
  string = option.inner_text
160
161
  hash = JSON.parse(string)
161
162
  @json_ld << hash
@@ -188,9 +189,13 @@ module Curation
188
189
 
189
190
  def nokogiri
190
191
  unless @nokogiri
191
- file.rewind
192
- @nokogiri = Nokogiri::HTML file
193
- file.rewind
192
+ if file.nil?
193
+ @nokogiri = metainspector.parsed
194
+ else
195
+ file.rewind
196
+ @nokogiri = Nokogiri::HTML file
197
+ file.rewind
198
+ end
194
199
  end
195
200
  @nokogiri
196
201
  rescue
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curation
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.7'
4
+ version: '1.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Levy
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-25 00:00:00.000000000 Z
11
+ date: 2022-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metainspector
@@ -65,7 +65,7 @@ licenses:
65
65
  metadata:
66
66
  homepage_uri: https://github.com/arnaudlevy/curation
67
67
  source_code_uri: https://github.com/arnaudlevy/curation
68
- post_install_message:
68
+ post_install_message:
69
69
  rdoc_options: []
70
70
  require_paths:
71
71
  - lib
@@ -80,8 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  requirements: []
83
- rubygems_version: 3.0.3
84
- signing_key:
83
+ rubygems_version: 3.1.6
84
+ signing_key:
85
85
  specification_version: 4
86
86
  summary: Curation of content
87
87
  test_files: []