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
Hide 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:
...
@@ -23,7 +23,7 @@ Style/AlignHash:
Description
:
>-
Description
:
>-
Align the elements of a hash literal if they span more than
Align the elements of a hash literal if they span more than
one line.
one line.
Enabled
:
fals
e
Enabled
:
tru
e
Style/AlignParameters
:
Style/AlignParameters
:
Description
:
>-
Description
:
>-
...
...
app/controllers/projects/blob_controller.rb
View file @
cc39bca3
...
@@ -59,8 +59,7 @@ class Projects::BlobController < Projects::ApplicationController
...
@@ -59,8 +59,7 @@ class Projects::BlobController < Projects::ApplicationController
def
preview
def
preview
@content
=
params
[
:content
]
@content
=
params
[
:content
]
diffy
=
Diffy
::
Diff
.
new
(
@blob
.
data
,
@content
,
diff:
'-U 3'
,
diffy
=
Diffy
::
Diff
.
new
(
@blob
.
data
,
@content
,
diff:
'-U 3'
,
include_diff_info:
true
)
include_diff_info:
true
)
@diff_lines
=
Gitlab
::
Diff
::
Parser
.
new
.
parse
(
diffy
.
diff
.
scan
(
/.*\n/
))
@diff_lines
=
Gitlab
::
Diff
::
Parser
.
new
.
parse
(
diffy
.
diff
.
scan
(
/.*\n/
))
render
layout:
false
render
layout:
false
...
...
app/helpers/application_helper.rb
View file @
cc39bca3
...
@@ -75,9 +75,9 @@ module ApplicationHelper
...
@@ -75,9 +75,9 @@ module ApplicationHelper
options
[
:class
]
||=
''
options
[
:class
]
||=
''
options
[
:class
]
<<
' identicon'
options
[
:class
]
<<
' identicon'
bg_key
=
project
.
id
%
7
bg_key
=
project
.
id
%
7
style
=
"background-color: #
#{
allowed_colors
.
values
[
bg_key
]
}
; color: #555"
content_tag
(
:div
,
class:
options
[
:class
],
content_tag
(
:div
,
class:
options
[
:class
],
style:
style
)
do
style:
"background-color: #
#{
allowed_colors
.
values
[
bg_key
]
}
; color: #555"
)
do
project
.
name
[
0
,
1
].
upcase
project
.
name
[
0
,
1
].
upcase
end
end
end
end
...
...
app/models/application_setting.rb
View file @
cc39bca3
...
@@ -14,7 +14,8 @@
...
@@ -14,7 +14,8 @@
#
#
class
ApplicationSetting
<
ActiveRecord
::
Base
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"
},
format:
{
with:
URI
::
regexp
(
%w(http https)
),
message:
"should be a valid url"
},
if: :home_page_url_column_exist
if: :home_page_url_column_exist
...
...
app/models/namespace.rb
View file @
cc39bca3
...
@@ -20,15 +20,20 @@ class Namespace < ActiveRecord::Base
...
@@ -20,15 +20,20 @@ class Namespace < ActiveRecord::Base
belongs_to
:owner
,
class_name:
"User"
belongs_to
:owner
,
class_name:
"User"
validates
:owner
,
presence:
true
,
unless:
->
(
n
)
{
n
.
type
==
"Group"
}
validates
:owner
,
presence:
true
,
unless:
->
(
n
)
{
n
.
type
==
"Group"
}
validates
:name
,
presence:
true
,
uniqueness:
true
,
validates
:name
,
length:
{
within:
0
..
255
},
presence:
true
,
uniqueness:
true
,
format:
{
with:
Gitlab
::
Regex
.
name_regex
,
length:
{
within:
0
..
255
},
message:
Gitlab
::
Regex
.
name_regex_message
}
format:
{
with:
Gitlab
::
Regex
.
name_regex
,
message:
Gitlab
::
Regex
.
name_regex_message
}
validates
:description
,
length:
{
within:
0
..
255
}
validates
:description
,
length:
{
within:
0
..
255
}
validates
:path
,
uniqueness:
{
case_sensitive:
false
},
presence:
true
,
length:
{
within:
1
..
255
},
validates
:path
,
exclusion:
{
in:
Gitlab
::
Blacklist
.
path
},
uniqueness:
{
case_sensitive:
false
},
format:
{
with:
Gitlab
::
Regex
.
path_regex
,
presence:
true
,
message:
Gitlab
::
Regex
.
path_regex_message
}
length:
{
within:
1
..
255
},
exclusion:
{
in:
Gitlab
::
Blacklist
.
path
},
format:
{
with:
Gitlab
::
Regex
.
path_regex
,
message:
Gitlab
::
Regex
.
path_regex_message
}
delegate
:name
,
to: :owner
,
allow_nil:
true
,
prefix:
true
delegate
:name
,
to: :owner
,
allow_nil:
true
,
prefix:
true
...
...
app/models/project.rb
View file @
cc39bca3
...
@@ -108,13 +108,17 @@ class Project < ActiveRecord::Base
...
@@ -108,13 +108,17 @@ class Project < ActiveRecord::Base
# Validations
# Validations
validates
:creator
,
presence:
true
,
on: :create
validates
:creator
,
presence:
true
,
on: :create
validates
:description
,
length:
{
maximum:
2000
},
allow_blank:
true
validates
:description
,
length:
{
maximum:
2000
},
allow_blank:
true
validates
:name
,
presence:
true
,
length:
{
within:
0
..
255
},
validates
:name
,
format:
{
with:
Gitlab
::
Regex
.
project_name_regex
,
presence:
true
,
message:
Gitlab
::
Regex
.
project_regex_message
}
length:
{
within:
0
..
255
},
validates
:path
,
presence:
true
,
length:
{
within:
0
..
255
},
format:
{
with:
Gitlab
::
Regex
.
project_name_regex
,
exclusion:
{
in:
Gitlab
::
Blacklist
.
path
},
message:
Gitlab
::
Regex
.
project_regex_message
}
format:
{
with:
Gitlab
::
Regex
.
path_regex
,
validates
:path
,
message:
Gitlab
::
Regex
.
path_regex_message
}
presence:
true
,
length:
{
within:
0
..
255
},
exclusion:
{
in:
Gitlab
::
Blacklist
.
path
},
format:
{
with:
Gitlab
::
Regex
.
path_regex
,
message:
Gitlab
::
Regex
.
path_regex_message
}
validates
:issues_enabled
,
:merge_requests_enabled
,
validates
:issues_enabled
,
:merge_requests_enabled
,
:wiki_enabled
,
inclusion:
{
in:
[
true
,
false
]
}
:wiki_enabled
,
inclusion:
{
in:
[
true
,
false
]
}
validates
:visibility_level
,
validates
:visibility_level
,
...
...
app/models/project_services/bamboo_service.rb
View file @
cc39bca3
...
@@ -17,13 +17,19 @@ class BambooService < CiService
...
@@ -17,13 +17,19 @@ class BambooService < CiService
prop_accessor
:bamboo_url
,
:build_key
,
:username
,
:password
prop_accessor
:bamboo_url
,
:build_key
,
:username
,
:password
validates
:bamboo_url
,
presence:
true
,
validates
:bamboo_url
,
format:
{
with:
URI
::
regexp
},
if: :activated?
presence:
true
,
format:
{
with:
URI
::
regexp
},
if: :activated?
validates
:build_key
,
presence:
true
,
if: :activated?
validates
:build_key
,
presence:
true
,
if: :activated?
validates
:username
,
presence:
true
,
validates
:username
,
if:
->
(
service
)
{
service
.
password?
},
if: :activated?
presence:
true
,
validates
:password
,
presence:
true
,
if:
->
(
service
)
{
service
.
password?
},
if:
->
(
service
)
{
service
.
username?
},
if: :activated?
if: :activated?
validates
:password
,
presence:
true
,
if:
->
(
service
)
{
service
.
username?
},
if: :activated?
attr_accessor
:response
attr_accessor
:response
...
...
app/models/project_services/teamcity_service.rb
View file @
cc39bca3
...
@@ -17,13 +17,16 @@ class TeamcityService < CiService
...
@@ -17,13 +17,16 @@ class TeamcityService < CiService
prop_accessor
:teamcity_url
,
:build_type
,
:username
,
:password
prop_accessor
:teamcity_url
,
:build_type
,
:username
,
:password
validates
:teamcity_url
,
presence:
true
,
validates
:teamcity_url
,
format:
{
with:
URI
::
regexp
},
if: :activated?
presence:
true
,
format:
{
with:
URI
::
regexp
},
if: :activated?
validates
:build_type
,
presence:
true
,
if: :activated?
validates
:build_type
,
presence:
true
,
if: :activated?
validates
:username
,
presence:
true
,
validates
:username
,
if:
->
(
service
)
{
service
.
password?
},
if: :activated?
presence:
true
,
validates
:password
,
presence:
true
,
if:
->
(
service
)
{
service
.
password?
},
if: :activated?
if:
->
(
service
)
{
service
.
username?
},
if: :activated?
validates
:password
,
presence:
true
,
if:
->
(
service
)
{
service
.
username?
},
if: :activated?
attr_accessor
:response
attr_accessor
:response
...
...
app/models/snippet.rb
View file @
cc39bca3
...
@@ -29,9 +29,11 @@ class Snippet < ActiveRecord::Base
...
@@ -29,9 +29,11 @@ class Snippet < ActiveRecord::Base
validates
:author
,
presence:
true
validates
:author
,
presence:
true
validates
:title
,
presence:
true
,
length:
{
within:
0
..
255
}
validates
:title
,
presence:
true
,
length:
{
within:
0
..
255
}
validates
:file_name
,
presence:
true
,
length:
{
within:
0
..
255
},
validates
:file_name
,
format:
{
with:
Gitlab
::
Regex
.
path_regex
,
presence:
true
,
message:
Gitlab
::
Regex
.
path_regex_message
}
length:
{
within:
0
..
255
},
format:
{
with:
Gitlab
::
Regex
.
path_regex
,
message:
Gitlab
::
Regex
.
path_regex_message
}
validates
:content
,
presence:
true
validates
:content
,
presence:
true
validates
:visibility_level
,
inclusion:
{
in:
Gitlab
::
VisibilityLevel
.
values
}
validates
:visibility_level
,
inclusion:
{
in:
Gitlab
::
VisibilityLevel
.
values
}
...
...
app/models/user.rb
View file @
cc39bca3
...
@@ -116,10 +116,12 @@ class User < ActiveRecord::Base
...
@@ -116,10 +116,12 @@ class User < ActiveRecord::Base
validates
:email
,
presence:
true
,
email:
{
strict_mode:
true
},
uniqueness:
true
validates
:email
,
presence:
true
,
email:
{
strict_mode:
true
},
uniqueness:
true
validates
:bio
,
length:
{
maximum:
255
},
allow_blank:
true
validates
:bio
,
length:
{
maximum:
255
},
allow_blank:
true
validates
:projects_limit
,
presence:
true
,
numericality:
{
greater_than_or_equal_to:
0
}
validates
:projects_limit
,
presence:
true
,
numericality:
{
greater_than_or_equal_to:
0
}
validates
:username
,
presence:
true
,
uniqueness:
{
case_sensitive:
false
},
validates
:username
,
exclusion:
{
in:
Gitlab
::
Blacklist
.
path
},
presence:
true
,
format:
{
with:
Gitlab
::
Regex
.
username_regex
,
uniqueness:
{
case_sensitive:
false
},
message:
Gitlab
::
Regex
.
username_regex_message
}
exclusion:
{
in:
Gitlab
::
Blacklist
.
path
},
format:
{
with:
Gitlab
::
Regex
.
username_regex
,
message:
Gitlab
::
Regex
.
username_regex_message
}
validates
:notification_level
,
inclusion:
{
in:
Notification
.
notification_levels
},
presence:
true
validates
:notification_level
,
inclusion:
{
in:
Notification
.
notification_levels
},
presence:
true
validate
:namespace_uniq
,
if:
->
(
user
)
{
user
.
username_changed?
}
validate
:namespace_uniq
,
if:
->
(
user
)
{
user
.
username_changed?
}
...
...
config/routes.rb
View file @
cc39bca3
...
@@ -294,12 +294,10 @@ Gitlab::Application.routes.draw do
...
@@ -294,12 +294,10 @@ Gitlab::Application.routes.draw do
member
do
member
do
# tree viewer logs
# tree viewer logs
get
'logs_tree'
,
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
}
get
'logs_tree'
,
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
}
get
'logs_tree/:path'
=>
'refs#logs_tree'
,
get
'logs_tree/:path'
=>
'refs#logs_tree'
,
as: :logs_file
,
constraints:
{
as: :logs_file
,
id:
Gitlab
::
Regex
.
git_reference_regex
,
constraints:
{
path:
/.*/
id:
Gitlab
::
Regex
.
git_reference_regex
,
}
path:
/.*/
}
end
end
end
end
...
...
lib/gitlab/ldap/adapter.rb
View file @
cc39bca3
...
@@ -63,8 +63,10 @@ module Gitlab
...
@@ -63,8 +63,10 @@ module Gitlab
end
end
def
dn_matches_filter?
(
dn
,
filter
)
def
dn_matches_filter?
(
dn
,
filter
)
ldap_search
(
base:
dn
,
filter:
filter
,
ldap_search
(
base:
dn
,
scope:
Net
::
LDAP
::
SearchScope_BaseObject
,
attributes:
%w{dn}
).
any?
filter:
filter
,
scope:
Net
::
LDAP
::
SearchScope_BaseObject
,
attributes:
%w{dn}
).
any?
end
end
def
ldap_search
(
*
args
)
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