Skip to content

Commit

Permalink
Merge pull request #752 from pooza/3_3_11
Browse files Browse the repository at this point in the history
3.3.11
  • Loading branch information
pooza authored Jan 15, 2022
2 parents abd7af6 + 9aea0aa commit 4a8205f
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.3
ruby-version: 3.1.0
- name: apt install
run: |
sudo apt update
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AllCops:
- 'config/**/*'
- 'tmp/**/*'
- '**/old/**/*'
TargetRubyVersion: 3.0
TargetRubyVersion: 3.1

Naming/RescuedExceptionsVariableName:
PreferredName: e
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.3
3.1.0
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
source 'https://rubygems.org'
ruby '~>3.0.0'
ruby '~>3.1.0'
gem 'bootsnap', '>=1.9.0'
gem 'faye-websocket'
gem 'feedjira', '~>3.0'
gem 'fileutils', '1.5.0'
gem 'ginseng-core', github: 'pooza/ginseng-core', require: 'ginseng'
gem 'ginseng-fediverse', github: 'pooza/ginseng-fediverse', require: 'ginseng/fediverse'
gem 'rufus-scheduler'
Expand Down
61 changes: 33 additions & 28 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: e0cc9eca30bc1de7d9488e8edeeab3a0d57cf154
revision: 35b1af5ab03a6511387e1a78c09962c5aa68f895
specs:
ginseng-core (1.11.15)
ginseng-core (1.11.17)
activesupport (>= 6.1.3.2)
addressable (>= 2.8.0)
bundler (~> 2.0)
Expand All @@ -12,13 +12,14 @@ GIT
erb
etc
facets
fileutils (>= 1.5.0)
fileutils (~> 1.6.0)
find
httparty
json-schema
mail
multi_json
net-protocol
net-smtp
nokogiri (>= 1.12.5)
optparse
rake
Expand All @@ -33,28 +34,29 @@ GIT

GIT
remote: https://github.com/pooza/ginseng-fediverse.git
revision: 776260d71e3feb29207097e81cbbd7db5750d6b6
revision: 7c15ad66e553071ffc3519d4cf4da283d7937ed1
specs:
ginseng-fediverse (1.6.4)
ginseng-fediverse (1.6.5)

GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.0)
activesupport (7.0.1)
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.3)
bootsnap (1.9.4)
msgpack (~> 1.0)
cgi (0.3.1)
concurrent-ruby (1.1.9)
crass (1.0.6)
daemon-spawn (0.4.2)
date (3.2.2)
digest (3.1.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
erb (2.2.3)
Expand All @@ -67,10 +69,10 @@ GEM
faye-websocket (0.11.1)
eventmachine (>= 0.12.0)
websocket-driver (>= 0.5.1)
feedjira (3.2.0)
feedjira (3.2.1)
loofah (>= 2.3.1)
sax-machine (>= 1.0)
fileutils (1.5.0)
fileutils (1.6.0)
find (0.1.1)
fugit (1.5.2)
et-orbi (~> 1.1, >= 1.1.8)
Expand All @@ -93,31 +95,35 @@ GEM
mini_mime (>= 0.1.1)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.1115)
mime-types-data (3.2022.0105)
mini_mime (1.1.2)
mini_portile2 (2.6.1)
mini_portile2 (2.7.1)
minitest (5.15.0)
msgpack (1.4.2)
multi_json (1.15.0)
multi_xml (0.6.0)
net-protocol (0.1.2)
io-wait
timeout
net-smtp (0.3.1)
digest
net-protocol
timeout
netrc (0.11.0)
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
nokogiri (1.13.1)
mini_portile2 (~> 2.7.0)
racc (~> 1.4)
nokogiri (1.12.5-x86_64-linux)
nokogiri (1.13.1-x86_64-linux)
racc (~> 1.4)
optparse (0.2.0)
parallel (1.21.0)
parser (3.0.3.2)
parser (3.1.0.0)
ast (~> 2.4.1)
power_assert (2.0.1)
public_suffix (4.0.6)
raabro (1.4.0)
racc (1.6.0)
rainbow (3.0.0)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.2.0)
rest-client (2.1.0)
Expand All @@ -126,37 +132,37 @@ GEM
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.5)
ricecream (0.2.0)
rubocop (1.23.0)
ricecream (0.2.1)
rubocop (1.24.1)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.12.0, < 2.0)
rubocop-ast (>= 1.15.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.15.0)
rubocop-ast (1.15.1)
parser (>= 3.0.1.1)
rubocop-performance (1.12.0)
rubocop-performance (1.13.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-sequel (0.3.3)
rubocop (~> 1.0)
ruby-progressbar (1.11.0)
rufus-scheduler (3.8.0)
rufus-scheduler (3.8.1)
fugit (~> 1.1, >= 1.1.6)
sanitize (6.0.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
sax-machine (1.3.2)
securerandom (0.1.1)
sequel (5.51.0)
sequel (5.52.0)
set (1.0.2)
sqlite3 (1.4.2)
test-unit (3.5.2)
test-unit (3.5.3)
power_assert
time (0.2.0)
date
Expand All @@ -171,7 +177,7 @@ GEM
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
yajl-ruby (1.4.1)
zeitwerk (2.5.1)
zeitwerk (2.5.3)
zlib (2.1.1)

PLATFORMS
Expand All @@ -184,7 +190,6 @@ DEPENDENCIES
bootsnap (>= 1.9.0)
faye-websocket
feedjira (~> 3.0)
fileutils (= 1.5.0)
ginseng-core!
ginseng-fediverse!
ricecream
Expand All @@ -198,7 +203,7 @@ DEPENDENCIES
test-unit

RUBY VERSION
ruby 3.0.3p157
ruby 3.1.0p0

BUNDLED WITH
2.2.33
2.3.5
10 changes: 3 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
dir = File.expand_path(__dir__)
$LOAD_PATH.unshift(File.join(dir, 'app/lib'))
ENV['BUNDLE_GEMFILE'] = File.join(dir, 'Gemfile')
$LOAD_PATH.unshift(File.join(File.expand_path(__dir__), 'app/lib'))
ENV['RAKE'] = 'yes'

require 'tomato_shrieker'
module TomatoShrieker
ENV['RAKE'] = Package.full_name
load_tasks
end
TomatoShrieker.load_tasks
3 changes: 3 additions & 0 deletions app/lib/tomato_shrieker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ def self.load_tasks
finder.exec.each {|f| require f}
end

Dir.chdir(dir)
ENV['BUNDLE_GEMFILE'] = File.join(dir, 'Gemfile')
Bundler.require
loader.setup
setup_bootsnap
setup_debug
ENV['RACK_ENV'] ||= Environment.type
Sequel.connect(Environment.dsn)
end
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 @@ -90,7 +90,7 @@ def self.create(entry, feed = nil)
rescue Sequel::UniqueConstraintViolation
return nil
rescue => e
logger.error(source: feed&.id, error: e, entry: entry)
logger.error(source: feed&.id, error: e, entry:)
return nil
end

Expand All @@ -99,7 +99,7 @@ def self.create_title(title, published, feed)
dest ||= "#{published.getlocal.strftime('%Y/%m/%d %H:%M')} #{title.sanitize}"
return dest
rescue => e
logger.error(source: feed&.id, error: e, title: title)
logger.error(source: feed&.id, error: e, title:)
return title
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/lib/tomato_shrieker/model/news_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def self.create(entry, feed = nil)
rescue Sequel::UniqueConstraintViolation
return nil
rescue => e
logger.error(source: feed&.id, error: e, entry: entry)
logger.error(source: feed&.id, error: e, entry:)
return nil
end

Expand Down
2 changes: 1 addition & 1 deletion app/lib/tomato_shrieker/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def line
unless @line
return nil unless user_id = self['/dest/line/user_id']
return nil unless token = self['/dest/line/token']
@line = LineShrieker.new(id: user_id, token: token)
@line = LineShrieker.new(id: user_id, token:)
end
return @line
rescue => e
Expand Down
2 changes: 1 addition & 1 deletion app/lib/tomato_shrieker/source/command_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def exec
command.stdout.split(delimiter).select(&:present?).each do |status|
template = create_template
template[:status] = status
shriek(template: template, visibility: visibility)
shriek(template:, visibility:)
end
rescue => e
e.package = Package.full_name
Expand Down
4 changes: 2 additions & 2 deletions app/lib/tomato_shrieker/source/feed_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(params)

def exec
if multi_entries?
shriek(template: create_template(:multi), visibility: visibility)
shriek(template: create_template(:multi), visibility:)
elsif touched?
fetch(&:shriek)
elsif entry = fetch.to_a.last
Expand Down Expand Up @@ -180,7 +180,7 @@ def create_uri(href)
end

def summary
values = {id: id, category: category, multi: multi_entries?}
values = {id:, category:, multi: multi_entries?}
values[:entries] = entries.map do |entry|
{
date: entry.published.strftime('%Y/%m/%d %R'),
Expand Down
2 changes: 1 addition & 1 deletion app/lib/tomato_shrieker/source/text_source.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module TomatoShrieker
class TextSource < Source
def exec
shriek(template: create_template, visibility: visibility)
shriek(template: create_template, visibility:)
rescue => e
e.package = Package.full_name
SlackService.broadcast(e)
Expand Down
5 changes: 1 addition & 4 deletions bin/crypt.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/usr/bin/env ruby
dir = File.expand_path('..', __dir__)
$LOAD_PATH.unshift(File.join(dir, 'app/lib'))
ENV['BUNDLE_GEMFILE'] = File.join(dir, 'Gemfile')
$LOAD_PATH.unshift(File.join(File.expand_path('..', __dir__), 'app/lib'))

Dir.chdir(dir)
require 'tomato_shrieker'
module TomatoShrieker
warn Package.full_name
Expand Down
5 changes: 1 addition & 4 deletions bin/decrypt.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/usr/bin/env ruby
dir = File.expand_path('..', __dir__)
$LOAD_PATH.unshift(File.join(dir, 'app/lib'))
ENV['BUNDLE_GEMFILE'] = File.join(dir, 'Gemfile')
$LOAD_PATH.unshift(File.join(File.expand_path('..', __dir__), 'app/lib'))

Dir.chdir(dir)
require 'tomato_shrieker'
module TomatoShrieker
warn Package.full_name
Expand Down
5 changes: 1 addition & 4 deletions bin/scheduler_daemon.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env ruby

dir = File.expand_path('..', __dir__)
$LOAD_PATH.unshift(File.join(dir, 'app/lib'))
ENV['BUNDLE_GEMFILE'] = File.join(dir, 'Gemfile')
$LOAD_PATH.unshift(File.join(File.expand_path('..', __dir__), 'app/lib'))
ENV['RAKE'] = nil

Dir.chdir(dir)
require 'tomato_shrieker'
TomatoShrieker::SchedulerDaemon.spawn!
5 changes: 1 addition & 4 deletions bin/scheduler_worker.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env ruby

dir = File.expand_path('..', __dir__)
$LOAD_PATH.unshift(File.join(dir, 'app/lib'))
ENV['BUNDLE_GEMFILE'] = File.join(dir, 'Gemfile')
$LOAD_PATH.unshift(File.join(File.expand_path('..', __dir__), 'app/lib'))
ENV['RAKE'] = nil

Dir.chdir(dir)
require 'tomato_shrieker'
TomatoShrieker::Scheduler.instance.exec
5 changes: 1 addition & 4 deletions bin/test.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/usr/bin/env ruby
dir = File.expand_path('..', __dir__)
$LOAD_PATH.unshift(File.join(dir, 'app/lib'))
ENV['BUNDLE_GEMFILE'] = File.join(dir, 'Gemfile')
$LOAD_PATH.unshift(File.join(File.expand_path('..', __dir__), 'app/lib'))

Dir.chdir(dir)
require 'tomato_shrieker'
module TomatoShrieker
warn Package.full_name
Expand Down
2 changes: 1 addition & 1 deletion config/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ package:
- tkoishi@b-shock.co.jp
license: MIT
url: https://github.com/pooza/tomato-shrieker
version: 3.3.10
version: 3.3.11
slack:
hooks: []
sources: []
Expand Down

0 comments on commit 4a8205f

Please sign in to comment.