chore: rubocop

chore: fix api test conventions

chore: rubocop -A spec/

chore: more rubocop -A

fix failing test

rubocop fixes

removes helper methods that are in my opinion dead code

more rubocop fixes

rubocop -a --auto-gen-config
This commit is contained in:
Philipp Rothmann 2023-05-12 13:01:12 +02:00 committed by Philipp Rothmann
parent f6fb804bbe
commit fb2b4d8a8a
331 changed files with 4263 additions and 4507 deletions

View file

@ -8,17 +8,17 @@ module FoodsoftWiki
subnav.item :all_pages, I18n.t('navigation.wiki.all_pages'), ctx.all_pages_path, id: nil
end
# move this last added item to just after the foodcoop menu
if i = primary.items.index(primary[:foodcoop])
primary.items.insert(i + 1, primary.items.delete_at(-1))
end
return unless i = primary.items.index(primary[:foodcoop])
primary.items.insert(i + 1, primary.items.delete_at(-1))
end
def default_foodsoft_config(cfg)
cfg[:use_wiki] = true
end
initializer "foodsoft_wiki.assets.precompile" do |app|
app.config.assets.precompile += %w(icons/feed-icon-14x14.png)
initializer 'foodsoft_wiki.assets.precompile' do |app|
app.config.assets.precompile += %w[icons/feed-icon-14x14.png]
end
end
end

View file

@ -3,10 +3,10 @@ module FoodsoftWiki
def self.included(base) # :nodoc:
base.class_eval do
# modify user presentation link to writing a message for the user
def additonal_welcome_text(user)
if FoodsoftWiki.enabled? && (page = Page.welcome_mail)
page.body
end
def additonal_welcome_text(_user)
return unless FoodsoftWiki.enabled? && (page = Page.welcome_mail)
page.body
end
end
end
@ -15,5 +15,5 @@ end
# modify existing helper
ActiveSupport.on_load(:after_initialize) do
Mailer.send :include, FoodsoftWiki::Mailer
Mailer.include FoodsoftWiki::Mailer
end

View file

@ -1,3 +1,3 @@
module FoodsoftWiki
VERSION = "0.0.1"
VERSION = '0.0.1'
end

View file

@ -10,7 +10,7 @@ module FoodsoftWiki
link_attributes_for do |page|
permalink = Page.permalink(page)
if Page.exists?(:permalink => permalink)
if Page.exists?(permalink: permalink)
{ href: url_for(:wiki_page_path, permalink: permalink) }
elsif page.include? '#'
# If "Foo#Bar" does not exist then consider "Foo" with anchor.
@ -20,8 +20,8 @@ module FoodsoftWiki
end
end
section_link do |section|
""
section_link do |_section|
''
end
def to_html(render_options = {})
@ -41,7 +41,7 @@ module FoodsoftWiki
return { href: '#' + anchor } if page.empty?
permalink = Page.permalink(page)
if Page.exists?(:permalink => permalink)
if Page.exists?(permalink: permalink)
{ href: url_for(:wiki_page_path, permalink: permalink, anchor: anchor) }
else
# Do not suggest to use number signs in the title.