Sha256: 277a65062a081cf34bf5ccbda52b68441a19f7b70ad3907c6cbe7b2cb84b99af

Contents?: true

Size: 682 Bytes

Versions: 23

Compression:

Stored size: 682 Bytes

Contents

module Lono
  class Conventions
    attr_reader :stack, :blueprint, :template, :param
    def initialize(options)
      @options = options
      @stack, @blueprint, @template, @param = naming_conventions(options)
    end

    def naming_conventions(options)
      o = options.deep_symbolize_keys
      stack = o[:stack]
      blueprint = o[:blueprint] || o[:stack]
      template = o[:template] || blueprint
      param = o[:param] || template || blueprint
      stack ||= blueprint # fallback for commands that dont take stack name. IE: lono generate
      [stack, blueprint, template, param]
    end

    def values
      [@stack, @blueprint, @template, @param]
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
lono-7.2.1 lib/lono/conventions.rb
lono-7.2.0 lib/lono/conventions.rb
lono-7.1.0 lib/lono/conventions.rb