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
1b25a8f4
Commit
1b25a8f4
authored
Jan 02, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Extract path
parent
07a5cb2e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lib/extracts_path.rb
lib/extracts_path.rb
+4
-2
No files found.
lib/extracts_path.rb
View file @
1b25a8f4
...
...
@@ -51,7 +51,7 @@ module ExtractsPath
return
pair
unless
@project
# Remove project, actions and all other staff from path
input
.
gsub!
(
"/
#{
@project
.
path_with_namespace
}
"
,
""
)
input
.
gsub!
(
/^\/
#{
Regexp
.
escape
(
@project
.
path_with_namespace
)
}
/
,
""
)
input
.
gsub!
(
/^\/(tree|commits|blame|blob)\//
,
""
)
# remove actions
input
.
gsub!
(
/\?.*$/
,
""
)
# remove stamps suffix
input
.
gsub!
(
/.atom$/
,
""
)
# remove rss feed
...
...
@@ -108,7 +108,9 @@ module ExtractsPath
request
.
format
=
:atom
end
@ref
,
@path
=
extract_ref
(
request
.
fullpath
)
path
=
request
.
fullpath
.
dup
@ref
,
@path
=
extract_ref
(
path
)
@id
=
File
.
join
(
@ref
,
@path
)
...
...
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