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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
bd4ab21c
Commit
bd4ab21c
authored
Dec 01, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix code docs
parent
4a0ebccf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
app/models/commit_range.rb
app/models/commit_range.rb
+2
-5
lib/gitlab/markdown/abstract_reference_filter.rb
lib/gitlab/markdown/abstract_reference_filter.rb
+7
-8
No files found.
app/models/commit_range.rb
View file @
bd4ab21c
...
@@ -13,8 +13,7 @@
...
@@ -13,8 +13,7 @@
# range.to_param # => {from: "f3f856029bc5f966c5a7ee24cf7efefdd20e6019^", to: "e86e1013709735be5bb767e2b228930c543f25ae"}
# range.to_param # => {from: "f3f856029bc5f966c5a7ee24cf7efefdd20e6019^", to: "e86e1013709735be5bb767e2b228930c543f25ae"}
# range.to_s # => "f3f85602..e86e1013"
# range.to_s # => "f3f85602..e86e1013"
#
#
# # Assuming `project` is a Project with a repository containing both commits:
# # Assuming the specified project has a repository containing both commits:
# range.project = project
# range.valid_commits? # => true
# range.valid_commits? # => true
#
#
class
CommitRange
class
CommitRange
...
@@ -68,7 +67,7 @@ class CommitRange
...
@@ -68,7 +67,7 @@ class CommitRange
range_string
.
strip!
range_string
.
strip!
unless
range_string
.
match
(
/\A
#{
PATTERN
}
\z/
)
unless
range_string
=~
/\A
#{
PATTERN
}
\z/
raise
ArgumentError
,
"invalid CommitRange string format:
#{
range_string
}
"
raise
ArgumentError
,
"invalid CommitRange string format:
#{
range_string
}
"
end
end
...
@@ -123,8 +122,6 @@ class CommitRange
...
@@ -123,8 +122,6 @@ class CommitRange
# Check if both the starting and ending commit IDs exist in a project's
# Check if both the starting and ending commit IDs exist in a project's
# repository
# repository
#
# project - An optional Project to check (default: `project`)
def
valid_commits?
def
valid_commits?
commit_start
.
present?
&&
commit_end
.
present?
commit_start
.
present?
&&
commit_end
.
present?
end
end
...
...
lib/gitlab/markdown/abstract_reference_filter.rb
View file @
bd4ab21c
...
@@ -2,8 +2,8 @@ require 'gitlab/markdown'
...
@@ -2,8 +2,8 @@ require 'gitlab/markdown'
module
Gitlab
module
Gitlab
module
Markdown
module
Markdown
# Issues, Snippets
and Merge Requests shares similar functionality in refernce filtering.
# Issues, Snippets
, Merge Requests, Commits and Commit Ranges share
#
All this functionality moved to this class
#
similar functionality in refernce filtering.
class
AbstractReferenceFilter
<
ReferenceFilter
class
AbstractReferenceFilter
<
ReferenceFilter
include
CrossProjectReference
include
CrossProjectReference
...
@@ -26,16 +26,15 @@ module Gitlab
...
@@ -26,16 +26,15 @@ module Gitlab
# Public: Find references in text (like `!123` for merge requests)
# Public: Find references in text (like `!123` for merge requests)
#
#
# AnyReferenceFilter.references_in(text) do |match, object|
# AnyReferenceFilter.references_in(text) do |match, id, project_ref, matches|
# "<a href=...>PREFIX#{object}</a>"
# object = find_object(project_ref, id)
# "<a href=...>#{object.to_reference}</a>"
# end
# end
#
#
# PREFIX - symbol that detects reference (like ! for merge requests)
# object - reference object (snippet, merget request etc)
# text - String text to search.
# text - String text to search.
#
#
# Yields the String match, the Integer referenced object ID, an
d an
optional String
# Yields the String match, the Integer referenced object ID, an optional String
# of the external project reference.
# of the external project reference
, and all of the matchdata
.
#
#
# Returns a String replaced with the return of the block.
# Returns a String replaced with the return of the block.
def
self
.
references_in
(
text
)
def
self
.
references_in
(
text
)
...
...
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