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
Tatuya Kamada
gitlab-ce
Commits
cc39bca3
Commit
cc39bca3
authored
Feb 02, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rubocop: Style/AlignHash enabled
parent
c427bf08
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
70 additions
and
48 deletions
+70
-48
.rubocop.yml
.rubocop.yml
+1
-1
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+1
-2
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+2
-2
app/models/application_setting.rb
app/models/application_setting.rb
+2
-1
app/models/namespace.rb
app/models/namespace.rb
+13
-8
app/models/project.rb
app/models/project.rb
+11
-7
app/models/project_services/bamboo_service.rb
app/models/project_services/bamboo_service.rb
+12
-6
app/models/project_services/teamcity_service.rb
app/models/project_services/teamcity_service.rb
+9
-6
app/models/snippet.rb
app/models/snippet.rb
+5
-3
app/models/user.rb
app/models/user.rb
+6
-4
config/routes.rb
config/routes.rb
+4
-6
lib/gitlab/ldap/adapter.rb
lib/gitlab/ldap/adapter.rb
+4
-2
No files found.
.rubocop.yml
View file @
cc39bca3
...
...
@@ -23,7 +23,7 @@ Style/AlignHash:
Description
:
>-
Align the elements of a hash literal if they span more than
one line.
Enabled
:
fals
e
Enabled
:
tru
e
Style/AlignParameters
:
Description
:
>-
...
...
app/controllers/projects/blob_controller.rb
View file @
cc39bca3
...
...
@@ -59,8 +59,7 @@ class Projects::BlobController < Projects::ApplicationController
def
preview
@content
=
params
[
:content
]
diffy
=
Diffy
::
Diff
.
new
(
@blob
.
data
,
@content
,
diff:
'-U 3'
,
include_diff_info:
true
)
diffy
=
Diffy
::
Diff
.
new
(
@blob
.
data
,
@content
,
diff:
'-U 3'
,
include_diff_info:
true
)
@diff_lines
=
Gitlab
::
Diff
::
Parser
.
new
.
parse
(
diffy
.
diff
.
scan
(
/.*\n/
))
render
layout:
false
...
...
app/helpers/application_helper.rb
View file @
cc39bca3
...
...
@@ -75,9 +75,9 @@ module ApplicationHelper
options
[
:class
]
||=
''
options
[
:class
]
<<
' identicon'
bg_key
=
project
.
id
%
7
style
=
"background-color: #
#{
allowed_colors
.
values
[
bg_key
]
}
; color: #555"
content_tag
(
:div
,
class:
options
[
:class
],
style:
"background-color: #
#{
allowed_colors
.
values
[
bg_key
]
}
; color: #555"
)
do
content_tag
(
:div
,
class:
options
[
:class
],
style:
style
)
do
project
.
name
[
0
,
1
].
upcase
end
end
...
...
app/models/application_setting.rb
View file @
cc39bca3
...
...
@@ -14,7 +14,8 @@
#
class
ApplicationSetting
<
ActiveRecord
::
Base
validates
:home_page_url
,
allow_blank:
true
,
validates
:home_page_url
,
allow_blank:
true
,
format:
{
with:
URI
::
regexp
(
%w(http https)
),
message:
"should be a valid url"
},
if: :home_page_url_column_exist
...
...
app/models/namespace.rb
View file @
cc39bca3
...
...
@@ -20,12 +20,17 @@ class Namespace < ActiveRecord::Base
belongs_to
:owner
,
class_name:
"User"
validates
:owner
,
presence:
true
,
unless:
->
(
n
)
{
n
.
type
==
"Group"
}
validates
:name
,
presence:
true
,
uniqueness:
true
,
validates
:name
,
presence:
true
,
uniqueness:
true
,
length:
{
within:
0
..
255
},
format:
{
with:
Gitlab
::
Regex
.
name_regex
,
message:
Gitlab
::
Regex
.
name_regex_message
}
validates
:description
,
length:
{
within:
0
..
255
}
validates
:path
,
uniqueness:
{
case_sensitive:
false
},
presence:
true
,
length:
{
within:
1
..
255
},
validates
:path
,
uniqueness:
{
case_sensitive:
false
},
presence:
true
,
length:
{
within:
1
..
255
},
exclusion:
{
in:
Gitlab
::
Blacklist
.
path
},
format:
{
with:
Gitlab
::
Regex
.
path_regex
,
message:
Gitlab
::
Regex
.
path_regex_message
}
...
...
app/models/project.rb
View file @
cc39bca3
...
...
@@ -108,10 +108,14 @@ class Project < ActiveRecord::Base
# Validations
validates
:creator
,
presence:
true
,
on: :create
validates
:description
,
length:
{
maximum:
2000
},
allow_blank:
true
validates
:name
,
presence:
true
,
length:
{
within:
0
..
255
},
validates
:name
,
presence:
true
,
length:
{
within:
0
..
255
},
format:
{
with:
Gitlab
::
Regex
.
project_name_regex
,
message:
Gitlab
::
Regex
.
project_regex_message
}
validates
:path
,
presence:
true
,
length:
{
within:
0
..
255
},
validates
:path
,
presence:
true
,
length:
{
within:
0
..
255
},
exclusion:
{
in:
Gitlab
::
Blacklist
.
path
},
format:
{
with:
Gitlab
::
Regex
.
path_regex
,
message:
Gitlab
::
Regex
.
path_regex_message
}
...
...
app/models/project_services/bamboo_service.rb
View file @
cc39bca3
...
...
@@ -17,13 +17,19 @@ class BambooService < CiService
prop_accessor
:bamboo_url
,
:build_key
,
:username
,
:password
validates
:bamboo_url
,
presence:
true
,
format:
{
with:
URI
::
regexp
},
if: :activated?
validates
:bamboo_url
,
presence:
true
,
format:
{
with:
URI
::
regexp
},
if: :activated?
validates
:build_key
,
presence:
true
,
if: :activated?
validates
:username
,
presence:
true
,
if:
->
(
service
)
{
service
.
password?
},
if: :activated?
validates
:password
,
presence:
true
,
if:
->
(
service
)
{
service
.
username?
},
if: :activated?
validates
:username
,
presence:
true
,
if:
->
(
service
)
{
service
.
password?
},
if: :activated?
validates
:password
,
presence:
true
,
if:
->
(
service
)
{
service
.
username?
},
if: :activated?
attr_accessor
:response
...
...
app/models/project_services/teamcity_service.rb
View file @
cc39bca3
...
...
@@ -17,12 +17,15 @@ class TeamcityService < CiService
prop_accessor
:teamcity_url
,
:build_type
,
:username
,
:password
validates
:teamcity_url
,
presence:
true
,
validates
:teamcity_url
,
presence:
true
,
format:
{
with:
URI
::
regexp
},
if: :activated?
validates
:build_type
,
presence:
true
,
if: :activated?
validates
:username
,
presence:
true
,
validates
:username
,
presence:
true
,
if:
->
(
service
)
{
service
.
password?
},
if: :activated?
validates
:password
,
presence:
true
,
validates
:password
,
presence:
true
,
if:
->
(
service
)
{
service
.
username?
},
if: :activated?
attr_accessor
:response
...
...
app/models/snippet.rb
View file @
cc39bca3
...
...
@@ -29,7 +29,9 @@ class Snippet < ActiveRecord::Base
validates
:author
,
presence:
true
validates
:title
,
presence:
true
,
length:
{
within:
0
..
255
}
validates
:file_name
,
presence:
true
,
length:
{
within:
0
..
255
},
validates
:file_name
,
presence:
true
,
length:
{
within:
0
..
255
},
format:
{
with:
Gitlab
::
Regex
.
path_regex
,
message:
Gitlab
::
Regex
.
path_regex_message
}
validates
:content
,
presence:
true
...
...
app/models/user.rb
View file @
cc39bca3
...
...
@@ -116,7 +116,9 @@ class User < ActiveRecord::Base
validates
:email
,
presence:
true
,
email:
{
strict_mode:
true
},
uniqueness:
true
validates
:bio
,
length:
{
maximum:
255
},
allow_blank:
true
validates
:projects_limit
,
presence:
true
,
numericality:
{
greater_than_or_equal_to:
0
}
validates
:username
,
presence:
true
,
uniqueness:
{
case_sensitive:
false
},
validates
:username
,
presence:
true
,
uniqueness:
{
case_sensitive:
false
},
exclusion:
{
in:
Gitlab
::
Blacklist
.
path
},
format:
{
with:
Gitlab
::
Regex
.
username_regex
,
message:
Gitlab
::
Regex
.
username_regex_message
}
...
...
config/routes.rb
View file @
cc39bca3
...
...
@@ -294,9 +294,7 @@ Gitlab::Application.routes.draw do
member
do
# tree viewer logs
get
'logs_tree'
,
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
}
get
'logs_tree/:path'
=>
'refs#logs_tree'
,
as: :logs_file
,
constraints:
{
get
'logs_tree/:path'
=>
'refs#logs_tree'
,
as: :logs_file
,
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
,
path:
/.*/
}
...
...
lib/gitlab/ldap/adapter.rb
View file @
cc39bca3
...
...
@@ -63,8 +63,10 @@ module Gitlab
end
def
dn_matches_filter?
(
dn
,
filter
)
ldap_search
(
base:
dn
,
filter:
filter
,
scope:
Net
::
LDAP
::
SearchScope_BaseObject
,
attributes:
%w{dn}
).
any?
ldap_search
(
base:
dn
,
filter:
filter
,
scope:
Net
::
LDAP
::
SearchScope_BaseObject
,
attributes:
%w{dn}
).
any?
end
def
ldap_search
(
*
args
)
...
...
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