diff options
author | Andrey Kumanyaev <me@zzet.org> | 2013-05-05 18:01:10 +0400 |
---|---|---|
committer | Andrey Kumanyaev <me@zzet.org> | 2013-05-05 18:01:10 +0400 |
commit | 67ccc8b52aceebea9c0cb22b3277daf0b467c78e (patch) | |
tree | 6139a7674fe0f9d70a0af51c383fd72aa91cc54c /lib | |
parent | 493b5ff011d5788f669adabf978a40b49b8cf6a3 (diff) | |
download | gitlab-ce-67ccc8b52aceebea9c0cb22b3277daf0b467c78e.tar.gz |
Replace old hashes with new 1.9 ruby hashes (rebase)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/auth.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/popen.rb | 2 | ||||
-rw-r--r-- | lib/tasks/gitlab/backup.rake | 16 | ||||
-rw-r--r-- | lib/tasks/gitlab/bulk_add_permission.rake | 6 | ||||
-rw-r--r-- | lib/tasks/gitlab/cleanup.rake | 4 | ||||
-rw-r--r-- | lib/tasks/gitlab/import.rake | 4 | ||||
-rw-r--r-- | lib/tasks/gitlab/setup.rake | 2 | ||||
-rw-r--r-- | lib/tasks/gitlab/test.rake | 2 | ||||
-rw-r--r-- | lib/tasks/travis.rake | 2 |
9 files changed, 21 insertions, 21 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb index 0fee33dbeb0..78d2196fbbe 100644 --- a/lib/gitlab/auth.rb +++ b/lib/gitlab/auth.rb @@ -10,7 +10,7 @@ module Gitlab @user elsif @user = User.find_by_email(email) log.info "Updating legacy LDAP user #{email} with extern_uid => #{uid}" - @user.update_attributes(:extern_uid => uid, :provider => provider) + @user.update_attributes(extern_uid: uid, provider: provider) @user else create_from_omniauth(auth, true) @@ -57,7 +57,7 @@ module Gitlab if @user = User.find_by_provider_and_extern_uid(provider, uid) @user elsif @user = User.find_by_email(email) - @user.update_attributes(:extern_uid => uid, :provider => provider) + @user.update_attributes(extern_uid: uid, provider: provider) @user else if Gitlab.config.omniauth['allow_single_sign_on'] diff --git a/lib/gitlab/popen.rb b/lib/gitlab/popen.rb index f2cfd8073e3..2f30fde2078 100644 --- a/lib/gitlab/popen.rb +++ b/lib/gitlab/popen.rb @@ -2,7 +2,7 @@ module Gitlab module Popen def popen(cmd, path) vars = { "PWD" => path } - options = { :chdir => path } + options = { chdir: path } @cmd_output = "" @cmd_status = 0 diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake index 9f28de593e9..0c791926c41 100644 --- a/lib/tasks/gitlab/backup.rake +++ b/lib/tasks/gitlab/backup.rake @@ -4,7 +4,7 @@ namespace :gitlab do namespace :backup do # Create backup of GitLab system desc "GITLAB | Create a backup of the GitLab system" - task :create => :environment do + task create: :environment do warn_user_is_not_gitlab Rake::Task["gitlab:backup:db:create"].invoke @@ -57,7 +57,7 @@ namespace :gitlab do # Restore backup of GitLab system desc "GITLAB | Restore a previously created backup" - task :restore => :environment do + task restore: :environment do warn_user_is_not_gitlab Dir.chdir(Gitlab.config.backup.path) @@ -113,13 +113,13 @@ namespace :gitlab do end namespace :repo do - task :create => :environment do + task create: :environment do puts "Dumping repositories ...".blue Backup::Repository.new.dump puts "done".green end - task :restore => :environment do + task restore: :environment do puts "Restoring repositories ...".blue Backup::Repository.new.restore puts "done".green @@ -127,13 +127,13 @@ namespace :gitlab do end namespace :db do - task :create => :environment do + task create: :environment do puts "Dumping database ... ".blue Backup::Database.new.dump puts "done".green end - task :restore => :environment do + task restore: :environment do puts "Restoring database ... ".blue Backup::Database.new.restore puts "done".green @@ -141,13 +141,13 @@ namespace :gitlab do end namespace :uploads do - task :create => :environment do + task create: :environment do puts "Dumping uploads ... ".blue Backup::Uploads.new.dump puts "done".green end - task :restore => :environment do + task restore: :environment do puts "Restoring uploads ... ".blue Backup::Uploads.new.restore puts "done".green diff --git a/lib/tasks/gitlab/bulk_add_permission.rake b/lib/tasks/gitlab/bulk_add_permission.rake index eb1a7559dbd..d8e231645a8 100644 --- a/lib/tasks/gitlab/bulk_add_permission.rake +++ b/lib/tasks/gitlab/bulk_add_permission.rake @@ -1,9 +1,9 @@ namespace :gitlab do namespace :import do desc "GITLAB | Add all users to all projects (admin users are added as masters)" - task :all_users_to_all_projects => :environment do |t, args| - user_ids = User.where(:admin => false).pluck(:id) - admin_ids = User.where(:admin => true).pluck(:id) + task all_users_to_all_projects: :environment do |t, args| + user_ids = User.where(admin: false).pluck(:id) + admin_ids = User.where(admin: true).pluck(:id) projects_ids = Project.pluck(:id) puts "Importing #{user_ids.size} users into #{projects_ids.size} projects" diff --git a/lib/tasks/gitlab/cleanup.rake b/lib/tasks/gitlab/cleanup.rake index d8ee56e5523..186abc65563 100644 --- a/lib/tasks/gitlab/cleanup.rake +++ b/lib/tasks/gitlab/cleanup.rake @@ -1,7 +1,7 @@ namespace :gitlab do namespace :cleanup do desc "GITLAB | Cleanup | Clean namespaces" - task :dirs => :environment do + task dirs: :environment do warn_user_is_not_gitlab remove_flag = ENV['REMOVE'] @@ -44,7 +44,7 @@ namespace :gitlab do end desc "GITLAB | Cleanup | Clean respositories" - task :repos => :environment do + task repos: :environment do warn_user_is_not_gitlab remove_flag = ENV['REMOVE'] diff --git a/lib/tasks/gitlab/import.rake b/lib/tasks/gitlab/import.rake index bddbd7ef855..acf6abedd19 100644 --- a/lib/tasks/gitlab/import.rake +++ b/lib/tasks/gitlab/import.rake @@ -10,7 +10,7 @@ namespace :gitlab do # * existing projects will be skipped # desc "GITLAB | Import bare repositories from git_host -> base_path into GitLab project instance" - task :repos => :environment do + task repos: :environment do git_base_path = Gitlab.config.gitlab_shell.repos_path repos_to_import = Dir.glob(git_base_path + '/*') @@ -40,7 +40,7 @@ namespace :gitlab do user = User.admins.first project_params = { - :name => path, + name: path, } project = Projects::CreateContext.new(user, project_params).execute diff --git a/lib/tasks/gitlab/setup.rake b/lib/tasks/gitlab/setup.rake index 5b74daf956e..2b730774e06 100644 --- a/lib/tasks/gitlab/setup.rake +++ b/lib/tasks/gitlab/setup.rake @@ -1,6 +1,6 @@ namespace :gitlab do desc "GITLAB | Setup production application" - task :setup => :environment do + task setup: :environment do setup_db end diff --git a/lib/tasks/gitlab/test.rake b/lib/tasks/gitlab/test.rake index ad1bfb2e4b3..03b3fc5ea20 100644 --- a/lib/tasks/gitlab/test.rake +++ b/lib/tasks/gitlab/test.rake @@ -1,4 +1,4 @@ namespace :gitlab do desc "GITLAB | Run both spinach and rspec" - task :test => ['spinach', 'spec'] + task test: ['spinach', 'spec'] end diff --git a/lib/tasks/travis.rake b/lib/tasks/travis.rake index 6b434830803..bc1b8aadbc5 100644 --- a/lib/tasks/travis.rake +++ b/lib/tasks/travis.rake @@ -1,5 +1,5 @@ desc "Travis run tests" -task :travis => [ +task travis: [ :spinach, :spec ] |