Sha256: 40bcadb42f54101f445a835d8cd3b99f471cb8975bb9c78f9e8f97f1ab74e9c9

Contents?: true

Size: 659 Bytes

Versions: 93

Compression:

Stored size: 659 Bytes

Contents

class Terraspace::Seeder
  class Where
    def initialize(mod, options={})
      @mod, @options = mod, options
    end

    def dest_path
      case @options[:where]
      when "app"
        app_path
      when "seed"
        seed_path
      else
        infer_dest_path
      end
    end

    def infer_dest_path
      @mod.type == "stack" ? app_path : seed_path
    end

    def app_path
      "#{Terraspace.root}/app/#{@mod.build_dir}/tfvars/#{seed_file}.tfvars"
    end

    def seed_path
      "#{Terraspace.root}/seed/tfvars/#{@mod.build_dir}/#{seed_file}.tfvars"
    end

    def seed_file
      @options[:instance] || Terraspace.env
    end
  end
end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
terraspace-2.2.14 lib/terraspace/seeder/where.rb
terraspace-2.2.13 lib/terraspace/seeder/where.rb
terraspace-2.2.12 lib/terraspace/seeder/where.rb
terraspace-2.2.11 lib/terraspace/seeder/where.rb
terraspace-2.2.10 lib/terraspace/seeder/where.rb
terraspace-2.2.9 lib/terraspace/seeder/where.rb
terraspace-2.2.8 lib/terraspace/seeder/where.rb
terraspace-2.2.7 lib/terraspace/seeder/where.rb
terraspace-2.2.6 lib/terraspace/seeder/where.rb
terraspace-2.2.5 lib/terraspace/seeder/where.rb
terraspace-2.2.4 lib/terraspace/seeder/where.rb
terraspace-2.2.3 lib/terraspace/seeder/where.rb
terraspace-2.2.2 lib/terraspace/seeder/where.rb
terraspace-2.2.1 lib/terraspace/seeder/where.rb
terraspace-2.2.0 lib/terraspace/seeder/where.rb
terraspace-2.1.7 lib/terraspace/seeder/where.rb
terraspace-2.1.6 lib/terraspace/seeder/where.rb
terraspace-2.1.5 lib/terraspace/seeder/where.rb
terraspace-2.1.4 lib/terraspace/seeder/where.rb
terraspace-2.1.3 lib/terraspace/seeder/where.rb