Sha256: f9532f6d57576e395b5e6c3bf5014c81b52ad44c8cc15cc64f3d13470108a6af
Contents?: true
Size: 899 Bytes
Versions: 6
Compression:
Stored size: 899 Bytes
Contents
require_relative 'config/boot' require_relative 'my_app' namespace :assets do desc "Precompile assets" task :precompile do manifest = ::Sprockets::Manifest.new(MyApp.assets.index, "#{MyApp.public_folder}/assets") manifest.compile(MyApp.assets_manifest) end desc "Clean assets" task :clean do FileUtils.rm_rf("#{MyApp.public_folder}/assets") end end 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
Version data entries
6 entries across 6 versions & 1 rubygems