weneedfeed 0.9.2 → 0.12.0
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 +4 -4
- data/.github/workflows/test.yml +8 -2
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +23 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +82 -59
- data/lib/weneedfeed/faraday_response_middleware.rb +4 -0
- data/lib/weneedfeed/item.rb +9 -6
- data/lib/weneedfeed/version.rb +1 -1
- data/weneedfeed.gemspec +4 -1
- metadata +19 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8df6dfcc585251215fe01c5a985fc9e83c7bf6e706578751e4b5f4e4a38ebc8f
|
|
4
|
+
data.tar.gz: 7287d78034b62dafabedfbfa011c0af18d2c7cf23d605d3c0b0c6dce795062eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6baa16dd012ccdcccc2bf9173e2884295514e70eded457138d1a55f06a951572a6404bc4650268524d3ba1a1191fec00b7a1575d4b77d652753e714f2af61167
|
|
7
|
+
data.tar.gz: 10336f0bb0bbcfe115805b834be4a976ad9256a6e6a4efa54aa0a247092ec3da3ff2b3cb1e72bf260b057ea6a9d82382db508e0a420441fbb09ea32615547727
|
data/.github/workflows/test.yml
CHANGED
|
@@ -4,17 +4,23 @@ on:
|
|
|
4
4
|
pull_request:
|
|
5
5
|
push:
|
|
6
6
|
branches:
|
|
7
|
-
-
|
|
7
|
+
- main
|
|
8
8
|
|
|
9
9
|
jobs:
|
|
10
10
|
rspec:
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
ruby:
|
|
15
|
+
- 2.7.2
|
|
16
|
+
- 3.0.2
|
|
11
17
|
runs-on: ubuntu-20.04
|
|
12
18
|
steps:
|
|
13
19
|
- uses: actions/checkout@v2
|
|
14
20
|
- uses: ruby/setup-ruby@v1
|
|
15
21
|
with:
|
|
16
22
|
bundler-cache: true
|
|
17
|
-
ruby-version:
|
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
|
18
24
|
- run: bundle exec rspec --force-color
|
|
19
25
|
rubocop:
|
|
20
26
|
runs-on: ubuntu-20.04
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## Unreleased
|
|
9
9
|
|
|
10
|
-
## 0.
|
|
10
|
+
## 0.12.0 - 2022-04-14
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Handle incorrect URLs a little better.
|
|
15
|
+
|
|
16
|
+
## 0.11.0 - 2022-04-13
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Support invalid link URL and image URL.
|
|
21
|
+
|
|
22
|
+
## 0.10.0 - 2022-04-13
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- Replace mimemagic with marcel.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- Fix error on activesupport 7.
|
|
31
|
+
|
|
32
|
+
## 0.9.2 - 2020-12-03
|
|
11
33
|
|
|
12
34
|
### Fixed
|
|
13
35
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
weneedfeed (0.
|
|
4
|
+
weneedfeed (0.12.0)
|
|
5
5
|
activesupport
|
|
6
|
+
addressable
|
|
6
7
|
builder
|
|
7
8
|
faraday
|
|
8
9
|
faraday_middleware
|
|
9
10
|
hibana (>= 0.2)
|
|
10
|
-
|
|
11
|
+
marcel
|
|
11
12
|
nokogiri
|
|
12
13
|
rack-capture (>= 0.4.0)
|
|
13
14
|
thor
|
|
@@ -15,25 +16,45 @@ PATH
|
|
|
15
16
|
GEM
|
|
16
17
|
remote: https://rubygems.org/
|
|
17
18
|
specs:
|
|
18
|
-
activesupport (
|
|
19
|
+
activesupport (7.0.2.3)
|
|
19
20
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
20
|
-
i18n (>=
|
|
21
|
-
minitest (
|
|
22
|
-
tzinfo (~>
|
|
23
|
-
|
|
24
|
-
addressable (2.7.0)
|
|
21
|
+
i18n (>= 1.6, < 2)
|
|
22
|
+
minitest (>= 5.1)
|
|
23
|
+
tzinfo (~> 2.0)
|
|
24
|
+
addressable (2.8.0)
|
|
25
25
|
public_suffix (>= 2.0.2, < 5.0)
|
|
26
|
-
ast (2.4.
|
|
26
|
+
ast (2.4.2)
|
|
27
27
|
builder (3.2.4)
|
|
28
|
-
concurrent-ruby (1.1.
|
|
29
|
-
crack (0.4.
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
concurrent-ruby (1.1.10)
|
|
29
|
+
crack (0.4.5)
|
|
30
|
+
rexml
|
|
31
|
+
diff-lcs (1.5.0)
|
|
32
|
+
faraday (1.10.0)
|
|
33
|
+
faraday-em_http (~> 1.0)
|
|
34
|
+
faraday-em_synchrony (~> 1.0)
|
|
35
|
+
faraday-excon (~> 1.1)
|
|
36
|
+
faraday-httpclient (~> 1.0)
|
|
37
|
+
faraday-multipart (~> 1.0)
|
|
38
|
+
faraday-net_http (~> 1.0)
|
|
39
|
+
faraday-net_http_persistent (~> 1.0)
|
|
40
|
+
faraday-patron (~> 1.0)
|
|
41
|
+
faraday-rack (~> 1.0)
|
|
42
|
+
faraday-retry (~> 1.0)
|
|
43
|
+
ruby2_keywords (>= 0.0.4)
|
|
44
|
+
faraday-em_http (1.0.0)
|
|
45
|
+
faraday-em_synchrony (1.0.0)
|
|
46
|
+
faraday-excon (1.1.0)
|
|
47
|
+
faraday-httpclient (1.0.1)
|
|
48
|
+
faraday-multipart (1.0.3)
|
|
32
49
|
multipart-post (>= 1.2, < 3)
|
|
33
|
-
|
|
34
|
-
|
|
50
|
+
faraday-net_http (1.0.1)
|
|
51
|
+
faraday-net_http_persistent (1.2.0)
|
|
52
|
+
faraday-patron (1.0.0)
|
|
53
|
+
faraday-rack (1.0.0)
|
|
54
|
+
faraday-retry (1.0.3)
|
|
55
|
+
faraday_middleware (1.2.0)
|
|
35
56
|
faraday (~> 1.0)
|
|
36
|
-
hanami-router (2.0.0.
|
|
57
|
+
hanami-router (2.0.0.alpha5)
|
|
37
58
|
mustermann (~> 1.0)
|
|
38
59
|
mustermann-contrib (~> 1.0)
|
|
39
60
|
rack (~> 2.0)
|
|
@@ -43,72 +64,73 @@ GEM
|
|
|
43
64
|
hanami-router (>= 2.0.0.alpha3)
|
|
44
65
|
rack
|
|
45
66
|
tilt
|
|
46
|
-
i18n (1.
|
|
67
|
+
i18n (1.10.0)
|
|
47
68
|
concurrent-ruby (~> 1.0)
|
|
48
|
-
|
|
49
|
-
mini_portile2 (2.
|
|
50
|
-
minitest (5.
|
|
69
|
+
marcel (1.0.2)
|
|
70
|
+
mini_portile2 (2.8.0)
|
|
71
|
+
minitest (5.15.0)
|
|
51
72
|
multipart-post (2.1.1)
|
|
52
73
|
mustermann (1.1.1)
|
|
53
74
|
ruby2_keywords (~> 0.0.1)
|
|
54
75
|
mustermann-contrib (1.1.1)
|
|
55
76
|
hansi (~> 0.2.0)
|
|
56
77
|
mustermann (= 1.1.1)
|
|
57
|
-
nokogiri (1.
|
|
58
|
-
mini_portile2 (~> 2.
|
|
59
|
-
|
|
60
|
-
|
|
78
|
+
nokogiri (1.13.4)
|
|
79
|
+
mini_portile2 (~> 2.8.0)
|
|
80
|
+
racc (~> 1.4)
|
|
81
|
+
parallel (1.22.1)
|
|
82
|
+
parser (3.1.2.0)
|
|
61
83
|
ast (~> 2.4.1)
|
|
62
|
-
public_suffix (4.0.
|
|
84
|
+
public_suffix (4.0.7)
|
|
85
|
+
racc (1.6.0)
|
|
63
86
|
rack (2.2.3)
|
|
64
87
|
rack-capture (0.4.0)
|
|
65
88
|
rack
|
|
66
89
|
rack-test (1.1.0)
|
|
67
90
|
rack (>= 1.0, < 3)
|
|
68
|
-
rainbow (3.
|
|
91
|
+
rainbow (3.1.1)
|
|
69
92
|
rake (12.3.3)
|
|
70
|
-
regexp_parser (
|
|
71
|
-
rexml (3.2.
|
|
72
|
-
rspec (3.
|
|
73
|
-
rspec-core (~> 3.
|
|
74
|
-
rspec-expectations (~> 3.
|
|
75
|
-
rspec-mocks (~> 3.
|
|
76
|
-
rspec-core (3.
|
|
77
|
-
rspec-support (~> 3.
|
|
78
|
-
rspec-expectations (3.
|
|
93
|
+
regexp_parser (2.3.0)
|
|
94
|
+
rexml (3.2.5)
|
|
95
|
+
rspec (3.11.0)
|
|
96
|
+
rspec-core (~> 3.11.0)
|
|
97
|
+
rspec-expectations (~> 3.11.0)
|
|
98
|
+
rspec-mocks (~> 3.11.0)
|
|
99
|
+
rspec-core (3.11.0)
|
|
100
|
+
rspec-support (~> 3.11.0)
|
|
101
|
+
rspec-expectations (3.11.0)
|
|
79
102
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
80
|
-
rspec-support (~> 3.
|
|
81
|
-
rspec-mocks (3.
|
|
103
|
+
rspec-support (~> 3.11.0)
|
|
104
|
+
rspec-mocks (3.11.1)
|
|
82
105
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
83
|
-
rspec-support (~> 3.
|
|
84
|
-
rspec-support (3.
|
|
85
|
-
rubocop (1.
|
|
106
|
+
rspec-support (~> 3.11.0)
|
|
107
|
+
rspec-support (3.11.0)
|
|
108
|
+
rubocop (1.27.0)
|
|
86
109
|
parallel (~> 1.10)
|
|
87
|
-
parser (>=
|
|
110
|
+
parser (>= 3.1.0.0)
|
|
88
111
|
rainbow (>= 2.2.2, < 4.0)
|
|
89
|
-
regexp_parser (>= 1.8)
|
|
112
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
90
113
|
rexml
|
|
91
|
-
rubocop-ast (>= 1.
|
|
114
|
+
rubocop-ast (>= 1.16.0, < 2.0)
|
|
92
115
|
ruby-progressbar (~> 1.7)
|
|
93
|
-
unicode-display_width (>= 1.4.0, <
|
|
94
|
-
rubocop-ast (1.
|
|
95
|
-
parser (>=
|
|
96
|
-
rubocop-
|
|
116
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
117
|
+
rubocop-ast (1.17.0)
|
|
118
|
+
parser (>= 3.1.1.0)
|
|
119
|
+
rubocop-rake (0.6.0)
|
|
97
120
|
rubocop (~> 1.0)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
121
|
+
rubocop-rspec (2.9.0)
|
|
122
|
+
rubocop (~> 1.19)
|
|
123
|
+
ruby-progressbar (1.11.0)
|
|
124
|
+
ruby2_keywords (0.0.5)
|
|
125
|
+
thor (1.2.1)
|
|
103
126
|
tilt (2.0.10)
|
|
104
|
-
tzinfo (
|
|
105
|
-
|
|
106
|
-
unicode-display_width (1.
|
|
107
|
-
webmock (3.
|
|
108
|
-
addressable (>= 2.
|
|
127
|
+
tzinfo (2.0.4)
|
|
128
|
+
concurrent-ruby (~> 1.0)
|
|
129
|
+
unicode-display_width (2.1.0)
|
|
130
|
+
webmock (3.14.0)
|
|
131
|
+
addressable (>= 2.8.0)
|
|
109
132
|
crack (>= 0.3.2)
|
|
110
133
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
111
|
-
zeitwerk (2.4.2)
|
|
112
134
|
|
|
113
135
|
PLATFORMS
|
|
114
136
|
ruby
|
|
@@ -118,9 +140,10 @@ DEPENDENCIES
|
|
|
118
140
|
rake (~> 12.0)
|
|
119
141
|
rspec
|
|
120
142
|
rubocop
|
|
143
|
+
rubocop-rake
|
|
121
144
|
rubocop-rspec
|
|
122
145
|
webmock
|
|
123
146
|
weneedfeed!
|
|
124
147
|
|
|
125
148
|
BUNDLED WITH
|
|
126
|
-
2.
|
|
149
|
+
2.2.29
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# To load ActiveSupport::IsolatedExecutionState on activesupport 7.
|
|
4
|
+
# https://github.com/r7kamura/weneedfeed/issues/19
|
|
5
|
+
require 'active_support'
|
|
6
|
+
|
|
3
7
|
require 'active_support/core_ext/array/conversions'
|
|
4
8
|
require 'active_support/core_ext/hash/conversions'
|
|
5
9
|
require 'faraday'
|
data/lib/weneedfeed/item.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require '
|
|
4
|
-
require '
|
|
3
|
+
require 'addressable'
|
|
4
|
+
require 'marcel'
|
|
5
5
|
|
|
6
6
|
module Weneedfeed
|
|
7
7
|
class Item
|
|
@@ -54,8 +54,7 @@ module Weneedfeed
|
|
|
54
54
|
def image_mime_type
|
|
55
55
|
return unless image_url
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
::MimeMagic.by_path(uri.path)&.type
|
|
57
|
+
::Marcel::Magic.by_path(image_url)&.type
|
|
59
58
|
end
|
|
60
59
|
|
|
61
60
|
# @return [String, nil]
|
|
@@ -75,7 +74,7 @@ module Weneedfeed
|
|
|
75
74
|
def image_url
|
|
76
75
|
return unless image_path_or_url
|
|
77
76
|
|
|
78
|
-
::URI.join(
|
|
77
|
+
::Addressable::URI.join(
|
|
79
78
|
@url,
|
|
80
79
|
image_path_or_url
|
|
81
80
|
).to_s
|
|
@@ -83,7 +82,9 @@ module Weneedfeed
|
|
|
83
82
|
|
|
84
83
|
# @return [String]
|
|
85
84
|
def link
|
|
86
|
-
|
|
85
|
+
return unless link_path_or_url
|
|
86
|
+
|
|
87
|
+
::Addressable::URI.join(
|
|
87
88
|
@url,
|
|
88
89
|
link_path_or_url
|
|
89
90
|
).to_s
|
|
@@ -97,6 +98,8 @@ module Weneedfeed
|
|
|
97
98
|
# @return [String, nil]
|
|
98
99
|
def link_path_or_url
|
|
99
100
|
node = link_node
|
|
101
|
+
return unless node
|
|
102
|
+
|
|
100
103
|
node['href'] || node.inner_text
|
|
101
104
|
end
|
|
102
105
|
|
data/lib/weneedfeed/version.rb
CHANGED
data/weneedfeed.gemspec
CHANGED
|
@@ -16,6 +16,8 @@ Gem::Specification.new do |spec|
|
|
|
16
16
|
spec.metadata['homepage_uri'] = spec.homepage
|
|
17
17
|
spec.metadata['source_code_uri'] = spec.homepage
|
|
18
18
|
|
|
19
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
20
|
+
|
|
19
21
|
# Specify which files should be added to the gem when it is released.
|
|
20
22
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
21
23
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
@@ -26,11 +28,12 @@ Gem::Specification.new do |spec|
|
|
|
26
28
|
spec.require_paths = ['lib']
|
|
27
29
|
|
|
28
30
|
spec.add_runtime_dependency 'activesupport'
|
|
31
|
+
spec.add_runtime_dependency 'addressable'
|
|
29
32
|
spec.add_runtime_dependency 'builder'
|
|
30
33
|
spec.add_runtime_dependency 'faraday'
|
|
31
34
|
spec.add_runtime_dependency 'faraday_middleware'
|
|
32
35
|
spec.add_runtime_dependency 'hibana', '>= 0.2'
|
|
33
|
-
spec.add_runtime_dependency '
|
|
36
|
+
spec.add_runtime_dependency 'marcel'
|
|
34
37
|
spec.add_runtime_dependency 'nokogiri'
|
|
35
38
|
spec.add_runtime_dependency 'rack-capture', '>= 0.4.0'
|
|
36
39
|
spec.add_runtime_dependency 'thor'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: weneedfeed
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryo Nakamura
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-04-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -24,6 +24,20 @@ dependencies:
|
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: addressable
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: builder
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -81,7 +95,7 @@ dependencies:
|
|
|
81
95
|
- !ruby/object:Gem::Version
|
|
82
96
|
version: '0.2'
|
|
83
97
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name:
|
|
98
|
+
name: marcel
|
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
|
86
100
|
requirements:
|
|
87
101
|
- - ">="
|
|
@@ -186,6 +200,7 @@ licenses:
|
|
|
186
200
|
metadata:
|
|
187
201
|
homepage_uri: https://github.com/r7kamura/weneedfeed
|
|
188
202
|
source_code_uri: https://github.com/r7kamura/weneedfeed
|
|
203
|
+
rubygems_mfa_required: 'true'
|
|
189
204
|
post_install_message:
|
|
190
205
|
rdoc_options: []
|
|
191
206
|
require_paths:
|
|
@@ -201,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
201
216
|
- !ruby/object:Gem::Version
|
|
202
217
|
version: '0'
|
|
203
218
|
requirements: []
|
|
204
|
-
rubygems_version: 3.1.
|
|
219
|
+
rubygems_version: 3.1.4
|
|
205
220
|
signing_key:
|
|
206
221
|
specification_version: 4
|
|
207
222
|
summary: Generate feeds from URL and selectors.
|