html2rss 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.mergify.yml +15 -0
  4. data/.rubocop.yml +11 -145
  5. data/Gemfile +19 -2
  6. data/Gemfile.lock +111 -97
  7. data/README.md +323 -270
  8. data/bin/console +1 -0
  9. data/exe/html2rss +6 -0
  10. data/html2rss.gemspec +15 -20
  11. data/lib/html2rss/attribute_post_processors/gsub.rb +30 -8
  12. data/lib/html2rss/attribute_post_processors/html_to_markdown.rb +7 -2
  13. data/lib/html2rss/attribute_post_processors/html_transformers/transform_urls_to_absolute_ones.rb +27 -0
  14. data/lib/html2rss/attribute_post_processors/html_transformers/wrap_img_in_a.rb +41 -0
  15. data/lib/html2rss/attribute_post_processors/markdown_to_html.rb +11 -2
  16. data/lib/html2rss/attribute_post_processors/parse_time.rb +11 -4
  17. data/lib/html2rss/attribute_post_processors/parse_uri.rb +12 -2
  18. data/lib/html2rss/attribute_post_processors/sanitize_html.rb +40 -44
  19. data/lib/html2rss/attribute_post_processors/substring.rb +14 -4
  20. data/lib/html2rss/attribute_post_processors/template.rb +36 -12
  21. data/lib/html2rss/attribute_post_processors.rb +28 -5
  22. data/lib/html2rss/cli.rb +29 -0
  23. data/lib/html2rss/config/channel.rb +117 -0
  24. data/lib/html2rss/config/selectors.rb +91 -0
  25. data/lib/html2rss/config.rb +71 -82
  26. data/lib/html2rss/item.rb +118 -42
  27. data/lib/html2rss/item_extractors/attribute.rb +20 -7
  28. data/lib/html2rss/item_extractors/href.rb +20 -4
  29. data/lib/html2rss/item_extractors/html.rb +18 -6
  30. data/lib/html2rss/item_extractors/static.rb +18 -7
  31. data/lib/html2rss/item_extractors/text.rb +17 -5
  32. data/lib/html2rss/item_extractors.rb +75 -10
  33. data/lib/html2rss/object_to_xml_converter.rb +56 -0
  34. data/lib/html2rss/rss_builder/channel.rb +21 -0
  35. data/lib/html2rss/rss_builder/item.rb +83 -0
  36. data/lib/html2rss/rss_builder/stylesheet.rb +37 -0
  37. data/lib/html2rss/rss_builder.rb +96 -0
  38. data/lib/html2rss/utils.rb +94 -19
  39. data/lib/html2rss/version.rb +5 -1
  40. data/lib/html2rss.rb +51 -20
  41. data/rakefile.rb +16 -0
  42. metadata +51 -154
  43. data/.travis.yml +0 -25
  44. data/CHANGELOG.md +0 -221
  45. data/lib/html2rss/feed_builder.rb +0 -81
  46. data/lib/html2rss/item_extractors/current_time.rb +0 -21
  47. data/support/logo.png +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b83929fc4acc7dcb863da1dadc5909c19812bb4241e322832ad8987d1b1d23e
4
- data.tar.gz: 0e72ca51e8ce9ae69ca2fdb6d10132414c285e30fa3d21b58d4993a02ca68883
3
+ metadata.gz: 8d51b095228dec5d98a1ff66ee7329171d2297bad67ca27a7930afe296b589e8
4
+ data.tar.gz: 32bf56a05ed45a1bb8c3341f228f41d1441e65243c6a5d55908e90d002f8880b
5
5
  SHA512:
6
- metadata.gz: 5060f03d6fb087f5e22cdced84e4d4bda8eebfff186d1083a6926a716910b0449ff0fee998f724a5e70e5cacbce56e156972df517701182f6aa8cd0560c2fe3f
7
- data.tar.gz: d645d50ca75cc3aba7bdaf4e2f60ac9209a570f39276b131309b243b78df89092b039084dc207da6825c8191964da8678b25e520fc4d2b92f6bd09486f460c23
6
+ metadata.gz: 0cbe761521ec3cd43bd25565f6425e6ced445814c30706d50d52c008ce6e3905a6f95b9f6d9dfa2faf90baf4bc2fbeb43741af5bc185e1488d31b55b9ffa3c75
7
+ data.tar.gz: 353e1586ddde92858ea95a2eecda6d752975585038acc29e6d09ff97363e5429d15966a005e1f9c4a41e9ad83b972973cfadd9c840160849d530166e7dd84298
data/.gitignore CHANGED
@@ -9,4 +9,4 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
- coverage
12
+ docs/
data/.mergify.yml ADDED
@@ -0,0 +1,15 @@
1
+ queue_rules:
2
+ - name: dependabot
3
+ conditions:
4
+ - author=dependabot[bot]
5
+ - status-success=test
6
+ - base=master
7
+
8
+ pull_request_rules:
9
+ - name: automatic merge for Dependabot pull requests
10
+ conditions:
11
+ - author=dependabot[bot]
12
+ actions:
13
+ queue:
14
+ method: squash
15
+ name: dependabot
data/.rubocop.yml CHANGED
@@ -1,164 +1,30 @@
1
1
  require:
2
2
  - rubocop-performance
3
3
  - rubocop-rspec
4
+ - rubocop-md
5
+ - rubocop-rake
4
6
 
5
7
  AllCops:
6
- TargetRubyVersion: 2.5
7
8
  DisplayCopNames: true
9
+ NewCops: enable
10
+ Exclude:
11
+ - vendor/**/*
8
12
 
9
13
  Metrics/BlockLength:
10
14
  Exclude:
11
- - "**/*_spec.rb"
15
+ - "spec/**/*_spec.rb"
12
16
  - html2rss.gemspec
13
17
 
14
- Metrics/ModuleLength:
15
- Exclude:
16
- - "**/*_spec.rb"
17
-
18
- Layout/ClassStructure:
19
- Enabled: true
20
-
21
- Layout/HeredocArgumentClosingParenthesis:
22
- Enabled: true
23
-
24
- Layout/LineLength:
25
- Max: 110
26
-
27
- Layout/MultilineArrayLineBreaks:
28
- Enabled: true
29
-
30
- Layout/MultilineHashKeyLineBreaks:
31
- Enabled: true
32
-
33
- Layout/SpaceInsideParens:
34
- Enabled: true
35
-
36
- Layout/EmptyLinesAroundAttributeAccessor:
37
- Enabled: true
38
-
39
- Layout/SpaceAroundMethodCallOperator:
40
- Enabled: true
41
-
42
- Lint/HeredocMethodCallPosition:
43
- Enabled: true
44
-
45
- Lint/NumberConversion:
46
- Enabled: false
47
-
48
- Lint/DeprecatedOpenSSLConstant:
49
- Enabled: true
50
-
51
- Lint/MixedRegexpCaptureTypes:
52
- Enabled: true
53
-
54
- Lint/RaiseException:
55
- Enabled: true
56
-
57
- Lint/StructNewOverride:
58
- Enabled: true
59
-
60
-
61
- Performance/CaseWhenSplat:
62
- Enabled: true
63
-
64
- Performance/ChainArrayAllocation:
65
- Enabled: true
66
-
67
- Performance/OpenStruct:
68
- Enabled: true
69
-
70
-
71
18
  RSpec/NestedGroups:
72
19
  Exclude:
73
20
  - spec/html2rss_spec.rb
74
21
 
75
-
76
- Style/AsciiComments:
77
- Enabled: false
78
-
79
- Style/AutoResourceCleanup:
80
- Enabled: true
81
-
82
- Style/BlockDelimiters:
83
- Enabled: true
22
+ RSpec/DescribeClass:
84
23
  Exclude:
85
- - '**/*_spec.rb'
86
-
87
- Style/HashEachMethods:
88
- Enabled: true
24
+ - spec/exe/**/*_spec.rb
89
25
 
90
- Style/HashTransformKeys:
91
- Enabled: true
92
-
93
- Style/HashTransformValues:
94
- Enabled: true
95
-
96
- Style/CollectionMethods:
97
- Enabled: true
98
-
99
- Style/ConstantVisibility:
100
- Enabled: true
101
-
102
- Style/DateTime:
103
- Enabled: true
104
-
105
- Style/Documentation:
106
- Exclude:
107
- - lib/html2rss/version.rb
108
-
109
- Style/DocumentationMethod:
26
+ RSpec/NamedSubject:
110
27
  Enabled: false
111
28
 
112
- Style/FormatStringToken:
113
- Enabled: false
114
-
115
- Style/FrozenStringLiteralComment:
116
- Enabled: false
117
-
118
- Style/HashSyntax:
119
- Enabled: true
120
-
121
- Style/InlineComment:
122
- Enabled: true
123
-
124
- Style/IpAddresses:
125
- Enabled: true
126
-
127
- Style/MethodCallWithArgsParentheses:
128
- Enabled: false
129
-
130
- Style/MethodCalledOnDoEndBlock:
131
- Enabled: true
132
-
133
- Style/MissingElse:
134
- Enabled: true
135
-
136
- Style/MultilineMethodSignature:
137
- Enabled: true
138
-
139
- Style/OptionHash:
140
- Enabled: true
141
-
142
- Style/ReturnNil:
143
- Enabled: true
144
-
145
- Style/SingleLineBlockParams:
146
- Enabled: true
147
-
148
- Style/StderrPuts:
149
- Enabled: true
150
-
151
- Style/StringMethods:
152
- Enabled: true
153
-
154
- Style/ExponentialNotation:
155
- Enabled: true
156
-
157
- Style/RedundantRegexpCharacterClass:
158
- Enabled: true
159
-
160
- Style/RedundantRegexpEscape:
161
- Enabled: true
162
-
163
- Style/SlicingWithRange:
164
- Enabled: true
29
+ Naming/RescuedExceptionsVariableName:
30
+ PreferredName: error
data/Gemfile CHANGED
@@ -1,8 +1,25 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
6
 
5
- gem 'coveralls', require: false
6
-
7
7
  # Specify your gem's dependencies in html2rss.gemspec
8
8
  gemspec
9
+
10
+ group :development, :test do
11
+ gem 'byebug'
12
+ gem 'rake'
13
+ gem 'rspec', '~> 3.0'
14
+ gem 'rubocop'
15
+ gem 'rubocop-md'
16
+ gem 'rubocop-performance'
17
+ gem 'rubocop-rake'
18
+ gem 'rubocop-rspec'
19
+ gem 'vcr'
20
+ gem 'yard'
21
+ end
22
+
23
+ group :test do
24
+ gem 'simplecov', require: false
25
+ end
data/Gemfile.lock CHANGED
@@ -1,139 +1,153 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- html2rss (0.9.0)
5
- activesupport (>= 5, < 7)
4
+ html2rss (0.10.0)
6
5
  addressable (~> 2.7)
7
- builder
8
- faraday (~> 1.0)
9
- faraday_middleware
6
+ faraday (> 2.0.1, < 3.0)
7
+ faraday-follow_redirects
10
8
  kramdown
11
9
  mime-types (> 3.0)
12
10
  nokogiri (>= 1.10, < 2.0)
11
+ regexp_parser
13
12
  reverse_markdown (~> 2.0)
14
- sanitize (~> 5.0)
15
- to_regexp
13
+ rss
14
+ sanitize (~> 6.0)
15
+ thor
16
+ tzinfo
16
17
  zeitwerk
17
18
 
18
19
  GEM
19
20
  remote: https://rubygems.org/
20
21
  specs:
21
- activesupport (6.0.3.2)
22
- concurrent-ruby (~> 1.0, >= 1.0.2)
23
- i18n (>= 0.7, < 2)
24
- minitest (~> 5.1)
25
- tzinfo (~> 1.1)
26
- zeitwerk (~> 2.2, >= 2.2.2)
27
- addressable (2.7.0)
28
- public_suffix (>= 2.0.2, < 5.0)
29
- ast (2.4.1)
30
- builder (3.2.4)
22
+ addressable (2.8.6)
23
+ public_suffix (>= 2.0.2, < 6.0)
24
+ ast (2.4.2)
31
25
  byebug (11.1.3)
32
- concurrent-ruby (1.1.6)
33
- coveralls (0.7.2)
34
- multi_json (~> 1.3)
35
- rest-client (= 1.6.7)
36
- simplecov (>= 0.7)
37
- term-ansicolor (= 1.2.2)
38
- thor (= 0.18.1)
26
+ concurrent-ruby (1.2.3)
39
27
  crass (1.0.6)
40
- diff-lcs (1.3)
41
- docile (1.3.2)
42
- faraday (1.0.1)
43
- multipart-post (>= 1.2, < 3)
44
- faraday_middleware (1.0.0)
45
- faraday (~> 1.0)
46
- i18n (1.8.3)
47
- concurrent-ruby (~> 1.0)
48
- kramdown (2.2.1)
28
+ diff-lcs (1.5.1)
29
+ docile (1.4.0)
30
+ faraday (2.9.0)
31
+ faraday-net_http (>= 2.0, < 3.2)
32
+ faraday-follow_redirects (0.3.0)
33
+ faraday (>= 1, < 3)
34
+ faraday-net_http (3.1.0)
35
+ net-http
36
+ json (2.7.2)
37
+ kramdown (2.4.0)
49
38
  rexml
50
- mime-types (3.3.1)
39
+ language_server-protocol (3.17.0.3)
40
+ mime-types (3.5.2)
51
41
  mime-types-data (~> 3.2015)
52
- mime-types-data (3.2020.0512)
53
- mini_portile2 (2.4.0)
54
- minitest (5.14.1)
55
- multi_json (1.14.1)
56
- multipart-post (2.1.1)
57
- nokogiri (1.10.9)
58
- mini_portile2 (~> 2.4.0)
59
- nokogumbo (2.0.2)
60
- nokogiri (~> 1.8, >= 1.8.4)
61
- parallel (1.19.2)
62
- parser (2.7.1.3)
63
- ast (~> 2.4.0)
64
- public_suffix (4.0.5)
65
- rainbow (3.0.0)
66
- regexp_parser (1.7.1)
67
- rest-client (1.6.7)
68
- mime-types (>= 1.16)
69
- reverse_markdown (2.0.0)
42
+ mime-types-data (3.2024.0305)
43
+ mini_portile2 (2.8.6)
44
+ net-http (0.4.1)
45
+ uri
46
+ nokogiri (1.16.5)
47
+ mini_portile2 (~> 2.8.2)
48
+ racc (~> 1.4)
49
+ nokogiri (1.16.5-x86_64-darwin)
50
+ racc (~> 1.4)
51
+ nokogiri (1.16.5-x86_64-linux)
52
+ racc (~> 1.4)
53
+ parallel (1.24.0)
54
+ parser (3.3.1.0)
55
+ ast (~> 2.4.1)
56
+ racc
57
+ public_suffix (5.0.5)
58
+ racc (1.7.3)
59
+ rainbow (3.1.1)
60
+ rake (13.2.1)
61
+ regexp_parser (2.9.0)
62
+ reverse_markdown (2.1.1)
70
63
  nokogiri
71
- rexml (3.2.4)
72
- rspec (3.9.0)
73
- rspec-core (~> 3.9.0)
74
- rspec-expectations (~> 3.9.0)
75
- rspec-mocks (~> 3.9.0)
76
- rspec-core (3.9.2)
77
- rspec-support (~> 3.9.3)
78
- rspec-expectations (3.9.2)
64
+ rexml (3.3.2)
65
+ strscan
66
+ rspec (3.13.0)
67
+ rspec-core (~> 3.13.0)
68
+ rspec-expectations (~> 3.13.0)
69
+ rspec-mocks (~> 3.13.0)
70
+ rspec-core (3.13.0)
71
+ rspec-support (~> 3.13.0)
72
+ rspec-expectations (3.13.0)
79
73
  diff-lcs (>= 1.2.0, < 2.0)
80
- rspec-support (~> 3.9.0)
81
- rspec-mocks (3.9.1)
74
+ rspec-support (~> 3.13.0)
75
+ rspec-mocks (3.13.0)
82
76
  diff-lcs (>= 1.2.0, < 2.0)
83
- rspec-support (~> 3.9.0)
84
- rspec-support (3.9.3)
85
- rubocop (0.85.1)
77
+ rspec-support (~> 3.13.0)
78
+ rspec-support (3.13.1)
79
+ rss (0.3.0)
80
+ rexml
81
+ rubocop (1.63.4)
82
+ json (~> 2.3)
83
+ language_server-protocol (>= 3.17.0)
86
84
  parallel (~> 1.10)
87
- parser (>= 2.7.0.1)
85
+ parser (>= 3.3.0.2)
88
86
  rainbow (>= 2.2.2, < 4.0)
89
- regexp_parser (>= 1.7)
90
- rexml
91
- rubocop-ast (>= 0.0.3)
87
+ regexp_parser (>= 1.8, < 3.0)
88
+ rexml (>= 3.2.5, < 4.0)
89
+ rubocop-ast (>= 1.31.1, < 2.0)
92
90
  ruby-progressbar (~> 1.7)
93
- unicode-display_width (>= 1.4.0, < 2.0)
94
- rubocop-ast (0.0.3)
95
- parser (>= 2.7.0.1)
96
- rubocop-performance (1.6.1)
97
- rubocop (>= 0.71.0)
98
- rubocop-rspec (1.40.0)
99
- rubocop (>= 0.68.1)
100
- ruby-progressbar (1.10.1)
101
- sanitize (5.2.1)
91
+ unicode-display_width (>= 2.4.0, < 3.0)
92
+ rubocop-ast (1.31.3)
93
+ parser (>= 3.3.1.0)
94
+ rubocop-capybara (2.20.0)
95
+ rubocop (~> 1.41)
96
+ rubocop-factory_bot (2.25.1)
97
+ rubocop (~> 1.41)
98
+ rubocop-md (1.2.2)
99
+ rubocop (>= 1.0)
100
+ rubocop-performance (1.21.0)
101
+ rubocop (>= 1.48.1, < 2.0)
102
+ rubocop-ast (>= 1.31.1, < 2.0)
103
+ rubocop-rake (0.6.0)
104
+ rubocop (~> 1.0)
105
+ rubocop-rspec (2.29.1)
106
+ rubocop (~> 1.40)
107
+ rubocop-capybara (~> 2.17)
108
+ rubocop-factory_bot (~> 2.22)
109
+ rubocop-rspec_rails (~> 2.28)
110
+ rubocop-rspec_rails (2.28.3)
111
+ rubocop (~> 1.40)
112
+ ruby-progressbar (1.13.0)
113
+ sanitize (6.1.0)
102
114
  crass (~> 1.0.2)
103
- nokogiri (>= 1.8.0)
104
- nokogumbo (~> 2.0)
105
- simplecov (0.18.5)
115
+ nokogiri (>= 1.12.0)
116
+ simplecov (0.22.0)
106
117
  docile (~> 1.1)
107
118
  simplecov-html (~> 0.11)
108
- simplecov-html (0.12.2)
109
- term-ansicolor (1.2.2)
110
- tins (~> 0.8)
111
- thor (0.18.1)
112
- thread_safe (0.3.6)
113
- tins (0.13.2)
114
- to_regexp (0.2.1)
115
- tzinfo (1.2.7)
116
- thread_safe (~> 0.1)
117
- unicode-display_width (1.7.0)
118
- vcr (6.0.0)
119
- yard (0.9.25)
120
- zeitwerk (2.3.0)
119
+ simplecov_json_formatter (~> 0.1)
120
+ simplecov-html (0.12.3)
121
+ simplecov_json_formatter (0.1.4)
122
+ strscan (3.1.0)
123
+ thor (1.3.1)
124
+ tzinfo (2.0.6)
125
+ concurrent-ruby (~> 1.0)
126
+ unicode-display_width (2.5.0)
127
+ uri (0.13.0)
128
+ vcr (6.2.0)
129
+ yard (0.9.36)
130
+ zeitwerk (2.6.13)
121
131
 
122
132
  PLATFORMS
123
133
  ruby
134
+ x86_64-darwin
135
+ x86_64-darwin-20
136
+ x86_64-linux
124
137
 
125
138
  DEPENDENCIES
126
- bundler
127
139
  byebug
128
- coveralls
129
140
  html2rss!
141
+ rake
130
142
  rspec (~> 3.0)
131
143
  rubocop
144
+ rubocop-md
132
145
  rubocop-performance
146
+ rubocop-rake
133
147
  rubocop-rspec
134
148
  simplecov
135
149
  vcr
136
150
  yard
137
151
 
138
152
  BUNDLED WITH
139
- 2.1.4
153
+ 2.4.1