botoenv 0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4bc112013246120618ef48ffe0db7898ac41109c
4
+ data.tar.gz: d2da17c316c2bd33b4116b94d29090895d4ce772
5
+ SHA512:
6
+ metadata.gz: 55ba41ac7ffefbeee8457a020ac0d1187881002beecb4fb077c7b4aa35cc64ed9f8fd0c6299edca9fde4b085cca36e3039f88b94bc5417923d32c4e4fbc68fe0
7
+ data.tar.gz: 5e84ead1d0eabdc746d383a1e3faeacf3a740c1bec28c34966002a133b028d2f6d84f523a3c342f032325a879fd3ec43b3c371e3ce6673e7e1f5f504ce4d35d7
data/.gitignore ADDED
@@ -0,0 +1,36 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /lib/bundler/man/
26
+
27
+ # for a library or gem, you might want to ignore these files since the code is
28
+ # intended to run in multiple environments; otherwise, check them in:
29
+ # Gemfile.lock
30
+ # .ruby-version
31
+ # .ruby-gemset
32
+
33
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
+ .rvmrc
35
+
36
+ *.swp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org/'
2
+ gem 'inifile'
3
+ gem 'pry'
4
+ gemspec :name => 'botoenv'
data/Gemfile.lock ADDED
@@ -0,0 +1,24 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ botoenv (1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ coderay (1.1.0)
10
+ inifile (3.0.0)
11
+ method_source (0.8.2)
12
+ pry (0.10.1)
13
+ coderay (~> 1.1.0)
14
+ method_source (~> 0.8.1)
15
+ slop (~> 3.4)
16
+ slop (3.6.0)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ botoenv!
23
+ inifile
24
+ pry
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ botoenv
2
+ =======
3
+
4
+ Load AWS credentials into environment variables from .boto
5
+
6
+ # Installation
7
+
8
+ ## With bundler
9
+ Add this line to the top of your application's Gemfile:
10
+ ```
11
+ gem 'botoenv'
12
+ ```
13
+ And then execute:
14
+ ```
15
+ bundle install
16
+ ```
17
+
18
+ ## Plain ruby
19
+ Install the gem:
20
+ ```
21
+ gem install botoenv
22
+ ```
23
+
24
+ # Usage
25
+
26
+ As early as possible in your application bootstrap process, load:
27
+ ```
28
+ require 'botoenv'
29
+ Dotenv.load
30
+ ```
31
+
32
+ ## Any application
33
+ You can run any application with .boto credentials using:
34
+ ```
35
+ botoenv [command]
36
+ ```
37
+
data/bin/botoenv ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'botoenv'
3
+
4
+ begin
5
+ Botoenv.load
6
+ rescue Errno::ENOENT => e
7
+ abort e.message
8
+ else
9
+ exec *ARGV unless ARGV.empty?
10
+ end
data/botoenv.gemspec ADDED
@@ -0,0 +1,14 @@
1
+ Gem::Specification.new do |gem|
2
+ gem.version = 0.2
3
+ gem.authors = ["Naadir Jeewa"]
4
+ gem.email = ["naadir@randomvariable.co.uk"]
5
+ gem.description = %q{Loads AWS credentials as environment variables from `.env`.}
6
+ gem.summary = %q{Loads AWS credentials as environment variables from `.env`.}
7
+ gem.homepage = "https://github.com/uswitch/dotenv"
8
+ gem.license = 'MIT'
9
+
10
+ gem.files = `git ls-files`.split($\)
11
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
12
+ gem.name = "botoenv"
13
+ gem.require_paths = ["lib"]
14
+ end
data/lib/botoenv.rb ADDED
@@ -0,0 +1,22 @@
1
+ require 'inifile'
2
+
3
+ module Botoenv
4
+ extend self
5
+
6
+ def load
7
+ homeboto = "#{ENV['HOME']}/.boto"
8
+ systemboto = "/etc/boto.cfg"
9
+
10
+ botoconf = case
11
+ when File.file?(homeboto)
12
+ IniFile.load(homeboto)
13
+ when File.file?(systemboto)
14
+ IniFile.load(systemboto)
15
+ end
16
+ if botoconf
17
+ credentials = botoconf['Credentials']
18
+ ENV['AWS_ACCESS_KEY_ID'] = credentials['aws_access_key_id']
19
+ ENV['AWS_SECRET_ACCESS_KEY'] = credentials['aws_secret_access_key']
20
+ end
21
+ end
22
+ end
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: botoenv
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.2'
5
+ platform: ruby
6
+ authors:
7
+ - Naadir Jeewa
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-24 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Loads AWS credentials as environment variables from `.env`.
14
+ email:
15
+ - naadir@randomvariable.co.uk
16
+ executables:
17
+ - botoenv
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - .gitignore
22
+ - Gemfile
23
+ - Gemfile.lock
24
+ - README.md
25
+ - bin/botoenv
26
+ - botoenv.gemspec
27
+ - lib/botoenv.rb
28
+ homepage: https://github.com/uswitch/dotenv
29
+ licenses:
30
+ - MIT
31
+ metadata: {}
32
+ post_install_message:
33
+ rdoc_options: []
34
+ require_paths:
35
+ - lib
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ requirements: []
47
+ rubyforge_project:
48
+ rubygems_version: 2.1.11
49
+ signing_key:
50
+ specification_version: 4
51
+ summary: Loads AWS credentials as environment variables from `.env`.
52
+ test_files: []