Module: AwsPipes

Defined in:
lib/aws_pipes.rb,
lib/aws_pipes/version.rb

Constant Summary collapse

VERSION =
"0.0.6"

Class Method Summary collapse

Class Method Details

.access_key_id(opts) ⇒ Object



23
24
25
26
27
# File 'lib/aws_pipes.rb', line 23

def AwsPipes.access_key_id opts
  ENV['AWS_ACCESS_KEY_ID'] ||
    opts[:keyid] ||
    ::Trollop::die("Missing access key id")
end

.common_aws_options(program_name, custom_banner, &more_opts) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/aws_pipes.rb', line 5

def AwsPipes.common_aws_options program_name, custom_banner, &more_opts
  ::Trollop::options do
    version "#{program_name} #{VERSION} (c) 2013 Joe Nelson"
    banner "\#{custom_banner}\nYou may provide Amazon authentication through these environment variables:\nAWS_ACCESS_KEY_ID - AWS access key id\nAWS_ACCESS_KEY    - AWS secret access key\n\nAdditional options:\n"
    opt :keyid, "AWS access key id", :type => :string
    opt :key, "AWS secret access key", :type => :string

    self.instance_eval &more_opts if more_opts
  end
end

.secret_access_key(opts) ⇒ Object



29
30
31
32
33
# File 'lib/aws_pipes.rb', line 29

def AwsPipes.secret_access_key opts
  ENV['AWS_ACCESS_KEY'] ||
    opts[:key] ||
    ::Trollop::die("Missing secret access key")
end