Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7914849d
Commit
7914849d
authored
May 05, 2021
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `extend_if_ee` to `extend_mod_with`
parent
52685fea
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
26 additions
and
26 deletions
+26
-26
app/helpers/application_settings_helper.rb
app/helpers/application_settings_helper.rb
+1
-1
app/helpers/auth_helper.rb
app/helpers/auth_helper.rb
+1
-1
app/helpers/services_helper.rb
app/helpers/services_helper.rb
+1
-1
app/helpers/system_note_helper.rb
app/helpers/system_note_helper.rb
+1
-1
config/initializers/0_inject_enterprise_edition_module.rb
config/initializers/0_inject_enterprise_edition_module.rb
+1
-1
doc/development/ee_features.md
doc/development/ee_features.md
+1
-1
ee/app/services/ee/system_note_service.rb
ee/app/services/ee/system_note_service.rb
+1
-1
qa/qa/runtime/env.rb
qa/qa/runtime/env.rb
+1
-1
rubocop/cop/inject_enterprise_edition_module.rb
rubocop/cop/inject_enterprise_edition_module.rb
+2
-2
spec/config/inject_enterprise_edition_module_spec.rb
spec/config/inject_enterprise_edition_module_spec.rb
+1
-1
spec/rubocop/cop/inject_enterprise_edition_module_spec.rb
spec/rubocop/cop/inject_enterprise_edition_module_spec.rb
+14
-14
spec/support/helpers/test_env.rb
spec/support/helpers/test_env.rb
+1
-1
No files found.
app/helpers/application_settings_helper.rb
View file @
7914849d
...
...
@@ -442,4 +442,4 @@ ApplicationSettingsHelper.prepend_mod_with('EE::ApplicationSettingsHelper')
# The methods in `EE::ApplicationSettingsHelper` should be available as both
# instance and class methods.
ApplicationSettingsHelper
.
extend_
if_ee
(
'EE::ApplicationSettingsHelper'
)
ApplicationSettingsHelper
.
extend_
mod_with
(
'EE::ApplicationSettingsHelper'
)
app/helpers/auth_helper.rb
View file @
7914849d
...
...
@@ -195,4 +195,4 @@ AuthHelper.prepend_mod_with('EE::AuthHelper')
# The methods added in EE should be available as both class and instance
# methods, just like the methods provided by `AuthHelper` itself.
AuthHelper
.
extend_
if_ee
(
'EE::AuthHelper'
)
AuthHelper
.
extend_
mod_with
(
'EE::AuthHelper'
)
app/helpers/services_helper.rb
View file @
7914849d
...
...
@@ -182,4 +182,4 @@ ServicesHelper.prepend_mod_with('EE::ServicesHelper')
# The methods in `EE::ServicesHelper` should be available as both instance and
# class methods.
ServicesHelper
.
extend_
if_ee
(
'EE::ServicesHelper'
)
ServicesHelper
.
extend_
mod_with
(
'EE::ServicesHelper'
)
app/helpers/system_note_helper.rb
View file @
7914849d
...
...
@@ -58,4 +58,4 @@ SystemNoteHelper.prepend_mod_with('EE::SystemNoteHelper')
# The methods in `EE::SystemNoteHelper` should be available as both instance and
# class methods.
SystemNoteHelper
.
extend_
if_ee
(
'EE::SystemNoteHelper'
)
SystemNoteHelper
.
extend_
mod_with
(
'EE::SystemNoteHelper'
)
config/initializers/0_inject_enterprise_edition_module.rb
View file @
7914849d
...
...
@@ -10,7 +10,7 @@ module InjectEnterpriseEditionModule
with_descendants:
with_descendants
)
end
def
extend_
if_ee
(
constant_with_prefix
,
namespace:
Object
)
def
extend_
mod_with
(
constant_with_prefix
,
namespace:
Object
)
each_extension_for
(
constant_without_prefix
(
constant_with_prefix
),
namespace
,
...
...
doc/development/ee_features.md
View file @
7914849d
...
...
@@ -114,7 +114,7 @@ Vulnerabilities::Finding.prepend_ee_mod
will prepend the module named
`::EE::Vulnerabilities::Finding`
.
If the extending module does not follow this naming convention, you can also provide the module name
by using
`prepend_mod_with`
,
`extend_
if_ee
`
, or
`include_if_ee`
. These methods take a
by using
`prepend_mod_with`
,
`extend_
mod_with
`
, or
`include_if_ee`
. These methods take a
_String_
containing the full module name as the argument, not the module itself, like so;
```
ruby
...
...
ee/app/services/ee/system_note_service.rb
View file @
7914849d
...
...
@@ -13,7 +13,7 @@ module EE
# ::SystemNoteService wants the methods to be available as both class and
# instance methods. This removes the need for having to both `include` and
# `extend` this module everywhere it is used.
extend_
if_ee
(
'EE::SystemNoteService'
)
# rubocop: disable Cop/InjectEnterpriseEditionModule
extend_
mod_with
(
'EE::SystemNoteService'
)
# rubocop: disable Cop/InjectEnterpriseEditionModule
end
def
epic_issue
(
epic
,
issue
,
user
,
type
)
...
...
qa/qa/runtime/env.rb
View file @
7914849d
...
...
@@ -403,4 +403,4 @@ module QA
end
end
QA
::
Runtime
::
Env
.
extend_
if_ee
(
'Runtime::Env'
,
namespace:
QA
)
QA
::
Runtime
::
Env
.
extend_
mod_with
(
'Runtime::Env'
,
namespace:
QA
)
rubocop/cop/inject_enterprise_edition_module.rb
View file @
7914849d
...
...
@@ -9,12 +9,12 @@ module RuboCop
', outside of any class or module definitions'
DISALLOWED_METHOD
=
'EE modules must be injected using `include_if_ee`, `extend_
if_ee
`, or `prepend_mod_with`'
'EE modules must be injected using `include_if_ee`, `extend_
mod_with
`, or `prepend_mod_with`'
INVALID_ARGUMENT
=
'EE modules to inject must be specified as a String'
CHECK_LINE_METHODS
=
Set
.
new
(
%i[include_if_ee extend_
if_ee
prepend_mod_with]
).
freeze
Set
.
new
(
%i[include_if_ee extend_
mod_with
prepend_mod_with]
).
freeze
DISALLOW_METHODS
=
Set
.
new
(
%i[include extend prepend]
).
freeze
...
...
spec/config/inject_enterprise_edition_module_spec.rb
View file @
7914849d
...
...
@@ -119,7 +119,7 @@ RSpec.describe InjectEnterpriseEditionModule do
it_behaves_like
'expand the extension with'
,
:prepend
end
describe
'#extend_
if_ee
'
do
describe
'#extend_
mod_with
'
do
it_behaves_like
'expand the extension with'
,
:extend
end
...
...
spec/rubocop/cop/inject_enterprise_edition_module_spec.rb
View file @
7914849d
...
...
@@ -86,19 +86,19 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
SOURCE
end
it
'flags the use of `extend_
if_ee
EE` in the middle of a file'
do
it
'flags the use of `extend_
mod_with
EE` in the middle of a file'
do
expect_offense
(
<<~
SOURCE
)
class Foo
extend_
if_ee
'EE::Foo'
extend_
mod_with
'EE::Foo'
^^^^^^^^^^^^^^^^^^^^^^ Injecting EE modules must be done on the last line of this file, outside of any class or module definitions
end
SOURCE
end
it
'flags the use of `extend_
if_ee
::EE` in the middle of a file'
do
it
'flags the use of `extend_
mod_with
::EE` in the middle of a file'
do
expect_offense
(
<<~
SOURCE
)
class Foo
extend_
if_ee
'::EE::Foo'
extend_
mod_with
'::EE::Foo'
^^^^^^^^^^^^^^^^^^^^^^^^ Injecting EE modules must be done on the last line of this file, outside of any class or module definitions
end
SOURCE
...
...
@@ -123,7 +123,7 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
it
'does not flag extending using regular modules'
do
expect_no_offenses
(
<<~
SOURCE
)
class Foo
extend_
if_ee
'Foo'
extend_
mod_with
'Foo'
end
SOURCE
end
...
...
@@ -146,12 +146,12 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
SOURCE
end
it
'does not flag the use of `extend_
if_ee
EE` on the last line'
do
it
'does not flag the use of `extend_
mod_with
EE` on the last line'
do
expect_no_offenses
(
<<~
SOURCE
)
class Foo
end
Foo.extend_
if_ee
('EE::Foo')
Foo.extend_
mod_with
('EE::Foo')
SOURCE
end
...
...
@@ -160,7 +160,7 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
class Foo
end
Foo.extend_
if_ee
('EE::Foo')
Foo.extend_
mod_with
('EE::Foo')
Foo.include_if_ee('EE::Foo')
Foo.prepend_mod_with('EE::Foo')
SOURCE
...
...
@@ -203,7 +203,7 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
end
Foo.prepend(EE::Foo)
^^^^^^^^^^^^^^^^^^^^ EE modules must be injected using `include_if_ee`, `extend_
if_ee
`, or `prepend_mod_with`
^^^^^^^^^^^^^^^^^^^^ EE modules must be injected using `include_if_ee`, `extend_
mod_with
`, or `prepend_mod_with`
SOURCE
end
...
...
@@ -213,7 +213,7 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
end
Foo.prepend(QA::EE::Foo)
^^^^^^^^^^^^^^^^^^^^^^^^ EE modules must be injected using `include_if_ee`, `extend_
if_ee
`, or `prepend_mod_with`
^^^^^^^^^^^^^^^^^^^^^^^^ EE modules must be injected using `include_if_ee`, `extend_
mod_with
`, or `prepend_mod_with`
SOURCE
end
...
...
@@ -223,7 +223,7 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
end
Foo.extend(EE::Foo)
^^^^^^^^^^^^^^^^^^^ EE modules must be injected using `include_if_ee`, `extend_
if_ee
`, or `prepend_mod_with`
^^^^^^^^^^^^^^^^^^^ EE modules must be injected using `include_if_ee`, `extend_
mod_with
`, or `prepend_mod_with`
SOURCE
end
...
...
@@ -233,7 +233,7 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
end
Foo.include(EE::Foo)
^^^^^^^^^^^^^^^^^^^^ EE modules must be injected using `include_if_ee`, `extend_
if_ee
`, or `prepend_mod_with`
^^^^^^^^^^^^^^^^^^^^ EE modules must be injected using `include_if_ee`, `extend_
mod_with
`, or `prepend_mod_with`
SOURCE
end
...
...
@@ -257,12 +257,12 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
SOURCE
end
it
'disallows the use of extend_
if_ee
without a String'
do
it
'disallows the use of extend_
mod_with
without a String'
do
expect_offense
(
<<~
SOURCE
)
class Foo
end
Foo.extend_
if_ee
(EE::Foo)
Foo.extend_
mod_with
(EE::Foo)
^^^^^^^ EE modules to inject must be specified as a String
SOURCE
end
...
...
spec/support/helpers/test_env.rb
View file @
7914849d
...
...
@@ -613,4 +613,4 @@ end
require_relative
(
'../../../ee/spec/support/helpers/ee/test_env'
)
if
Gitlab
.
ee?
::
TestEnv
.
prepend_mod_with
(
'::EE::TestEnv'
)
::
TestEnv
.
extend_
if_ee
(
'::EE::TestEnv'
)
::
TestEnv
.
extend_
mod_with
(
'::EE::TestEnv'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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