Sha256: 972194fb62693341c32279adf2ea195aa8d91b5fc1fa626b3d9e3b99486ae7c5

Contents?: true

Size: 1.41 KB

Versions: 5

Compression:

Stored size: 1.41 KB

Contents

# frozen_string_literal: true

require "hanami/cli"

Hanami::CLI::RakeTasks.register_tasks do
  desc "Load the app environment"
  task :environment do
    require "hanami/prepare"
  end

  # Ruby ecosystem compatibility
  #
  # Most of the hosting SaaS automatic tasks are designed after Ruby on Rails.
  # They expect the following Rake tasks to be present:
  #
  #   * db:migrate
  #   * assets:precompile
  #
  # See https://github.com/heroku/heroku-buildpack-ruby/issues/442
  #
  # ===
  #
  # These Rake tasks are **NOT** listed when someone runs `rake -T`, because we
  # want to encourage developers to use `hanami` CLI commands.
  #
  # In order to migrate the database or compile assets a developer should use:
  #
  #   * hanami db migrate
  #   * hanami assets compile
  #
  # This is the preferred way to run Hanami command line tasks.
  # Please use them when you're in control of your deployment environment.
  #
  # If you're not in control and your deployment requires these "standard"
  # Rake tasks, they are here only to solve this specific problem.

  if Hanami.bundled?("hanami-db")
    namespace :db do
      task :migrate do
        Hanami::CLI::Commands::App::DB::Migrate.new.call
      end
    end
  end

  if Hanami.bundled?("hanami-assets")
    namespace :assets do
      task :precompile do
        Hanami::CLI::Commands::App::Assets::Compile.new.call
      end
    end
  end
end

Hanami::CLI::RakeTasks.install_tasks

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hanami-2.2.1 lib/hanami/rake_tasks.rb
hanami-2.2.0 lib/hanami/rake_tasks.rb
hanami-2.2.0.rc1 lib/hanami/rake_tasks.rb
hanami-2.2.0.beta2 lib/hanami/rake_tasks.rb
hanami-2.2.0.beta1 lib/hanami/rake_tasks.rb