Sha256: d8f2925c55162a8b71913d9ae47d5bb154712e42a1dae76373d9dbf0f5a2e3c3

Contents?: true

Size: 1.37 KB

Versions: 14

Compression:

Stored size: 1.37 KB

Contents

# require this file to load the tasks
require 'rake'

# Require sitemap_generator at runtime. If we don't do this the ActionView helpers are included
# before the Rails environment can be loaded by other Rake tasks, which causes problems
# for those tasks when rendering using ActionView.
namespace :settings do
  # Require sitemap_generator only. When installed as a plugin the require will fail, so in
  # that case, load the environment first.
  task :require do
    Rake::Task['environment'].invoke
  end

  desc "Dump settings to config/settings.yml; use rake settings:dump[production] to create env-specific template".freeze
  task :dump, [:as_env] => ['settings:require'] do |t, args|
    if args.empty? || args[:as_env].blank?
      path = Settings.root_file_path.join('config/settings.yml')
    else
      path = Settings.root_file_path.join("config/settings.#{args[:as_env]}.yml")
    end
    RailsAdminSettings::Dumper.dump(path)
    puts "dumped settings to #{path}"
  end

  desc "Load settings from config/settings.yml without overwriting current values".freeze
  task :load => ['settings:require'] do
    Settings.apply_defaults!(Rails.root.join("config/settings.#{Rails.env.to_s}.yml"), true)
    Settings.apply_defaults!(Rails.root.join('config/settings.yml'), true)
  end

  desc "Delete all settings".freeze
  task :delete => ['settings:require'] do
    Settings.destroy_all!
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ack_rails_admin_settings-1.2.3.3 lib/rails_admin_settings/tasks.rb
ack_rails_admin_settings-1.2.3.2 lib/rails_admin_settings/tasks.rb
ack_rails_admin_settings-1.2.3.1 lib/rails_admin_settings/tasks.rb
ack_rails_admin_settings-1.2.3 lib/rails_admin_settings/tasks.rb
ack_rails_admin_settings-1.2.2.1 lib/rails_admin_settings/tasks.rb
ack_rails_admin_settings-1.2.2 lib/rails_admin_settings/tasks.rb
ack_rails_admin_settings-1.2.1.3 lib/rails_admin_settings/tasks.rb
ack_rails_admin_settings-1.2.1.2 lib/rails_admin_settings/tasks.rb
ack_rails_admin_settings-1.2.1.1 lib/rails_admin_settings/tasks.rb
ack_rails_admin_settings-1.2.1 lib/rails_admin_settings/tasks.rb
ack_rails_admin_settings-1.2.0.2 lib/rails_admin_settings/tasks.rb
ack_rails_admin_settings-1.2.0.1 lib/rails_admin_settings/tasks.rb
ack_rails_admin_settings-1.1.5 lib/rails_admin_settings/tasks.rb
ack_rails_admin_settings-1.1.4 lib/rails_admin_settings/tasks.rb