Commit bf851133 authored by Yamagishi Kazutoshi's avatar Yamagishi Kazutoshi Committed by GitHub
Browse files

Fix all rubocop warnings

parent 05e39dc6
Showing with 13 additions and 5 deletions
+13 -5
......@@ -7,7 +7,7 @@ module Paperclip
def make
return @file unless options[:format]
target_extension = '.' + options[:format]
target_extension = ".#{options[:format]}"
extension = File.extname(attachment.instance_read(:file_name))
return @file unless options[:style] == :original && target_extension && extension != target_extension
......
# frozen_string_literal: true
module Rails
module EngineExtensions
# Rewrite task loading code to filter digitalocean.rake task
def run_tasks_blocks(app)
Railtie.instance_method(:run_tasks_blocks).bind(self).call(app)
paths["lib/tasks"].existent.reject { |ext| ext.end_with?('digitalocean.rake') }.sort.each { |ext| load(ext) }
paths['lib/tasks'].existent.reject { |ext| ext.end_with?('digitalocean.rake') }.sort.each { |ext| load(ext) }
end
end
end
......
# frozen_string_literal: true
namespace :branding do
desc 'Generate necessary graphic assets for branding from source SVG files'
task generate: :environment do
......
......@@ -69,7 +69,7 @@ namespace :emojis do
end
end
existence_maps = grouped_codes.map { |c| c.index_with { |cc| File.exist?(Rails.root.join('public', 'emoji', codepoints_to_filename(cc) + '.svg')) } }
existence_maps = grouped_codes.map { |c| c.index_with { |cc| File.exist?(Rails.root.join('public', 'emoji', "#{codepoints_to_filename(cc)}.svg")) } }
map = {}
existence_maps.each do |group|
......
......@@ -399,11 +399,13 @@ namespace :mastodon do
prompt.say 'Running `RAILS_ENV=production rails assets:precompile` ...'
prompt.say "\n\n"
# rubocop:disable Metrics/BlockNesting
if !system(env.transform_values(&:to_s).merge({ 'RAILS_ENV' => 'production' }), 'rails assets:precompile')
prompt.error 'That failed! Maybe you need swap space?'
else
prompt.say 'Done!'
end
# rubocop:enable Metrics/BlockNesting
end
end
......
......@@ -50,7 +50,7 @@ namespace :repo do
file.each_line do |line|
if line.start_with?('-')
new_line = line.gsub(/#([[:digit:]]+)*/) do |pull_request_reference|
pull_request_number = pull_request_reference[1..-1]
pull_request_number = pull_request_reference[1..]
response = nil
loop do
......
......@@ -7,7 +7,7 @@ namespace :mastodon do
task :stats do
require 'rails/code_statistics'
[
%w(App\ Libraries app/lib),
['App Libraries', 'app/lib'],
%w(Presenters app/presenters),
%w(Services app/services),
%w(Validators app/validators),
......
......@@ -4,6 +4,7 @@ module Webpacker::ManifestExtensions
def lookup(name, pack_type = {})
asset = super
# rubocop:disable Style/SingleArgumentDig
if pack_type[:with_integrity] && asset.respond_to?(:dig)
[asset.dig('src'), asset.dig('integrity')]
elsif asset.respond_to?(:dig)
......@@ -11,6 +12,7 @@ module Webpacker::ManifestExtensions
else
asset
end
# rubocop:enable Style/SingleArgumentDig
end
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment