Sha256: a547d61677c5bff3603d146bf0a239b8a77a9f8abd71bac70644de0ae58e4973

Contents?: true

Size: 1.06 KB

Versions: 15

Compression:

Stored size: 1.06 KB

Contents

require "thor"

module Eddy
  # Command Line Interface for Eddy
  class CLI < Thor
    desc "version", "Display version"
    map ["-v", "--version"] => :version

    # @return [void]
    def version()
      puts("Eddy version #{Eddy::VERSION}")
      exit(0)
    end

    desc("segment PATH", "Build a Segment from a JSON or YAML definition")
    method_option("build-elements", type: :boolean, default: false)
    # @param path [String]
    # @return [void]
    def segment(path)
      path = File.expand_path(path)
      builder = Eddy::Build::SegmentBuilder.from_file(path)
      result = builder.build(build_elements: options["build-elements"])
      puts("Segment class generated: #{result}")
      exit(0)
    end

    desc("set PATH", "Build a Transaction Set from a JSON or YAML definition")
    # @param path [String]
    # @return [void]
    def set(path)
      path = File.expand_path(path)
      builder = Eddy::Build::TransactionSetBuilder.from_file(path)
      result = builder.build()
      puts("Transaction Set class generated: #{result}")
      exit(0)
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
eddy-0.10.0 lib/eddy/cli.rb
eddy-0.9.2 lib/eddy/cli.rb
eddy-0.9.1 lib/eddy/cli.rb
eddy-0.9.0 lib/eddy/cli.rb
eddy-0.8.4 lib/eddy/cli.rb
eddy-0.8.3 lib/eddy/cli.rb
eddy-0.8.2 lib/eddy/cli.rb
eddy-0.8.1 lib/eddy/cli.rb
eddy-0.8.0 lib/eddy/cli.rb
eddy-0.7.0 lib/eddy/cli.rb
eddy-0.6.0 lib/eddy/cli.rb
eddy-0.5.1 lib/eddy/cli.rb
eddy-0.5.0 lib/eddy/cli.rb
eddy-0.4.0 lib/eddy/cli.rb
eddy-0.3.0 lib/eddy/cli/cli.rb