Sha256: 185f9fb4d39f6939db97c578d5cd6660a532b4bb7b05177b2b6ff50d205b81d0

Contents?: true

Size: 962 Bytes

Versions: 18

Compression:

Stored size: 962 Bytes

Contents

module Hanami
  class CLI
    module Commands
      module Assets
        # @since 1.1.0
        # @api private
        class Precompile < Command
          requires "apps.assets.configurations"

          desc "Precompile assets for deployment"

          example [
            "                      # Basic usage",
            "HANAMI_ENV=production # Precompile assets for production environment"
          ]

          # @since 1.1.0
          # @api private
          def call(**options)
            context = Context.new(options: options)

            precompile_assets(context)
          end

          private

          # @since 1.1.0
          # @api private
          def precompile_assets(*)
            Hanami::Assets.precompile(configurations)
          end

          # @since 1.1.0
          # @api private
          def configurations
            requirements['apps.assets.configurations']
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
hanami-1.3.5 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.3.4 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.3.3 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.3.2 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.3.1 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.3.0 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.3.0.beta1 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.2.0 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.2.0.rc2 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.2.0.rc1 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.2.0.beta2 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.2.0.beta1 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.1.1 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.1.0 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.1.0.rc1 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.1.0.beta3 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.1.0.beta2 lib/hanami/cli/commands/assets/precompile.rb
hanami-1.1.0.beta1 lib/hanami/cli/commands/assets/precompile.rb