about summary refs log tree commit diff
path: root/lib/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/db.rake14
-rw-r--r--lib/tasks/mastodon.rake6
-rw-r--r--lib/tasks/statistics.rake2
3 files changed, 10 insertions, 12 deletions
diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake
index ca939fd1f..e8a64b8fb 100644
--- a/lib/tasks/db.rake
+++ b/lib/tasks/db.rake
@@ -4,16 +4,14 @@ namespace :db do
   namespace :migrate do
     desc 'Setup the db or migrate depending on state of db'
     task setup: :environment do
-      begin
-        if ActiveRecord::Migrator.current_version.zero?
-          Rake::Task['db:migrate'].invoke
-          Rake::Task['db:seed'].invoke
-        end
-      rescue ActiveRecord::NoDatabaseError
-        Rake::Task['db:setup'].invoke
-      else
+      if ActiveRecord::Migrator.current_version.zero?
         Rake::Task['db:migrate'].invoke
+        Rake::Task['db:seed'].invoke
       end
+    rescue ActiveRecord::NoDatabaseError
+      Rake::Task['db:setup'].invoke
+    else
+      Rake::Task['db:migrate'].invoke
     end
   end
 
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index 1184e5273..179a730bc 100644
--- a/lib/tasks/mastodon.rake
+++ b/lib/tasks/mastodon.rake
@@ -264,7 +264,7 @@ namespace :mastodon do
 
           env['S3_ENDPOINT'] = prompt.ask('Storj DCS endpoint URL:') do |q|
             q.required true
-            q.default "https://gateway.storjshare.io"
+            q.default 'https://gateway.storjshare.io'
             q.modify :strip
           end
 
@@ -286,13 +286,13 @@ namespace :mastodon do
             q.required true
             q.modify :strip
           end
-          
+
           linksharing_access_key = prompt.ask('Storj Linksharing access key (uplink share --register --public --readonly=true --disallow-lists --not-after=none sj://bucket):') do |q|
             q.required true
             q.modify :strip
           end
           env['S3_ALIAS_HOST'] = "link.storjshare.io/raw/#{linksharing_access_key}/#{env['S3_BUCKET']}"
-          
+
         when 'Google Cloud Storage'
           env['S3_ENABLED']             = 'true'
           env['S3_PROTOCOL']            = 'https'
diff --git a/lib/tasks/statistics.rake b/lib/tasks/statistics.rake
index 82f2b5416..440c309ce 100644
--- a/lib/tasks/statistics.rake
+++ b/lib/tasks/statistics.rake
@@ -13,7 +13,7 @@ namespace :mastodon do
       %w(Validators app/validators),
       %w(Workers app/workers),
     ].each do |name, dir|
-      ::STATS_DIRECTORIES << [name, Rails.root.join(dir)]
+      STATS_DIRECTORIES << [name, Rails.root.join(dir)]
     end
   end
 end