Skip to content

Commit

Permalink
Merge pull request #773 from pooza/3_3_12
Browse files Browse the repository at this point in the history
3.3.12
  • Loading branch information
pooza authored Feb 13, 2022
2 parents 4a8205f + 2c89ef6 commit 2614884
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 200 deletions.
180 changes: 3 additions & 177 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@ AllCops:
Naming/RescuedExceptionsVariableName:
PreferredName: e

Naming/InclusiveLanguage:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/DoubleNegation:
Enabled: false

Style/FormatStringToken:
EnforcedStyle: template

Expand Down Expand Up @@ -85,84 +79,9 @@ Style/RescueModifier:
Style/StringLiterals:
EnforcedStyle: single_quotes

Style/HashTransformValues:
Enabled: true

Style/HashEachMethods:
Enabled: true

Style/HashTransformKeys:
Enabled: true

Style/ExponentialNotation:
Enabled: true

Style/SlicingWithRange:
Enabled: true

Style/RedundantRegexpCharacterClass:
Enabled: true

Style/RedundantRegexpEscape:
Enabled: true

Style/RedundantFetchBlock:
Enabled: true

Style/AccessorGrouping:
Enabled: true

Style/BisectedAttrAccessor:
Enabled: true

Style/RedundantAssignment:
Enabled: true

Style/ArrayCoercion:
Enabled: true

Style/CaseLikeIf:
Enabled: true

Style/HashAsLastArrayItem:
Enabled: true

Style/HashLikeCase:
Enabled: true

Style/RedundantFileExtensionInRequire:
Enabled: true

Style/ExplicitBlockArgument:
Enabled: true

Style/GlobalStdStream:
Enabled: true

Style/OptionalBooleanParameter:
Enabled: true

Style/SingleArgumentDig:
Enabled: true

Style/StringConcatenation:
Enabled: true

Style/EmptyMethod:
EnforcedStyle: expanded

Style/CombinableLoops: # (new in 0.90)
Enabled: true

Style/KeywordParametersOrder: # (new in 0.90)
Enabled: true

Style/RedundantSelfAssignment: # (new in 0.90)
Enabled: true

Style/SoleNestedConditional: # (new in 0.89)
Enabled: true

Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation

Expand Down Expand Up @@ -192,23 +111,14 @@ Layout/EmptyLineAfterGuardClause:
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented

Layout/SpaceAroundMethodCallOperator:
Enabled: true

Layout/LineLength:
Max: 100
Exclude:
- 'test/*'

Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true

Layout/EndOfLine:
EnforcedStyle: lf

Layout/LineEndStringConcatenationIndentation:
Enabled: false

Metrics/AbcSize:
Max: 30
Exclude:
Expand Down Expand Up @@ -258,103 +168,19 @@ Metrics/PerceivedComplexity:
Lint/AssignmentInCondition:
Enabled: false

Lint/UnusedBlockArgument:
Enabled: false

Lint/UnusedMethodArgument:
Enabled: false

Lint/RaiseException:
Enabled: true

Lint/StructNewOverride:
Enabled: true

Lint/DuplicateElsifCondition:
Enabled: true

Lint/DeprecatedOpenSSLConstant:
Enabled: true

Lint/BinaryOperatorWithIdenticalOperands:
Enabled: true

Lint/DuplicateRescueException:
Enabled: true

Lint/EmptyConditionalBody:
Enabled: true

Lint/FloatComparison:
Enabled: true

Lint/MissingSuper:
Enabled: true

Lint/OutOfRangeRegexpRef:
Enabled: true

Lint/SelfAssignment:
Enabled: true

Lint/TopLevelReturnWithArgument:
Enabled: true

Lint/UnreachableLoop:
Enabled: true

Lint/MixedRegexpCaptureTypes:
Enabled: true

Lint/DuplicateRequire: # (new in 0.90)
Enabled: true

Lint/EmptyFile: # (new in 0.90)
Enabled: true

Lint/TrailingCommaInAttributeDeclaration: # (new in 0.90)
Enabled: true

Lint/UselessMethodDefinition: # (new in 0.90)
Enabled: true

Performance/AncestorsInclude:
Enabled: true

Performance/BigDecimalWithNumericArgument:
Enabled: true

Performance/RedundantSortBlock:
Enabled: true

Performance/RedundantStringChars:
Enabled: true

Performance/ReverseFirst:
Enabled: true

Performance/SortReverse:
Enabled: true

Performance/Squeeze:
Enabled: true

Performance/StringInclude:
Enabled: true

Performance/Sum: # (new in 1.8)
Enabled: true

Sequel/ConcurrentIndex:
Enabled: false

Sequel:
Exclude:
- '*'
Include:
- '**/model/**/*.rb'
- 'app/migration/**/*.rb'

Sequel/ConcurrentIndex:
Enabled: false

Rake:
Exclude:
- '*'
Expand Down
34 changes: 17 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
GIT
remote: https://github.com/pooza/ginseng-core.git
revision: 35b1af5ab03a6511387e1a78c09962c5aa68f895
revision: 6837a07582945fca8e0df1ce1c06f3da3e224fee
specs:
ginseng-core (1.11.17)
ginseng-core (1.11.20)
activesupport (>= 6.1.3.2)
addressable (>= 2.8.0)
bundler (~> 2.0)
Expand Down Expand Up @@ -34,23 +34,23 @@ GIT

GIT
remote: https://github.com/pooza/ginseng-fediverse.git
revision: 7c15ad66e553071ffc3519d4cf4da283d7937ed1
revision: 876be5f2d4a71b4b763b4ea631d110a3e52d99ce
specs:
ginseng-fediverse (1.6.5)
ginseng-fediverse (1.7.7)

GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.1)
activesupport (7.0.2.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.2)
bootsnap (1.9.4)
msgpack (~> 1.0)
bootsnap (1.10.3)
msgpack (~> 1.2)
cgi (0.3.1)
concurrent-ruby (1.1.9)
crass (1.0.6)
Expand Down Expand Up @@ -83,12 +83,12 @@ GEM
httparty (0.20.0)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (1.8.11)
i18n (1.9.1)
concurrent-ruby (~> 1.0)
io-wait (0.2.1)
json-schema (2.8.1)
addressable (>= 2.4)
loofah (2.13.0)
loofah (2.14.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
Expand All @@ -99,7 +99,7 @@ GEM
mini_mime (1.1.2)
mini_portile2 (2.7.1)
minitest (5.15.0)
msgpack (1.4.2)
msgpack (1.4.4)
multi_json (1.15.0)
multi_xml (0.6.0)
net-protocol (0.1.2)
Expand All @@ -125,26 +125,26 @@ GEM
racc (1.6.0)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.2.0)
regexp_parser (2.2.1)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.5)
ricecream (0.2.1)
rubocop (1.24.1)
rubocop (1.25.1)
parallel (~> 1.10)
parser (>= 3.0.0.0)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.15.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.15.1)
rubocop-ast (1.15.2)
parser (>= 3.0.1.1)
rubocop-performance (1.13.1)
rubocop-performance (1.13.2)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rake (0.6.0)
Expand All @@ -159,7 +159,7 @@ GEM
nokogiri (>= 1.12.0)
sax-machine (1.3.2)
securerandom (0.1.1)
sequel (5.52.0)
sequel (5.53.0)
set (1.0.2)
sqlite3 (1.4.2)
test-unit (3.5.3)
Expand All @@ -177,7 +177,7 @@ GEM
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
yajl-ruby (1.4.1)
zeitwerk (2.5.3)
zeitwerk (2.5.4)
zlib (2.1.1)

PLATFORMS
Expand Down
4 changes: 2 additions & 2 deletions app/lib/tomato_shrieker/model/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ def shriek
alias post shriek

def self.create(entry, feed = nil)
values = entry.clone
values = values.to_h unless values.is_a?(Hash)
values = values.is_a?(Hash) ? entry.clone : values.to_h unless values.is_a?(Hash)
feed ||= Source.create(values['feed'])
return if feed.touched? && entry['published'] <= feed.time
id = insert(
Expand All @@ -86,6 +85,7 @@ def self.create(entry, feed = nil)
)
return Entry[id]
rescue SQLite3::BusyException
sleep(1)
retry
rescue Sequel::UniqueConstraintViolation
return nil
Expand Down
4 changes: 2 additions & 2 deletions app/lib/tomato_shrieker/model/news_entry.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
module TomatoShrieker
class NewsEntry < Entry
def self.create(entry, feed = nil)
values = entry.clone
values = values.to_h unless values.is_a?(Hash)
values = values.is_a?(Hash) ? entry.clone : values.to_h unless values.is_a?(Hash)
feed ||= Source.create(values['feed'])
return if feed.touched? && entry['published'] <= feed.time
id = insert(
Expand All @@ -14,6 +13,7 @@ def self.create(entry, feed = nil)
)
return NewsEntry[id]
rescue SQLite3::BusyException
sleep(1)
retry
rescue Sequel::UniqueConstraintViolation
return nil
Expand Down
6 changes: 5 additions & 1 deletion app/lib/tomato_shrieker/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ def cron
def period
return nil if post_at
return nil if cron
return self['/schedule/every'] || '5m'
return self['/schedule/every'] || default_period
end

def default_period
return '5m'
end

alias every period
Expand Down
Loading

0 comments on commit 2614884

Please sign in to comment.