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
d882fac5
Commit
d882fac5
authored
May 05, 2021
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `include_if_ee` to `include_mod_with`
parent
7914849d
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
30 additions
and
30 deletions
+30
-30
app/helpers/gitlab_routing_helper.rb
app/helpers/gitlab_routing_helper.rb
+1
-1
app/helpers/sorting_titles_values_helper.rb
app/helpers/sorting_titles_values_helper.rb
+1
-1
app/models/concerns/protected_ref_access.rb
app/models/concerns/protected_ref_access.rb
+1
-1
app/services/merge_requests/create_service.rb
app/services/merge_requests/create_service.rb
+1
-1
app/uploaders/object_storage.rb
app/uploaders/object_storage.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/presenters/ee/merge_request_presenter.rb
ee/app/presenters/ee/merge_request_presenter.rb
+1
-1
ee/app/serializers/vulnerabilities/finding_entity.rb
ee/app/serializers/vulnerabilities/finding_entity.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
+17
-17
spec/support/helpers/ldap_helpers.rb
spec/support/helpers/ldap_helpers.rb
+1
-1
No files found.
app/helpers/gitlab_routing_helper.rb
View file @
d882fac5
...
...
@@ -384,4 +384,4 @@ module GitlabRoutingHelper
end
end
GitlabRoutingHelper
.
include_
if_ee
(
'EE::GitlabRoutingHelper'
)
GitlabRoutingHelper
.
include_
mod_with
(
'EE::GitlabRoutingHelper'
)
app/helpers/sorting_titles_values_helper.rb
View file @
d882fac5
...
...
@@ -328,4 +328,4 @@ module SortingTitlesValuesHelper
end
end
SortingHelper
.
include_
if_ee
(
'::EE::SortingTitlesValuesHelper'
)
SortingHelper
.
include_
mod_with
(
'::EE::SortingTitlesValuesHelper'
)
app/models/concerns/protected_ref_access.rb
View file @
d882fac5
...
...
@@ -53,7 +53,7 @@ module ProtectedRefAccess
end
end
ProtectedRefAccess
.
include_
if_ee
(
'EE::ProtectedRefAccess::Scopes'
)
ProtectedRefAccess
.
include_
mod_with
(
'EE::ProtectedRefAccess::Scopes'
)
ProtectedRefAccess
.
prepend_mod_with
(
'EE::ProtectedRefAccess'
)
# When using `prepend` (or `include` for that matter), the `ClassMethods`
...
...
app/services/merge_requests/create_service.rb
View file @
d882fac5
...
...
@@ -53,4 +53,4 @@ module MergeRequests
end
end
MergeRequests
::
CreateService
.
include_
if_ee
(
'EE::MergeRequests::CreateService'
)
MergeRequests
::
CreateService
.
include_
mod_with
(
'EE::MergeRequests::CreateService'
)
app/uploaders/object_storage.rb
View file @
d882fac5
...
...
@@ -508,4 +508,4 @@ module ObjectStorage
end
end
ObjectStorage
::
Concern
.
include_
if_ee
(
'::EE::ObjectStorage::Concern'
)
ObjectStorage
::
Concern
.
include_
mod_with
(
'::EE::ObjectStorage::Concern'
)
config/initializers/0_inject_enterprise_edition_module.rb
View file @
d882fac5
...
...
@@ -17,7 +17,7 @@ module InjectEnterpriseEditionModule
&
method
(
:extend
))
end
def
include_
if_ee
(
constant_with_prefix
,
namespace:
Object
)
def
include_
mod_with
(
constant_with_prefix
,
namespace:
Object
)
each_extension_for
(
constant_without_prefix
(
constant_with_prefix
),
namespace
,
...
...
doc/development/ee_features.md
View file @
d882fac5
...
...
@@ -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_mod_with`
, or
`include_
if_ee
`
. These methods take a
by using
`prepend_mod_with`
,
`extend_mod_with`
, or
`include_
mod_with
`
. These methods take a
_String_
containing the full module name as the argument, not the module itself, like so;
```
ruby
...
...
ee/app/presenters/ee/merge_request_presenter.rb
View file @
d882fac5
...
...
@@ -73,4 +73,4 @@ module EE
end
end
EE
::
MergeRequestPresenter
.
include_
if_ee
(
'::EE::ProjectsHelper'
)
EE
::
MergeRequestPresenter
.
include_
mod_with
(
'::EE::ProjectsHelper'
)
ee/app/serializers/vulnerabilities/finding_entity.rb
View file @
d882fac5
...
...
@@ -56,4 +56,4 @@ class Vulnerabilities::FindingEntity < Grape::Entity
end
end
Vulnerabilities
::
FindingEntity
.
include_
if_ee
(
'::EE::ProjectsHelper'
)
Vulnerabilities
::
FindingEntity
.
include_
mod_with
(
'::EE::ProjectsHelper'
)
rubocop/cop/inject_enterprise_edition_module.rb
View file @
d882fac5
...
...
@@ -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_mod_with`, or `prepend_mod_with`'
'EE modules must be injected using `include_
mod_with
`, `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_mod_with prepend_mod_with]
).
freeze
Set
.
new
(
%i[include_
mod_with
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 @
d882fac5
...
...
@@ -123,7 +123,7 @@ RSpec.describe InjectEnterpriseEditionModule do
it_behaves_like
'expand the extension with'
,
:extend
end
describe
'#include_
if_ee
'
do
describe
'#include_
mod_with
'
do
it_behaves_like
'expand the extension with'
,
:include
end
...
...
spec/rubocop/cop/inject_enterprise_edition_module_spec.rb
View file @
d882fac5
...
...
@@ -68,19 +68,19 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
SOURCE
end
it
'flags the use of `include_
if_ee
EE` in the middle of a file'
do
it
'flags the use of `include_
mod_with
EE` in the middle of a file'
do
expect_offense
(
<<~
SOURCE
)
class Foo
include_
if_ee
'EE::Foo'
include_
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 `include_
if_ee
::EE` in the middle of a file'
do
it
'flags the use of `include_
mod_with
::EE` in the middle of a file'
do
expect_offense
(
<<~
SOURCE
)
class Foo
include_
if_ee
'::EE::Foo'
include_
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
...
...
@@ -115,7 +115,7 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
it
'does not flag including of regular modules'
do
expect_no_offenses
(
<<~
SOURCE
)
class Foo
include_
if_ee
'Foo'
include_
mod_with
'Foo'
end
SOURCE
end
...
...
@@ -137,12 +137,12 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
SOURCE
end
it
'does not flag the use of `include_
if_ee
EE` on the last line'
do
it
'does not flag the use of `include_
mod_with
EE` on the last line'
do
expect_no_offenses
(
<<~
SOURCE
)
class Foo
end
Foo.include_
if_ee
('EE::Foo')
Foo.include_
mod_with
('EE::Foo')
SOURCE
end
...
...
@@ -161,7 +161,7 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
end
Foo.extend_mod_with('EE::Foo')
Foo.include_
if_ee
('EE::Foo')
Foo.include_
mod_with
('EE::Foo')
Foo.prepend_mod_with('EE::Foo')
SOURCE
end
...
...
@@ -171,7 +171,7 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
class Foo
end
Foo.include_
if_ee
('EE::Foo')
Foo.include_
mod_with
('EE::Foo')
Foo.prepend_mod_with('EE::Foo')
Foo.include(Bar)
...
...
@@ -185,14 +185,14 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
class Foo
prepend_mod_with 'EE::Foo'
^^^^^^^^^^^^^^^^^^^^^^^ Injecting EE modules must be done on the last line of this file, outside of any class or module definitions
include_
if_ee
'Bar'
include_
mod_with
'Bar'
end
SOURCE
expect_correction
(
<<~
SOURCE
)
class Foo
prepend_mod_with 'EE::Foo' # rubocop: disable Cop/InjectEnterpriseEditionModule
include_
if_ee
'Bar'
include_
mod_with
'Bar'
end
SOURCE
end
...
...
@@ -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_mod_with`, or `prepend_mod_with`
^^^^^^^^^^^^^^^^^^^^ EE modules must be injected using `include_
mod_with
`, `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_mod_with`, or `prepend_mod_with`
^^^^^^^^^^^^^^^^^^^^^^^^ EE modules must be injected using `include_
mod_with
`, `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_mod_with`, or `prepend_mod_with`
^^^^^^^^^^^^^^^^^^^ EE modules must be injected using `include_
mod_with
`, `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_mod_with`, or `prepend_mod_with`
^^^^^^^^^^^^^^^^^^^^ EE modules must be injected using `include_
mod_with
`, `extend_mod_with`, or `prepend_mod_with`
SOURCE
end
...
...
@@ -247,12 +247,12 @@ RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do
SOURCE
end
it
'disallows the use of include_
if_ee
without a String'
do
it
'disallows the use of include_
mod_with
without a String'
do
expect_offense
(
<<~
SOURCE
)
class Foo
end
Foo.include_
if_ee
(EE::Foo)
Foo.include_
mod_with
(EE::Foo)
^^^^^^^ EE modules to inject must be specified as a String
SOURCE
end
...
...
spec/support/helpers/ldap_helpers.rb
View file @
d882fac5
...
...
@@ -71,4 +71,4 @@ module LdapHelpers
end
end
LdapHelpers
.
include_
if_ee
(
'EE::LdapHelpers'
)
LdapHelpers
.
include_
mod_with
(
'EE::LdapHelpers'
)
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