Sha256: f3c144458b76f70a764a3c9a9d894c4a117b89efa6b2900021ad8fceeb00cb2c

Contents?: true

Size: 663 Bytes

Versions: 5

Compression:

Stored size: 663 Bytes

Contents

require 'hanami/assets'

module Hanami
  module Commands
    class Assets
      class Precompile
        def initialize(options, environment)
          @options     = options
          @environment = environment
        end

        def start
          preload_applications
          precompile
        end

        private

        def preload_applications
          @environment.require_application_environment

          if @environment.container?
            Hanami::Container.new
          else
            Hanami::Application.preload!
          end
        end

        def precompile
          Hanami::Assets.deploy
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hanami-0.8.0 lib/hanami/commands/assets/precompile.rb
hanami-0.7.3 lib/hanami/commands/assets/precompile.rb
hanami-0.7.2 lib/hanami/commands/assets/precompile.rb
hanami-0.7.1 lib/hanami/commands/assets/precompile.rb
hanami-0.7.0 lib/hanami/commands/assets/precompile.rb