diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-23 09:27:36 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 09:33:20 -0600 |
commit | f88ff0cc0c5c1db7089a5f0062a53d38eb27ebde (patch) | |
tree | 54f1501e16405636d62bf7e1af83a8b34d54951b /lib/tasks | |
parent | 6f5cd03fcb63b379d218cf0b475f85f675dd9fb6 (diff) | |
download | gitlab-ce-f88ff0cc0c5c1db7089a5f0062a53d38eb27ebde.tar.gz |
Stylistic tweaks
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gemojione.rake | 6 | ||||
-rw-r--r-- | lib/tasks/gitlab/task_helpers.rb | 15 |
2 files changed, 13 insertions, 8 deletions
diff --git a/lib/tasks/gemojione.rake b/lib/tasks/gemojione.rake index f5ff29415e8..993112aee3b 100644 --- a/lib/tasks/gemojione.rake +++ b/lib/tasks/gemojione.rake @@ -81,9 +81,9 @@ namespace :gemojione do # SpriteFactory's SCSS is a bit too verbose for our purposes here, so # let's simplify it - system(%(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(%(sed -i '' "s/ 0px/ 0/" #{style_path})) + system(%Q(sed -i '' "s/width: #{SIZE}px; height: #{SIZE}px; background: image-url('emoji.png')/background-position:/" #{style_path})) + system(%Q(sed -i '' "s/ no-repeat//" #{style_path})) + system(%Q(sed -i '' "s/ 0px/ 0/" #{style_path})) # Append a generic rule that applies to all Emojis File.open(style_path, 'a') do |f| diff --git a/lib/tasks/gitlab/task_helpers.rb b/lib/tasks/gitlab/task_helpers.rb index e5de3e22165..2a999ad6959 100644 --- a/lib/tasks/gitlab/task_helpers.rb +++ b/lib/tasks/gitlab/task_helpers.rb @@ -20,14 +20,19 @@ module Gitlab # It has fallbacks to Debian, SuSE, OS X and systems running systemd. def os_name 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 ||= - 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}" + elsif File.readable?('/etc/os-release') + File.read('/etc/os-release').match(/PRETTY_NAME=\"(.+)\"/)[1] end - os_name ||= File.read('/etc/os-release').match(/PRETTY_NAME=\"(.+)\"/)[1] if File.readable?('/etc/os-release') + os_name.try(:squish!) end |