Sha256: 4611130f34b6ca4e33510f45161cdeb430f1d57da84b41bf4a90658cd03bc6d6

Contents?: true

Size: 1011 Bytes

Versions: 6

Compression:

Stored size: 1011 Bytes

Contents

require_relative 'config/boot'
require_relative '<%= @app_name %>'

namespace :assets do
  desc "Precompile assets"
  task :precompile do
    manifest = ::Sprockets::Manifest.new(<%= @app_class_name %>.assets.index, "#{<%= @app_class_name %>.public_folder}/assets")
    manifest.compile(<%= @app_class_name %>.assets_manifest)
  end

  desc "Clean assets"
  task :clean do
    FileUtils.rm_rf("#{<%= @app_class_name %>.public_folder}/assets")
  end
end
<% if @with_database %>
namespace :db do
  desc "Run migrations"
  task :migrate, [:version] do |t, args|
    Sequel.extension :migration
    db = Sequel.connect(YAML.load_file("#{Sinator::ROOT}/config/database.yml")[ENV['RACK_ENV']])
    migration_path = "#{Sinator::ROOT}/db/migrations"

    if args[:version]
      puts "Migrating to version #{args[:version]}"
      Sequel::Migrator.run(db, migration_path, target: args[:version].to_i)
    else
      puts "Migrating to latest"
      Sequel::Migrator.run(db, migration_path)
    end
  end
end
<% end -%>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sinator-4.0.0 lib/sinator/templates/Rakefile.erb
sinator-3.1.1 lib/sinator/templates/Rakefile.erb
sinator-3.1.0 lib/sinator/templates/Rakefile.erb
sinator-3.0.4 lib/sinator/templates/Rakefile.erb
sinator-3.0.3 lib/sinator/templates/Rakefile.erb
sinator-3.0.2 lib/sinator/templates/Rakefile.erb