Sha256: 2f9abc605e508405eae397606877e8c889c3aec923425ea7d750dd9d3ba599cd

Contents?: true

Size: 453 Bytes

Versions: 2

Compression:

Stored size: 453 Bytes

Contents

require "hanami/cli/commands"

module Hanami
  class CLI
    Commands.module_eval do
      class Run < Hanami::CLI::Command
        desc "Executes ruby code in a Hanami environment"
        argument :code, required: true, desc: "The code to be executed"

        def call(code:)
          require_relative Pathname.pwd.join("config/environment")
          Hanami.boot
          eval(code)
        end
      end
    end

    register "run", Run
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hanami-runner-0.6.0 lib/hanami-runner.rb
hanami-runner-0.5.0 lib/hanami-runner.rb