pluto-models 1.6.2 → 1.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +1 -0
- data/Rakefile +1 -1
- data/lib/pluto/connecter.rb +19 -19
- data/lib/pluto/models/feed.rb +7 -7
- data/lib/pluto/version.rb +1 -1
- data/test/test_delete_removed.rb +1 -1
- data/test/test_filter.rb +1 -1
- data/test/test_helpers.rb +1 -1
- data/test/test_regex.rb +1 -1
- data/test/test_site.rb +1 -1
- metadata +16 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d39c25f14faa811583ec87874ba2a2ce3921b3fd6789eec7f7063d69a7d92d4f
|
4
|
+
data.tar.gz: c7978160efe47ae1b13a91341c06a64af29206dfeae99bd06a1a21f4824d221b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05ed18f554f2f1936a2b5515cd6c821f6bbe64cc6e4df9eec9c47462719453508be1e4bd1fb7977c1f512a361e7129d25b52a3255eb00719020b4fcfdb95a3be
|
7
|
+
data.tar.gz: 10071e0a4e38f6d056ec8743c12007271948e2cc7718471c7d41f04ba4306571c2c6889338d9a69ed4af56476d8cd78d05452df04d262a23322c0c7e20c9efeb
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ Hoe.spec 'pluto-models' do
|
|
8
8
|
self.summary = "pluto-models - planet schema 'n' models for easy (re)use"
|
9
9
|
self.description = summary
|
10
10
|
|
11
|
-
self.urls =
|
11
|
+
self.urls = { 'home': 'https://github.com/feedreader/pluto' }
|
12
12
|
|
13
13
|
self.author = 'Gerald Bauer'
|
14
14
|
self.email = 'wwwmake@googlegroups.com'
|
data/lib/pluto/connecter.rb
CHANGED
@@ -9,7 +9,7 @@ module Pluto
|
|
9
9
|
class Connecter
|
10
10
|
|
11
11
|
include LogUtils::Logging
|
12
|
-
|
12
|
+
|
13
13
|
|
14
14
|
|
15
15
|
def initialize
|
@@ -49,31 +49,31 @@ class Connecter
|
|
49
49
|
logger.info 'db settings:'
|
50
50
|
logger.info config.pretty_inspect
|
51
51
|
|
52
|
+
##
|
52
53
|
### for dbbrowser and other tools add to ActiveRecord
|
54
|
+
## todo/fix - find out how to add db config with code
|
55
|
+
## in ActiveRecord 6+ !!!!
|
56
|
+
## for now (old) registration removed / commented out
|
57
|
+
##
|
58
|
+
## if ActiveRecord::Base.configurations.nil? # todo/check: can this ever happen? remove?
|
59
|
+
## logger.debug "ActiveRecord configurations nil - set to empty hash"
|
60
|
+
## ActiveRecord::Base.configurations = {} # make it an empty hash
|
61
|
+
## end
|
53
62
|
|
54
|
-
if ActiveRecord::Base.configurations.nil? # todo/check: can this ever happen? remove?
|
55
|
-
logger.debug "ActiveRecord configurations nil - set to empty hash"
|
56
|
-
ActiveRecord::Base.configurations = {} # make it an empty hash
|
57
|
-
end
|
58
63
|
|
59
64
|
## todo/fix: remove debug? option - why? why not?
|
60
65
|
## (just) use logger level eg. logger.debug
|
61
|
-
if debug?
|
62
|
-
|
63
|
-
|
64
|
-
end
|
66
|
+
# if debug?
|
67
|
+
# logger.debug 'ar configurations (before):'
|
68
|
+
# logger.debug ActiveRecord::Base.configurations.pretty_inspect
|
69
|
+
# end
|
65
70
|
|
66
|
-
|
67
|
-
configs = ActiveRecord::Base.configurations.to_h.reject { |db_config| db_config.env_name == 'pluto' }
|
68
|
-
configs['pluto'] = config
|
69
|
-
|
70
|
-
ActiveRecord::Base.configurations = configs
|
71
|
-
|
72
|
-
if debug?
|
73
|
-
logger.debug 'ar configurations (after):'
|
74
|
-
logger.debug ActiveRecord::Base.configurations.pretty_inspect
|
75
|
-
end
|
71
|
+
## ActiveRecord::Base.configurations[ 'pluto' ] = config
|
76
72
|
|
73
|
+
# if debug?
|
74
|
+
# logger.debug 'ar configurations (after):'
|
75
|
+
# logger.debug ActiveRecord::Base.configurations.pretty_inspect
|
76
|
+
# end
|
77
77
|
|
78
78
|
# for debugging - disable for production use
|
79
79
|
if debug?
|
data/lib/pluto/models/feed.rb
CHANGED
@@ -134,8 +134,8 @@ class Feed < ActiveRecord::Base
|
|
134
134
|
#####
|
135
135
|
## apply some fix-up for "broken" feed data
|
136
136
|
fix_dates( data )
|
137
|
-
|
138
|
-
|
137
|
+
|
138
|
+
|
139
139
|
######
|
140
140
|
## check for filters (includes/excludes) if present
|
141
141
|
## for now just check for includes
|
@@ -222,14 +222,14 @@ class Feed < ActiveRecord::Base
|
|
222
222
|
-
|
223
223
|
(?<month>[0-9]{2})
|
224
224
|
-
|
225
|
-
(?<day>[0-9]{2})
|
225
|
+
(?<day>[0-9]{2})
|
226
226
|
\b}x
|
227
227
|
|
228
228
|
###################################################
|
229
|
-
# helpers to fix-up some "broken" feed data
|
229
|
+
# helpers to fix-up some "broken" feed data
|
230
230
|
def fix_dates( data )
|
231
231
|
|
232
|
-
## check for missing / no dates
|
232
|
+
## check for missing / no dates
|
233
233
|
## examples
|
234
234
|
## - rubytogether feed @ https://rubytogether.org/news.xml
|
235
235
|
data.items.each do |item|
|
@@ -248,7 +248,7 @@ class Feed < ActiveRecord::Base
|
|
248
248
|
end
|
249
249
|
end
|
250
250
|
|
251
|
-
|
251
|
+
|
252
252
|
## check if all updated dates are the same (uniq count is 1)
|
253
253
|
## AND if all published dates are present
|
254
254
|
## than assume "fake" updated dates and nullify updated dates
|
@@ -259,7 +259,7 @@ class Feed < ActiveRecord::Base
|
|
259
259
|
## todo/check - limit to atom feed format only - why? why not?
|
260
260
|
|
261
261
|
count = data.items.size
|
262
|
-
count_published = data.items.reduce( 0 ) {|
|
262
|
+
count_published = data.items.reduce( 0 ) {|sum,item| sum += 1 if item.published; sum }
|
263
263
|
|
264
264
|
if count == count_published
|
265
265
|
uniq_count_updated = 0
|
data/lib/pluto/version.rb
CHANGED
data/test/test_delete_removed.rb
CHANGED
data/test/test_filter.rb
CHANGED
data/test/test_helpers.rb
CHANGED
data/test/test_regex.rb
CHANGED
data/test/test_site.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pluto-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: props
|
@@ -168,30 +168,36 @@ dependencies:
|
|
168
168
|
name: rdoc
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - "
|
171
|
+
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '4.0'
|
174
|
+
- - "<"
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '7'
|
174
177
|
type: :development
|
175
178
|
prerelease: false
|
176
179
|
version_requirements: !ruby/object:Gem::Requirement
|
177
180
|
requirements:
|
178
|
-
- - "
|
181
|
+
- - ">="
|
179
182
|
- !ruby/object:Gem::Version
|
180
183
|
version: '4.0'
|
184
|
+
- - "<"
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '7'
|
181
187
|
- !ruby/object:Gem::Dependency
|
182
188
|
name: hoe
|
183
189
|
requirement: !ruby/object:Gem::Requirement
|
184
190
|
requirements:
|
185
191
|
- - "~>"
|
186
192
|
- !ruby/object:Gem::Version
|
187
|
-
version: '
|
193
|
+
version: '4.1'
|
188
194
|
type: :development
|
189
195
|
prerelease: false
|
190
196
|
version_requirements: !ruby/object:Gem::Requirement
|
191
197
|
requirements:
|
192
198
|
- - "~>"
|
193
199
|
- !ruby/object:Gem::Version
|
194
|
-
version: '
|
200
|
+
version: '4.1'
|
195
201
|
description: pluto-models - planet schema 'n' models for easy (re)use
|
196
202
|
email: wwwmake@googlegroups.com
|
197
203
|
executables: []
|
@@ -226,7 +232,7 @@ homepage: https://github.com/feedreader/pluto
|
|
226
232
|
licenses:
|
227
233
|
- Public Domain
|
228
234
|
metadata: {}
|
229
|
-
post_install_message:
|
235
|
+
post_install_message:
|
230
236
|
rdoc_options:
|
231
237
|
- "--main"
|
232
238
|
- README.md
|
@@ -243,9 +249,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
243
249
|
- !ruby/object:Gem::Version
|
244
250
|
version: '0'
|
245
251
|
requirements: []
|
246
|
-
|
247
|
-
|
248
|
-
signing_key:
|
252
|
+
rubygems_version: 3.4.10
|
253
|
+
signing_key:
|
249
254
|
specification_version: 4
|
250
255
|
summary: pluto-models - planet schema 'n' models for easy (re)use
|
251
256
|
test_files: []
|