weneedfeed 0.18.0 → 0.19.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/Gemfile.lock +17 -17
- data/README.md +2 -0
- data/lib/weneedfeed/item.rb +10 -4
- data/lib/weneedfeed/version.rb +1 -1
- data/templates/show_opml.xml.erb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9d31309ab79323a5636742b707b64a6c89097b04a76492dab99eb0894b4194a
|
4
|
+
data.tar.gz: 338308559267e41142e5739d4d05829a5241939882d32768b76ff5e0f8418610
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f32fa9780eb02d4c3240ff9e2fa330b7b31451808ab23b23235cf1e13746922d1a022a436a5b5cb91cf1d5c50dedc7c4aa32806fad0094c0e4841db2be36ed36
|
7
|
+
data.tar.gz: 77c4be1a945dd40aa3d332ff7729d5540e1c29fcd701a5c317b0173c000d94be01c8d8c5349715bcf1f3c9643dc00d075c37643a676613b681dac63fc2cf0c09
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## Unreleased
|
9
9
|
|
10
|
+
## 0.19.2 - 2022-08-01
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
|
14
|
+
- Fix XML excape on OPML.
|
15
|
+
|
16
|
+
## 0.19.1 - 2022-08-01
|
17
|
+
|
18
|
+
### Fixed
|
19
|
+
|
20
|
+
- Fix bug when time item includes white spaces.
|
21
|
+
|
22
|
+
## 0.19.0 - 2022-08-01
|
23
|
+
|
24
|
+
### Added
|
25
|
+
|
26
|
+
- Support %m月%d日配信 date format
|
27
|
+
|
10
28
|
## 0.18.0 - 2022-04-17
|
11
29
|
|
12
30
|
### Added
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
weneedfeed (0.
|
4
|
+
weneedfeed (0.19.2)
|
5
5
|
activesupport
|
6
6
|
addressable
|
7
7
|
builder
|
@@ -17,7 +17,7 @@ PATH
|
|
17
17
|
GEM
|
18
18
|
remote: https://rubygems.org/
|
19
19
|
specs:
|
20
|
-
activesupport (7.0.
|
20
|
+
activesupport (7.0.3.1)
|
21
21
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
22
22
|
i18n (>= 1.6, < 2)
|
23
23
|
minitest (>= 5.1)
|
@@ -46,8 +46,8 @@ GEM
|
|
46
46
|
faraday-em_synchrony (1.0.0)
|
47
47
|
faraday-excon (1.1.0)
|
48
48
|
faraday-httpclient (1.0.1)
|
49
|
-
faraday-multipart (1.0.
|
50
|
-
multipart-post (
|
49
|
+
faraday-multipart (1.0.4)
|
50
|
+
multipart-post (~> 2)
|
51
51
|
faraday-net_http (1.0.1)
|
52
52
|
faraday-net_http_persistent (1.2.0)
|
53
53
|
faraday-patron (1.0.0)
|
@@ -55,34 +55,34 @@ GEM
|
|
55
55
|
faraday-retry (1.0.3)
|
56
56
|
faraday_middleware (1.2.0)
|
57
57
|
faraday (~> 1.0)
|
58
|
-
hanami-router (2.0.0.
|
58
|
+
hanami-router (2.0.0.beta1)
|
59
59
|
mustermann (~> 1.0)
|
60
60
|
mustermann-contrib (~> 1.0)
|
61
61
|
rack (~> 2.0)
|
62
|
-
hansi (0.2.
|
62
|
+
hansi (0.2.1)
|
63
63
|
hashdiff (1.0.1)
|
64
64
|
hibana (0.2.0)
|
65
65
|
hanami-router (>= 2.0.0.alpha3)
|
66
66
|
rack
|
67
67
|
tilt
|
68
|
-
i18n (1.
|
68
|
+
i18n (1.12.0)
|
69
69
|
concurrent-ruby (~> 1.0)
|
70
70
|
marcel (1.0.2)
|
71
71
|
mini_portile2 (2.8.0)
|
72
|
-
minitest (5.
|
73
|
-
multipart-post (2.
|
74
|
-
mustermann (1.1.
|
72
|
+
minitest (5.16.2)
|
73
|
+
multipart-post (2.2.3)
|
74
|
+
mustermann (1.1.2)
|
75
75
|
ruby2_keywords (~> 0.0.1)
|
76
|
-
mustermann-contrib (1.1.
|
76
|
+
mustermann-contrib (1.1.2)
|
77
77
|
hansi (~> 0.2.0)
|
78
|
-
mustermann (= 1.1.
|
79
|
-
nokogiri (1.13.
|
78
|
+
mustermann (= 1.1.2)
|
79
|
+
nokogiri (1.13.8)
|
80
80
|
mini_portile2 (~> 2.8.0)
|
81
81
|
racc (~> 1.4)
|
82
82
|
parallel (1.22.1)
|
83
83
|
parser (3.1.2.0)
|
84
84
|
ast (~> 2.4.1)
|
85
|
-
psych (4.0.
|
85
|
+
psych (4.0.4)
|
86
86
|
stringio
|
87
87
|
public_suffix (4.0.7)
|
88
88
|
racc (1.6.0)
|
@@ -125,10 +125,10 @@ GEM
|
|
125
125
|
rubocop (~> 1.19)
|
126
126
|
ruby-progressbar (1.11.0)
|
127
127
|
ruby2_keywords (0.0.5)
|
128
|
-
stringio (3.0.
|
128
|
+
stringio (3.0.2)
|
129
129
|
thor (1.2.1)
|
130
|
-
tilt (2.0.
|
131
|
-
tzinfo (2.0.
|
130
|
+
tilt (2.0.11)
|
131
|
+
tzinfo (2.0.5)
|
132
132
|
concurrent-ruby (~> 1.0)
|
133
133
|
unicode-display_width (2.1.0)
|
134
134
|
webmock (3.14.0)
|
data/README.md
CHANGED
data/lib/weneedfeed/item.rb
CHANGED
@@ -10,11 +10,17 @@ module Weneedfeed
|
|
10
10
|
# @param [String] string
|
11
11
|
# @return [Time, nil]
|
12
12
|
def parse_time(string)
|
13
|
-
::Time.
|
14
|
-
rescue ArgumentError
|
13
|
+
::Time.strptime(string, '%Y年%m月%d日')
|
14
|
+
rescue ::ArgumentError
|
15
15
|
begin
|
16
|
-
::Time.strptime(string, '%
|
16
|
+
time = ::Time.strptime(string, '%m月%d日')
|
17
|
+
time -= 60 * 60 * 24 * 365 if time > Time.now
|
18
|
+
time
|
17
19
|
rescue ArgumentError
|
20
|
+
begin
|
21
|
+
::Time.parse(string)
|
22
|
+
rescue ArgumentError, RangeError
|
23
|
+
end
|
18
24
|
end
|
19
25
|
end
|
20
26
|
end
|
@@ -143,7 +149,7 @@ module Weneedfeed
|
|
143
149
|
node = time_node
|
144
150
|
return unless node
|
145
151
|
|
146
|
-
node['datetime'] || node.inner_text
|
152
|
+
node['datetime'] || node.inner_text&.strip
|
147
153
|
end
|
148
154
|
end
|
149
155
|
end
|
data/lib/weneedfeed/version.rb
CHANGED
data/templates/show_opml.xml.erb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<opml version="1.0">
|
3
3
|
<head>
|
4
|
-
<title><%= @schema.title %></title>
|
4
|
+
<title><%= @schema.title.encode(xml: :text) %></title>
|
5
5
|
</head>
|
6
6
|
<body>
|
7
|
-
<outline text
|
7
|
+
<outline text=<%= @schema.title.encode(xml: :attr) %> title=<%= @schema.title.encode(xml: :attr) %>>
|
8
8
|
<% page_schemata.each do |page_schema| %>
|
9
|
-
<outline type="rss"
|
9
|
+
<outline type="rss" attr=<%= page_schema.title.encode(xml: :attr) %> title=<%= page_schema.title.encode(xml: :attr) %> xmlUrl="<%= "#{request.base_url}#{feed_path(page_id: page_schema.id)}" %>" htmlUrl="<%= page_schema.url %>"/>
|
10
10
|
<% end %>
|
11
11
|
</outline>
|
12
12
|
</body>
|
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.19.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
234
|
- !ruby/object:Gem::Version
|
235
235
|
version: '0'
|
236
236
|
requirements: []
|
237
|
-
rubygems_version: 3.
|
237
|
+
rubygems_version: 3.3.7
|
238
238
|
signing_key:
|
239
239
|
specification_version: 4
|
240
240
|
summary: Generate feeds from URL and selectors.
|