Sha256: 932eb9545f0d45fab24af0c13fbf3f342ab1120d3b45ef5b49737406e4c9323b

Contents?: true

Size: 947 Bytes

Versions: 30

Compression:

Stored size: 947 Bytes

Contents

require 'ostruct'
module FaaStRuby
  module Command
    module Function
      class FunctionBaseCommand < BaseCommand
        # --- Example YAML
        # name: example
        # test:
        #   command: "rspec"
        #   on_fail:
        #     build: false
        #     deploy: false
        def load_yaml
          FaaStRuby::CLI.error("It looks like you created this function with an old version of faastruby. Please run 'faastruby upgrade'.") if File.file?('handler.rb') && !File.file?('faastruby.yml')
          FaaStRuby::CLI.error("Could not find file 'faastruby.yml' in the current directory") if !File.file?('faastruby.yml') && @options['function_name'].nil?
          @yaml_config = YAML.load(File.read('./faastruby.yml'))
          FaaStRuby::CLI.error("Could read function name from 'faastruby.yml'. Make sure you have a key 'name: FUNCTION_NAME' in that file!") unless @yaml_config['name']
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
faastruby-0.5.30 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.29 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.28 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.27 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.26 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.25 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.24 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.23 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.22 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.21 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.20 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.19 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.18 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.17 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.16 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.15 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.14 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.13 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.12 lib/faastruby/cli/commands/function/base_command.rb
faastruby-0.5.11 lib/faastruby/cli/commands/function/base_command.rb