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
f88ff0cc
Commit
f88ff0cc
authored
Feb 23, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stylistic tweaks
parent
6f5cd03f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
21 deletions
+21
-21
lib/extracts_path.rb
lib/extracts_path.rb
+1
-1
lib/gitlab/ci/build/artifacts/metadata/entry.rb
lib/gitlab/ci/build/artifacts/metadata/entry.rb
+2
-2
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+4
-4
lib/gitlab/redis.rb
lib/gitlab/redis.rb
+1
-6
lib/tasks/gemojione.rake
lib/tasks/gemojione.rake
+3
-3
lib/tasks/gitlab/task_helpers.rb
lib/tasks/gitlab/task_helpers.rb
+10
-5
No files found.
lib/extracts_path.rb
View file @
f88ff0cc
...
@@ -42,7 +42,7 @@ module ExtractsPath
...
@@ -42,7 +42,7 @@ module ExtractsPath
return
pair
unless
@project
return
pair
unless
@project
if
id
=~
/^(
[[:alnum:]]
{40})(.+)/
if
id
=~
/^(
\h
{40})(.+)/
# If the ref appears to be a SHA, we're done, just split the string
# If the ref appears to be a SHA, we're done, just split the string
pair
=
$~
.
captures
pair
=
$~
.
captures
else
else
...
...
lib/gitlab/ci/build/artifacts/metadata/entry.rb
View file @
f88ff0cc
...
@@ -27,6 +27,8 @@ module Gitlab
...
@@ -27,6 +27,8 @@ module Gitlab
end
end
end
end
delegate
:empty?
,
to: :children
def
directory?
def
directory?
blank_node?
||
@path
.
end_with?
(
'/'
)
blank_node?
||
@path
.
end_with?
(
'/'
)
end
end
...
@@ -91,8 +93,6 @@ module Gitlab
...
@@ -91,8 +93,6 @@ module Gitlab
blank_node?
||
@entries
.
include?
(
@path
)
blank_node?
||
@entries
.
include?
(
@path
)
end
end
delegate
:empty?
,
to: :children
def
total_size
def
total_size
descendant_pattern
=
%r{^
#{
Regexp
.
escape
(
@path
)
}
}
descendant_pattern
=
%r{^
#{
Regexp
.
escape
(
@path
)
}
}
entries
.
sum
do
|
path
,
entry
|
entries
.
sum
do
|
path
,
entry
|
...
...
lib/gitlab/git/repository.rb
View file @
f88ff0cc
...
@@ -31,6 +31,10 @@ module Gitlab
...
@@ -31,6 +31,10 @@ module Gitlab
@attributes
=
Gitlab
::
Git
::
Attributes
.
new
(
path
)
@attributes
=
Gitlab
::
Git
::
Attributes
.
new
(
path
)
end
end
delegate
:empty?
,
:bare?
,
to: :rugged
# Default branch in the repository
# Default branch in the repository
def
root_ref
def
root_ref
@root_ref
||=
discover_default_branch
@root_ref
||=
discover_default_branch
...
@@ -160,10 +164,6 @@ module Gitlab
...
@@ -160,10 +164,6 @@ module Gitlab
!
empty?
!
empty?
end
end
delegate
:empty?
,
:bare?
,
to: :rugged
def
repo_exists?
def
repo_exists?
!!
rugged
!!
rugged
end
end
...
...
lib/gitlab/redis.rb
View file @
f88ff0cc
...
@@ -12,12 +12,7 @@ module Gitlab
...
@@ -12,12 +12,7 @@ module Gitlab
CONFIG_FILE
=
File
.
expand_path
(
'../../config/resque.yml'
,
__dir__
)
CONFIG_FILE
=
File
.
expand_path
(
'../../config/resque.yml'
,
__dir__
)
class
<<
self
class
<<
self
# Do NOT cache in an instance variable. Result may be mutated by caller.
delegate
:params
,
:url
,
to: :new
delegate
:params
,
to: :new
# Do NOT cache in an instance variable. Result may be mutated by caller.
# @deprecated Use .params instead to get sentinel support
delegate
:url
,
to: :new
def
with
def
with
@pool
||=
ConnectionPool
.
new
(
size:
pool_size
)
{
::
Redis
.
new
(
params
)
}
@pool
||=
ConnectionPool
.
new
(
size:
pool_size
)
{
::
Redis
.
new
(
params
)
}
...
...
lib/tasks/gemojione.rake
View file @
f88ff0cc
...
@@ -81,9 +81,9 @@ namespace :gemojione do
...
@@ -81,9 +81,9 @@ namespace :gemojione do
# SpriteFactory's SCSS is a bit too verbose for our purposes here, so
# SpriteFactory's SCSS is a bit too verbose for our purposes here, so
# let's simplify it
# let's simplify it
system
(
%(sed -i '' "s/width: #{SIZE}px; height: #{SIZE}px; background: image-url('emoji.png')/background-position:/" #{style_path})
)
system
(
%
Q
(sed -i '' "s/width:
#{
SIZE
}
px; height:
#{
SIZE
}
px; background: image-url('emoji.png')/background-position:/"
#{
style_path
}
)
)
system
(
%(sed -i '' "s/ no-repeat//" #{style_path})
)
system
(
%
Q
(sed -i '' "s/ no-repeat//"
#{
style_path
}
)
)
system
(
%(sed -i '' "s/ 0px/ 0/" #{style_path})
)
system
(
%
Q
(sed -i '' "s/ 0px/ 0/"
#{
style_path
}
)
)
# Append a generic rule that applies to all Emojis
# Append a generic rule that applies to all Emojis
File
.
open
(
style_path
,
'a'
)
do
|
f
|
File
.
open
(
style_path
,
'a'
)
do
|
f
|
...
...
lib/tasks/gitlab/task_helpers.rb
View file @
f88ff0cc
...
@@ -20,14 +20,19 @@ module Gitlab
...
@@ -20,14 +20,19 @@ module Gitlab
# It has fallbacks to Debian, SuSE, OS X and systems running systemd.
# It has fallbacks to Debian, SuSE, OS X and systems running systemd.
def
os_name
def
os_name
os_name
=
run_command
(
%w(lsb_release -irs)
)
os_name
=
run_command
(
%w(lsb_release -irs)
)
os_name
||=
File
.
read
(
'/etc/system-release'
)
if
File
.
readable?
(
'/etc/system-release'
)
os_name
||=
"Debian
#{
File
.
read
(
'/etc/debian_version'
)
}
"
if
File
.
readable?
(
'/etc/debian_version'
)
os_name
||=
File
.
read
(
'/etc/SuSE-release'
)
if
File
.
readable?
(
'/etc/SuSE-release'
)
os_name
||=
os_name
||=
if
os_x_version
=
run_command
(
%w(sw_vers -productVersion)
)
if
File
.
readable?
(
'/etc/system-release'
)
File
.
read
(
'/etc/system-release'
)
elsif
File
.
readable?
(
'/etc/debian_version'
)
"Debian
#{
File
.
read
(
'/etc/debian_version'
)
}
"
elsif
File
.
readable?
(
'/etc/SuSE-release'
)
File
.
read
(
'/etc/SuSE-release'
)
elsif
os_x_version
=
run_command
(
%w(sw_vers -productVersion)
)
"Mac OS X
#{
os_x_version
}
"
"Mac OS X
#{
os_x_version
}
"
elsif
File
.
readable?
(
'/etc/os-release'
)
File
.
read
(
'/etc/os-release'
).
match
(
/PRETTY_NAME=\"(.+)\"/
)[
1
]
end
end
os_name
||=
File
.
read
(
'/etc/os-release'
).
match
(
/PRETTY_NAME=\"(.+)\"/
)[
1
]
if
File
.
readable?
(
'/etc/os-release'
)
os_name
.
try
(
:squish!
)
os_name
.
try
(
:squish!
)
end
end
...
...
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