Standard rb fixes

This commit is contained in:
2023-10-31 08:17:10 +11:00
parent 1d43f6ca59
commit c1d756ec6f
9 changed files with 13 additions and 15 deletions

View File

@@ -82,7 +82,7 @@ module Adamantium
halt 401 unless (decoded_response.include? :scope) && (decoded_response.include? :me)
decoded_response[:scope].gsub(/post/, "create").split.map(&:to_sym)
decoded_response[:scope].gsub("post", "create").split.map(&:to_sym)
end
end
end

View File

@@ -36,8 +36,6 @@ module Adamantium
code = url.scan(pattern).flatten.first
if code
"<div class='video-container'><iframe width='100%' src='https://www.youtube.com/embed/#{code}' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' allowfullscreen></iframe></div>"
else
nil
end
end
end

View File

@@ -33,7 +33,7 @@ module Adamantium
end
ENV["TZ"] = nil
top_track_repo.for_post(id: post.id)
top_track_repo.for_post(id: post.id)
end
end
end

View File

@@ -23,13 +23,13 @@ module Adamantium
end
def weekly
ref = post_tags.where(:tag_id => "70").select(:post_id).dataset
where(:id => ref)
ref = post_tags.where(tag_id: "70").select(:post_id).dataset
where(id: ref)
end
def non_weekly
ref = post_tags.where(:tag_id => "70").select(:post_id).dataset
exclude(:id => ref)
ref = post_tags.where(tag_id: "70").select(:post_id).dataset
exclude(id: ref)
end
def published_between(start_date, end_date)

View File

@@ -17,3 +17,4 @@ if [ -n "$1" ]; then
else
bundle exec rake spec
fi

View File

@@ -8,9 +8,8 @@ module Admin
def handle(req, res)
add_syndication_source.call(post_id: req.params[:id],
source_name: req.params[:syndication_source_name],
source_url: req.params[:syndication_source_url]
)
source_name: req.params[:syndication_source_name],
source_url: req.params[:syndication_source_url])
res.status = 201
res.headers["HX-Refresh"] = true

View File

@@ -5,7 +5,7 @@ module Admin
include Deps["commands.posts.update"]
def handle(req, res)
update.(params: req.params)
update.call(params: req.params)
res.redirect "/admin/posts/#{req.params[:id]}"
end
end

View File

@@ -3,8 +3,8 @@ module Admin
module Posts
class Update
include Deps[
"repos.post_repo",
"renderers.markdown"
"repos.post_repo",
"renderers.markdown"
]
def call(params:)

View File

@@ -7,7 +7,7 @@ module Admin
expose :photos_buckets do |available_paths|
available_paths.each_with_object({}) do |root, memo|
memo[root.gsub(MEDIA_DIR, "")] = Dir["#{root}/**"].sort {|a,b| File.ctime(b) <=> File.ctime(a) }
memo[root.gsub(MEDIA_DIR, "")] = Dir["#{root}/**"].sort { |a, b| File.ctime(b) <=> File.ctime(a) }
end
end