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.5.2 lib/lono/conventions.rb
lono-7.5.1 lib/lono/conventions.rb
lono-7.5.0 lib/lono/conventions.rb
lono-7.4.11 lib/lono/conventions.rb
lono-7.4.10 lib/lono/conventions.rb
lono-7.4.9 lib/lono/conventions.rb
lono-7.4.8 lib/lono/conventions.rb
lono-7.4.7 lib/lono/conventions.rb
lono-7.4.6 lib/lono/conventions.rb
lono-7.4.5 lib/lono/conventions.rb
lono-7.4.4 lib/lono/conventions.rb
lono-7.4.3 lib/lono/conventions.rb
lono-7.4.2 lib/lono/conventions.rb
lono-7.4.1 lib/lono/conventions.rb
lono-7.4.0 lib/lono/conventions.rb
lono-7.3.2 lib/lono/conventions.rb
lono-7.3.1 lib/lono/conventions.rb
lono-7.3.0 lib/lono/conventions.rb
lono-7.2.3 lib/lono/conventions.rb
lono-7.2.2 lib/lono/conventions.rb