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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
aa4007a5
Commit
aa4007a5
authored
Oct 22, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slight refactoring
parent
51ed8fd7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
lib/gitlab/reference_extractor.rb
lib/gitlab/reference_extractor.rb
+2
-10
No files found.
lib/gitlab/reference_extractor.rb
View file @
aa4007a5
...
@@ -11,6 +11,7 @@ module Gitlab
...
@@ -11,6 +11,7 @@ module Gitlab
@load_lazy_references
=
load_lazy_references
@load_lazy_references
=
load_lazy_references
@texts
=
[]
@texts
=
[]
@references
=
{}
end
end
def
analyze
(
text
,
options
=
{})
def
analyze
(
text
,
options
=
{})
...
@@ -19,21 +20,12 @@ module Gitlab
...
@@ -19,21 +20,12 @@ module Gitlab
%i(user label issue merge_request snippet commit commit_range)
.
each
do
|
type
|
%i(user label issue merge_request snippet commit commit_range)
.
each
do
|
type
|
define_method
(
"
#{
type
}
s"
)
do
define_method
(
"
#{
type
}
s"
)
do
references
[
type
]
@references
[
type
]
||=
pipeline_result
(
type
)
end
end
end
end
private
private
def
references
@references
||=
Hash
.
new
do
|
references
,
type
|
type
=
type
.
to_sym
next
references
[
type
]
if
references
.
has_key?
(
type
)
references
[
type
]
=
pipeline_result
(
type
)
end
end
# Instantiate and call HTML::Pipeline with a single reference filter type,
# Instantiate and call HTML::Pipeline with a single reference filter type,
# returning the result
# returning the result
#
#
...
...
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