Sha256: fe7a4b6c582c15f93eb9b8217478315f0808d9d6c5ef8ef75c7383ad5c9d62ab

Contents?: true

Size: 714 Bytes

Versions: 134

Compression:

Stored size: 714 Bytes

Contents

require 'yaml'

class AwsConfig
  def initialize(opts={})
    @opts = opts
  end

  def exclusions
    @exclusions ||=Exclusions.new(@opts[:exclude])
  end

  def egress?
    @opts.key?(:egress) ? @opts[:egress] : true
  end

  def groups
    @opts[:groups] || {}
  end

  def format
    @opts[:format] || 'dot'
  end

  def debug?
    @opts[:debug] || false
  end

  def obfuscate?
    @opts[:obfuscate] || false
  end

  def self.load(file)
    config_opts = File.exist?(file) ? YAML.load_file(file) : {}
    AwsConfig.new(config_opts)
  end

  def merge(opts)
    AwsConfig.new(@opts.merge!(opts))
  end

  def self.write(file)
    FileUtils.cp(File.expand_path('../opts.yml.sample', __FILE__), file)
  end
end

Version data entries

134 entries across 134 versions & 1 rubygems

Version Path
aws_security_viz-0.2.5.pre.alpha.pre.26 lib/aws_config.rb
aws_security_viz-0.2.5.pre.alpha.pre.25 lib/aws_config.rb
aws_security_viz-0.2.5.pre.alpha.pre.24 lib/aws_config.rb
aws_security_viz-0.2.5.pre.alpha.pre.23 lib/aws_config.rb
aws_security_viz-0.2.5.pre.alpha.pre.22 lib/aws_config.rb
aws_security_viz-0.2.5.pre.alpha.pre.21 lib/aws_config.rb
aws_security_viz-0.2.4 lib/aws_config.rb
aws_security_viz-0.2.4.pre.alpha.pre.20 lib/aws_config.rb
aws_security_viz-0.2.4.pre.alpha.pre.19 lib/aws_config.rb
aws_security_viz-0.2.4.pre.alpha.pre.18 lib/aws_config.rb
aws_security_viz-0.2.4.pre.alpha.pre.15 lib/aws_config.rb
aws_security_viz-0.2.4.pre.alpha.pre.14 lib/aws_config.rb
aws_security_viz-0.2.4.pre.alpha.pre.13 lib/aws_config.rb
aws_security_viz-0.2.3 lib/aws_config.rb
aws_security_viz-0.2.3.pre.alpha.pre.12 lib/aws_config.rb
aws_security_viz-0.2.3.pre.alpha.pre.11 lib/aws_config.rb
aws_security_viz-0.2.3.pre.alpha.pre.10 lib/aws_config.rb
aws_security_viz-0.2.2 lib/aws_config.rb
aws_security_viz-0.2.2.pre.alpha.pre.421 lib/aws_config.rb
aws_security_viz-0.2.2.pre.alpha.pre.420 lib/aws_config.rb