Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
bf851133
Commit
bf851133
authored
2 years ago
by
Yamagishi Kazutoshi
Committed by
GitHub
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Fix all rubocop warnings
parent
05e39dc6
Changes
48
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
lib/paperclip/type_corrector.rb
+1
-1
lib/paperclip/type_corrector.rb
lib/rails/engine_extensions.rb
+3
-1
lib/rails/engine_extensions.rb
lib/tasks/branding.rake
+2
-0
lib/tasks/branding.rake
lib/tasks/emojis.rake
+1
-1
lib/tasks/emojis.rake
lib/tasks/mastodon.rake
+2
-0
lib/tasks/mastodon.rake
lib/tasks/repo.rake
+1
-1
lib/tasks/repo.rake
lib/tasks/statistics.rake
+1
-1
lib/tasks/statistics.rake
lib/webpacker/manifest_extensions.rb
+2
-0
lib/webpacker/manifest_extensions.rb
with
13 additions
and
5 deletions
+13
-5
lib/paperclip/type_corrector.rb
+
1
-
1
View file @
bf851133
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
lib/rails/engine_extensions.rb
+
3
-
1
View file @
bf851133
# 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
...
...
This diff is collapsed.
Click to expand it.
lib/tasks/branding.rake
+
2
-
0
View file @
bf851133
# frozen_string_literal: true
namespace
:branding
do
desc
'Generate necessary graphic assets for branding from source SVG files'
task
generate: :environment
do
...
...
This diff is collapsed.
Click to expand it.
lib/tasks/emojis.rake
+
1
-
1
View file @
bf851133
...
...
@@ -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
|
...
...
This diff is collapsed.
Click to expand it.
lib/tasks/mastodon.rake
+
2
-
0
View file @
bf851133
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
lib/tasks/repo.rake
+
1
-
1
View file @
bf851133
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
lib/tasks/statistics.rake
+
1
-
1
View file @
bf851133
...
...
@@ -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)
,
...
...
This diff is collapsed.
Click to expand it.
lib/webpacker/manifest_extensions.rb
+
2
-
0
View file @
bf851133
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets