curation 1.7 → 1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +51 -27
- data/lib/curation/version.rb +1 -1
- data/lib/curation.rb +9 -4
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8086e74a861e147bce3a73dcec3cebef7d5d98ede440c911f57757feaaac354
|
4
|
+
data.tar.gz: 3d6ff271bcfbf8599a76653d60b2c26ed3832c1c174885d114912f95a7707ee7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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.
|
19
|
-
|
20
|
-
|
21
|
-
faraday (
|
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
|
-
|
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.
|
30
|
-
http-cookie (1.0.
|
50
|
+
fastimage (2.2.6)
|
51
|
+
http-cookie (1.0.4)
|
31
52
|
domain_name (~> 0.5)
|
32
|
-
metainspector (5.
|
33
|
-
addressable (~> 2.7
|
34
|
-
faraday (~> 1.
|
35
|
-
faraday-cookie_jar (~> 0.0
|
36
|
-
faraday-encoding (~> 0.0
|
37
|
-
faraday-http-cache (~> 2.2
|
38
|
-
faraday_middleware (~> 1.0
|
39
|
-
fastimage (~> 2.
|
40
|
-
nesty (~> 1.0
|
41
|
-
nokogiri (~> 1.
|
42
|
-
mini_portile2 (2.
|
43
|
-
minitest (5.
|
44
|
-
minitest-reporters (1.
|
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.
|
52
|
-
mini_portile2 (~> 2.
|
53
|
-
|
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.
|
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.
|
82
|
+
unf_ext (0.0.8)
|
59
83
|
|
60
84
|
PLATFORMS
|
61
85
|
ruby
|
data/lib/curation/version.rb
CHANGED
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.
|
192
|
-
|
193
|
-
|
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.
|
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:
|
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.
|
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: []
|