tacoma 1.0.9 → 1.0.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c05f3a97b0e21578cf344aec50ff58cbf36ce2dc
4
- data.tar.gz: b41d4cbfc54289c9a347d05b03fcc202d7901fd8
3
+ metadata.gz: 8310f820be44f0ffc85fbbd01ce2efb9028474d8
4
+ data.tar.gz: fe8857502b48b144263b084421670df5c1ad0307
5
5
  SHA512:
6
- metadata.gz: b98e6b4a9c73b3356c8cb33d530d79d5258b1b1fc0fe1238d041e87b72dfc7db879c5f6d8ae6670e4a07f9a453ea7f57b0aed519ffecc2ced601756b81793e7e
7
- data.tar.gz: dd712caaf12f5c32f8a6c2db8bd4c558377722705508d9e489389e5c287c86b308ff32c79f472a47adc6f5a8b1b4d840c9d4d07a7c025d486aac5a773c3a520c
6
+ metadata.gz: 9f83ea8a3d456d8faf5f3ad1f1f9d1d51633a197a22a520f831fc8236eca3877ed44a9592f542a4c6df39bc8ebc927dd8cd21b44b3d467abeb90b16472174f20
7
+ data.tar.gz: 0afe0672977d5094ac2a460dc332ee33f04f951765a4e0bacf439771dfd426e636309abb235eebab9e3ad52d9e23b15d4fbba8fac9eb05300871634c2bc80a17
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ 1.0.10
2
+ - Added 'tacoma current' command, which will display the current tacoma environment
1
3
  1.0.9
2
4
  - Added 'tacoma version' command, which will display version and available providers.
3
- - Added '--with-exports' to the 'switch' command, which will echo the export commands to set the AWS env vars.
5
+ - Added '--with-exports' to the 'switch' command, which will echo the export commands to set the AWS env vars.
data/README.md CHANGED
@@ -41,6 +41,13 @@ Will display the export commands for the AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_I
41
41
  - [route53](https://github.com/pcorliss/ruby_route_53)
42
42
  - [aws cli](https://github.com/aws/aws-cli)
43
43
 
44
+ Running tacoma switch with the --with-exports option will also echo shell export sentences for the most common incarnations of the AWS env vars.
45
+
46
+ tacoma version
47
+
48
+ Will display the current tacoma version and list all available configuration templates (providers).
49
+
50
+
44
51
  ## Bash Completion
45
52
 
46
53
  There's an user contributed script for bash completion feature. To use it simply get from the `/contrib/` path and source it in your bash session (after rbenv gets sourced if it is there)
@@ -31,6 +31,23 @@ module Tacoma
31
31
  @repo = config[environment]['repo']
32
32
  end
33
33
  end
34
+
35
+ # Assume there is a ~/.aws/credentials file with a valid format
36
+ def current_environment
37
+ current_filename = File.join(Dir.home, ".aws/credentials")
38
+ File.open(current_filename).each do |line|
39
+ if /aws_access_key_id/ =~ line
40
+ current_access_key_id = line[20..-2] # beware the CRLF
41
+ config = Tool.config
42
+ for key in config.keys
43
+ if config[key]['aws_access_key_id'] == current_access_key_id
44
+ return "#{key}"
45
+ end
46
+ end
47
+ end
48
+ end
49
+ nil
50
+ end
34
51
  end
35
52
  end
36
53
 
@@ -60,6 +77,12 @@ module Tacoma
60
77
  end
61
78
  end
62
79
 
80
+ desc "current", "Displays current loaded tacoma environment"
81
+ def current
82
+ puts Tool.current_environment
83
+ return true
84
+ end
85
+
63
86
  desc "switch ENVIRONMENT", "Prepares AWS config files for the providers. --with-exports will output environment variables"
64
87
  option :'with-exports'
65
88
 
@@ -1,3 +1,3 @@
1
1
  module Tacoma
2
- VERSION='1.0.9'
2
+ VERSION='1.0.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tacoma
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Lupión
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-20 00:00:00.000000000 Z
11
+ date: 2015-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor