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.1.pre.alpha.pre.359 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.356 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.355 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.352 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.349 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.348 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.347 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.346 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.343 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.340 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.337 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.336 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.333 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.330 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.329 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.328 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.301 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.298 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.295 lib/aws_config.rb
aws_security_viz-0.2.1.pre.alpha.pre.292 lib/aws_config.rb