Sha256: 1eb94f691e7d4bae5a9da3f32381d7d474939313e7510bae4db9631163e38a69

Contents?: true

Size: 908 Bytes

Versions: 1

Compression:

Stored size: 908 Bytes

Contents

#!/usr/bin/env ruby

require 'bundler/setup'
require 'ruby_lambda'

class RubyLambdaCLI < Thor
  map '-v' => :version, '--version' => :version
  desc '-v (--versions)', 'Outputs the version of Ruby_Lambda.'
  def version
    puts RubyLambda::VERSION
  end

  desc 'init', 'Uses the current directory as a lambda ruby project (creates `main.rb`, `.ruby-version`, and `Gemfile`).'
  def init
    RubyLambda::Init.new(FileUtils.pwd).run
  end

  desc 'execute', 'Invokes the function locally'
  long_desc <<-LONGDESC
    This command is used to invoke / run the function locally

    With -c / --config flag to pass a custom config file to use

    With -H, [--handler=HANDLER]
  LONGDESC

  option :config, default: 'config.yml', type: :string, aliases: :c
  option :handler, type: :string, aliases: :H
  def execute
    RubyLambda::Execute.new(FileUtils.pwd, options).run
  end
end

RubyLambdaCLI.start(ARGV)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_lambda-0.3.0 bin/ruby-lambda