Sha256: 3bb5470b6736877b44df90548706c3a15aae818f13fe014661b65adf5a392a14

Contents?: true

Size: 467 Bytes

Versions: 3

Compression:

Stored size: 467 Bytes

Contents

require 'tagenv/version'
require 'tagenv/constants'
require 'tagenv/ec2/metadata'
require 'tagenv/ec2/tag'
require 'tagenv/cli'

module Tagenv
  def self.load(prefix: '', instance_id: nil, provider: 'ec2')
    tag_hash = {}
    if provider == 'ec2'
      @ec2_tag = Ec2::Tag.new
      tag_hash = @ec2_tag.get_tag_hash(instance_id)
    else
      raise "Unsupport provider [#{provider}]"
    end
    tag_hash.each do |k, v|
      ENV[prefix + k] = v
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tagenv-0.1.4 lib/tagenv.rb
tagenv-0.1.3 lib/tagenv.rb
tagenv-0.1.2 lib/tagenv.rb