Run rubocop on all files

This commit is contained in:
2023-06-08 21:57:54 +10:00
parent 6a2bc82e3b
commit 9d9d8ccf6d
65 changed files with 114 additions and 158 deletions

View File

@@ -2,12 +2,11 @@ module Admin
module Actions
module AutoTagging
class Create < Action
include Deps["commands.auto_tagging.create",
"views.auto_tagging.index",
"validation.contracts.auto_tagging_contract",
auto_tag: "commands.auto_tagging.tag",
new_view: "views.auto_tagging.new"]
"views.auto_tagging.index",
"validation.contracts.auto_tagging_contract",
auto_tag: "commands.auto_tagging.tag",
new_view: "views.auto_tagging.new"]
def handle(req, res)
title_contains = req.params[:title_contains]
@@ -16,16 +15,16 @@ module Admin
tag_now = req.params[:tag_now]
validation = auto_tagging_contract.call(title_contains: title_contains,
body_contains: body_contains,
tag_id: tag_id)
body_contains: body_contains,
tag_id: tag_id)
if validation.success?
result = create.(title_contains: title_contains,
body_contains: body_contains,
tag_id: tag_id)
result = create.call(title_contains: title_contains,
body_contains: body_contains,
tag_id: tag_id)
if result.success? && tag_now
auto_tag.(auto_tag_id: result.value!)
auto_tag.call(auto_tag_id: result.value!)
end
res.render index
@@ -36,4 +35,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module AutoTagging
class Delete < Action
include Deps["repos.auto_tagging_repo"]
def handle(req, res)
@@ -11,4 +10,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module AutoTagging
class Index < Action
include Deps["views.auto_tagging.index"]
def handle(req, res)
@@ -11,4 +10,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module AutoTagging
class New < Action
include Deps[new_view: "views.auto_tagging.new"]
def handle(req, res)
@@ -11,4 +10,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module Bookmarks
class Archive < Action
include Deps["repos.bookmark_repo"]
def handle(req, res)
@@ -13,4 +12,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,19 +2,18 @@ module Admin
module Actions
module Bookmarks
class Cache < Action
include Deps["commands.bookmarks.cache"]
def handle(req, res)
bookmark_id = req.params[:id]
if cache.(bookmark_id: bookmark_id).success?
res.body = "Success"
res.body = if cache.call(bookmark_id: bookmark_id).success?
"Success"
else
res.body = "Failed"
"Failed"
end
end
end
end
end
end
end

View File

@@ -4,7 +4,6 @@ module Admin
module Actions
module Bookmarks
class Clean < Action
def handle(req, res)
Que.connection = Adamantium::Container["persistence.db"]
@@ -19,4 +18,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module Bookmarks
class Delete < Action
include Deps["repos.bookmark_repo", "repos.post_tag_repo"]
def handle(req, res)
@@ -14,4 +13,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module Bookmarks
class Index < Action
include Deps["views.bookmarks.index"]
def handle(req, res)
@@ -11,4 +10,4 @@ module Admin
end
end
end
end
end

View File

@@ -1,12 +1,11 @@
module Admin
module Actions
class Index < Action
include Deps["views.index"]
def handle(req, res)
res.render index
end
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module MergeTags
class Index < Action
include Deps["views.merge_tags.index"]
def handle(req, res)
@@ -11,4 +10,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,14 +2,13 @@ module Admin
module Actions
module MergeTags
class Merge < Action
include Deps["commands.merge_tags.merge"]
def handle(req, res)
target_id = req.params[:target_id]
source_id = req.params[:source_id]
result = merge.(target_id: target_id, source_id: source_id)
result = merge.call(target_id: target_id, source_id: source_id)
if result.success?
res.redirect_to "/admin/tags/merge"
@@ -21,4 +20,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module MergeTags
class New < Action
include Deps[new_view: "views.merge_tags.new"]
def handle(req, res)
@@ -11,4 +10,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module Photos
class Index < Action
include Deps["views.photos.index"]
def handle(req, res)
@@ -11,4 +10,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module Posts
class Archive < Action
include Deps["repos.post_repo"]
def handle(req, res)
@@ -13,4 +12,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module Posts
class Delete < Action
include Deps["repos.post_repo", "repos.post_tag_repo"]
def handle(req, res)
@@ -14,4 +13,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module Posts
class Index < Action
include Deps["views.posts.index"]
def handle(req, res)
@@ -11,4 +10,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module Posts
class Publish < Action
include Deps["repos.post_repo"]
def handle(req, res)
post_id = req.params[:id]
@@ -12,4 +11,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module Tags
class Delete < Action
include Deps["repos.post_tag_repo", "repos.tag_repo"]
def handle(req, res)
@@ -14,4 +13,4 @@ module Admin
end
end
end
end
end

View File

@@ -2,7 +2,6 @@ module Admin
module Actions
module Tags
class Index < Action
include Deps["views.tags.index"]
def handle(req, res)
@@ -11,4 +10,4 @@ module Admin
end
end
end
end
end

View File

@@ -4,7 +4,6 @@ module Admin
module Actions
module Trips
class AddPost < Admin::Action
include Deps["commands.trips.add_post"]
def handle(req, res)

View File

@@ -4,7 +4,6 @@ module Admin
module Actions
module Trips
class Create < Admin::Action
include Deps["commands.trips.create"]
def handle(req, res)

View File

@@ -4,7 +4,6 @@ module Admin
module Actions
module Trips
class Show < Admin::Action
include Deps["views.trips.show"]
def handle(req, res)

View File

@@ -4,7 +4,6 @@ module Admin
module Actions
module Trips
class Update < Admin::Action
include Deps["commands.trips.update"]
def handle(req, res)