summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-03-24 09:34:40 +0000
committerGo MAEDA <maeda@farend.jp>2023-03-24 09:34:40 +0000
commitfe71cb5bbea6504d643d4e33ca7148191ee21952 (patch)
treeab7942e0d087dca92cf42ee5e2b27acfeec1c45e /lib
parent2b00670e4d204db24b9e38dd5e7a8d72aa7470bc (diff)
downloadredmine-fe71cb5bbea6504d643d4e33ca7148191ee21952.tar.gz
redmine-fe71cb5bbea6504d643d4e33ca7148191ee21952.zip
Fix RuboCop offense Lint/MissingSuper (#36919).
git-svn-id: https://svn.redmine.org/redmine/trunk@22147 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/diff_table.rb1
-rw-r--r--lib/redmine/scm/adapters/abstract_adapter.rb1
-rw-r--r--lib/redmine/scm/adapters/bazaar_adapter.rb5
-rw-r--r--lib/redmine/scm/adapters/cvs_adapter.rb8
-rw-r--r--lib/redmine/scm/adapters/filesystem_adapter.rb3
-rw-r--r--lib/redmine/scm/adapters/git_adapter.rb5
-rw-r--r--lib/redmine/scm/adapters/mercurial_adapter.rb5
-rw-r--r--lib/redmine/syntax_highlighting.rb1
-rw-r--r--lib/redmine/twofa/base.rb1
-rw-r--r--lib/redmine/unified_diff.rb1
-rw-r--r--lib/redmine/wiki_formatting/html_parser.rb2
11 files changed, 9 insertions, 24 deletions
diff --git a/lib/redmine/diff_table.rb b/lib/redmine/diff_table.rb
index b783bb3d8..989e51c32 100644
--- a/lib/redmine/diff_table.rb
+++ b/lib/redmine/diff_table.rb
@@ -25,6 +25,7 @@ module Redmine
# Initialize with a Diff file and the type of Diff View
# The type view must be inline or sbs (side_by_side)
def initialize(type="inline", style=nil)
+ super()
@parsing = false
@added = 0
@removed = 0
diff --git a/lib/redmine/scm/adapters/abstract_adapter.rb b/lib/redmine/scm/adapters/abstract_adapter.rb
index ebd00d55f..087f62e4c 100644
--- a/lib/redmine/scm/adapters/abstract_adapter.rb
+++ b/lib/redmine/scm/adapters/abstract_adapter.rb
@@ -75,6 +75,7 @@ module Redmine
@login = login if login && !login.empty?
@password = (password || "") if @login
@root_url = root_url.blank? ? retrieve_root_url : root_url
+ @path_encoding = path_encoding.presence || 'UTF-8'
end
def adapter_name
diff --git a/lib/redmine/scm/adapters/bazaar_adapter.rb b/lib/redmine/scm/adapters/bazaar_adapter.rb
index e35f876fb..048b6b59f 100644
--- a/lib/redmine/scm/adapters/bazaar_adapter.rb
+++ b/lib/redmine/scm/adapters/bazaar_adapter.rb
@@ -56,10 +56,7 @@ module Redmine
end
def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil)
- @url = url
- @root_url = url
- @path_encoding = 'UTF-8'
- # do not call *super* for non ASCII repository path
+ super(url, url, nil, nil, 'UTF-8')
end
def bzr_path_encodig=(encoding)
diff --git a/lib/redmine/scm/adapters/cvs_adapter.rb b/lib/redmine/scm/adapters/cvs_adapter.rb
index 9436562f7..9fdc2a307 100644
--- a/lib/redmine/scm/adapters/cvs_adapter.rb
+++ b/lib/redmine/scm/adapters/cvs_adapter.rb
@@ -63,16 +63,10 @@ module Redmine
# password -> unnecessary too
def initialize(url, root_url=nil, login=nil, password=nil,
path_encoding=nil)
- @path_encoding = path_encoding.presence || 'UTF-8'
- @url = url
# TODO: better Exception here (IllegalArgumentException)
raise CommandFailed if root_url.blank?
- @root_url = root_url
-
- # These are unused.
- @login = login if login && !login.empty?
- @password = (password || "") if @login
+ super
end
def path_encoding
diff --git a/lib/redmine/scm/adapters/filesystem_adapter.rb b/lib/redmine/scm/adapters/filesystem_adapter.rb
index dcc3c1ae6..a99d0c2ff 100644
--- a/lib/redmine/scm/adapters/filesystem_adapter.rb
+++ b/lib/redmine/scm/adapters/filesystem_adapter.rb
@@ -35,8 +35,7 @@ module Redmine
def initialize(url, root_url=nil, login=nil, password=nil,
path_encoding=nil)
- @url = with_trailing_slash(url)
- @path_encoding = path_encoding.blank? ? 'UTF-8' : path_encoding
+ super(with_trailing_slash(url), nil, nil, nil, path_encoding)
end
def path_encoding
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index 489397ef2..0c916c283 100644
--- a/lib/redmine/scm/adapters/git_adapter.rb
+++ b/lib/redmine/scm/adapters/git_adapter.rb
@@ -62,11 +62,6 @@ module Redmine
end
end
- def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil)
- super
- @path_encoding = path_encoding.blank? ? 'UTF-8' : path_encoding
- end
-
def path_encoding
@path_encoding
end
diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb
index df7e622bc..3651f1b98 100644
--- a/lib/redmine/scm/adapters/mercurial_adapter.rb
+++ b/lib/redmine/scm/adapters/mercurial_adapter.rb
@@ -76,11 +76,6 @@ module Redmine
end
end
- def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil)
- super
- @path_encoding = path_encoding.blank? ? 'UTF-8' : path_encoding
- end
-
def path_encoding
@path_encoding
end
diff --git a/lib/redmine/syntax_highlighting.rb b/lib/redmine/syntax_highlighting.rb
index 68578f674..5b1d30f04 100644
--- a/lib/redmine/syntax_highlighting.rb
+++ b/lib/redmine/syntax_highlighting.rb
@@ -68,6 +68,7 @@ module Redmine
# Syntax highlighting is completed within each line.
class CustomHTMLLinewise < ::Rouge::Formatter
def initialize(formatter)
+ super()
@formatter = formatter
end
diff --git a/lib/redmine/twofa/base.rb b/lib/redmine/twofa/base.rb
index 7f2023ec3..81f90e95a 100644
--- a/lib/redmine/twofa/base.rb
+++ b/lib/redmine/twofa/base.rb
@@ -21,6 +21,7 @@ module Redmine
module Twofa
class Base
def self.inherited(child)
+ super
# require-ing a Base subclass will register it as a 2FA scheme
Redmine::Twofa.register_scheme(scheme_name(child), child)
end
diff --git a/lib/redmine/unified_diff.rb b/lib/redmine/unified_diff.rb
index 4c3f3afd3..62fe3e5fc 100644
--- a/lib/redmine/unified_diff.rb
+++ b/lib/redmine/unified_diff.rb
@@ -23,6 +23,7 @@ module Redmine
attr_reader :diff_type, :diff_style
def initialize(diff, options={})
+ super()
options.assert_valid_keys(:type, :style, :max_lines)
diff = diff.split("\n") if diff.is_a?(String)
@diff_type = options[:type] || 'inline'
diff --git a/lib/redmine/wiki_formatting/html_parser.rb b/lib/redmine/wiki_formatting/html_parser.rb
index b7fff8e70..3763c95db 100644
--- a/lib/redmine/wiki_formatting/html_parser.rb
+++ b/lib/redmine/wiki_formatting/html_parser.rb
@@ -41,7 +41,7 @@ module Redmine
class WikiTags < ::Loofah::Scrubber
def initialize(tags_to_text)
- @direction = :bottom_up
+ super(:direction => :bottom_up)
@tags_to_text = tags_to_text || {}
end