Sha256: 9f615cbcdc9dcab39a41d965b7c183eb52f1f1d1949b86cb5cfa2416d4217bdc

Contents?: true

Size: 741 Bytes

Versions: 1

Compression:

Stored size: 741 Bytes

Contents

# frozen_string_literal: true

module Enroute
  class CLI < Thor
    def self.exit_on_failure?
      true
    end

    desc "version", "Display version"
    map %w[-v --version] => :version

    def version
      say "Enroute #{Enroute::VERSION}"
    end

    desc "export", "Export route definitions"
    option :require,
           type: :string,
           aliases: :r,
           default: File.join(Dir.pwd, "config/environment.rb")

    option :output,
           type: :string,
           required: true,
           aliases: :o

    def export
      require_path = File.expand_path(options["require"])
      output_path = File.expand_path(options["output"])

      require require_path
      Export.call(output_path)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enroute-0.0.1 lib/enroute/cli.rb