bog 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.travis.yml +5 -3
- data/README.md +8 -5
- data/bin/bog +8 -1
- data/lib/bog/command/list.rb +16 -0
- data/lib/bog/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjZjNmU2ZTQ1NzNjOWNjYTQ2NzNiZTFlYTQyZDk4ZTc0ZjQ0NjQyMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzM4NmJlZDFmZWZjNTM5ZTQ1ZGM3N2VkZWUxZjBjNWZmODExNzc5Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzhmMzBmNTU1OWJlMThmZTgxMzJkYzY0YjdiYTZhNDBmNDViZGIzOGNlMmMx
|
10
|
+
OWVlMGZiYjBjMzY1YTQ0MDY5NTE2NWZkMTM0YWE2M2Y5NWFmODRiMDg5ODky
|
11
|
+
MGU5YmUwNWY4NjVmZWNhMmY0NTA5OTc5OTkwMzJmY2I2MTEwZDc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODA3ZmIyY2Y1YWIwMjNhYzJlZDYwNWU3ZTE1ZmMzYzg5ZmM3NzA3YzJhNTQx
|
14
|
+
MTZhMzA0Y2M5ZTY2OGUzYzkzZWFkYzA2OWQ2OWI3MDcxMTQzZGU4ZTFlMWE2
|
15
|
+
MTU2MjQ5N2I4NmQ3NDlmZjE3MGVkYzI5Yjk5ZjFhZjAzNDE2OTM=
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# bog [![Build Status](https://travis-ci.org/opsunit/bog.svg?branch=master)](https://travis-ci.org/opsunit/bog)[![Gem Version](https://badge.fury.io/rb/bog.svg)](http://badge.fury.io/rb/bog)
|
1
|
+
# bog [![Build Status](https://travis-ci.org/opsunit/bog.svg?branch=master)](https://travis-ci.org/opsunit/bog) [![Gem Version](https://badge.fury.io/rb/bog.svg)](http://badge.fury.io/rb/bog) ![](http://ruby-gem-downloads-badge.herokuapp.com/bog?type=total)
|
2
2
|
|
3
3
|
![OpsUnit Logo][99]
|
4
4
|
|
@@ -16,7 +16,7 @@ The traditional form, where you manually switch profiles:
|
|
16
16
|
|
17
17
|
```bash
|
18
18
|
$ bog myclient init --aws # Configure ~/.bog with a stub for AWS under profile 'myclient'
|
19
|
-
Enter your Amazon
|
19
|
+
Enter your Amazon Secret Access Key:
|
20
20
|
...
|
21
21
|
$ bog myclient # Switch to profile 'myclient'
|
22
22
|
$ knife client list
|
@@ -26,6 +26,9 @@ $ bog personal # Switch to another profile
|
|
26
26
|
...
|
27
27
|
$ bog # Show the current profile
|
28
28
|
personal
|
29
|
+
$ bog -l # List available profiles - * indicates current profile
|
30
|
+
myclient
|
31
|
+
personal*
|
29
32
|
```
|
30
33
|
With roaming profiles enabled:
|
31
34
|
```bash
|
@@ -43,15 +46,15 @@ $ bog # Setting profile ignored
|
|
43
46
|
personal # with roaming profiles
|
44
47
|
```
|
45
48
|
|
46
|
-
### One-off commands
|
49
|
+
### One-off commands
|
47
50
|
```bash
|
48
51
|
$ bog myclient exec aws s3 ls # Exec command as myclient, then
|
49
|
-
$ bog myclient exec knife client list # switch back to previous profile
|
52
|
+
$ bog myclient exec knife client list # switch back to previous profile
|
50
53
|
...
|
51
54
|
```
|
52
55
|
|
53
56
|
## How it works
|
54
|
-
`bog init myclient` will create
|
57
|
+
`bog init myclient` will create
|
55
58
|
|
56
59
|
```
|
57
60
|
.bog
|
data/bin/bog
CHANGED
@@ -8,10 +8,11 @@ require_rel '../lib/bog/command'
|
|
8
8
|
profile = ARGV[0].downcase if ARGV[0]
|
9
9
|
command = ARGV[1].downcase if ARGV[1]
|
10
10
|
|
11
|
-
unless command == 'exec'
|
11
|
+
unless command == 'exec'
|
12
12
|
@options = Slop.parse(strict: true) do
|
13
13
|
banner 'Usage: bog PROFILE [COMMAND] [options]'
|
14
14
|
on 'h', 'help', 'Display this message'
|
15
|
+
on 'l', 'list', 'List existing profiles, * indicates current profile'
|
15
16
|
on 'a', 'aws', 'When passed to the \'init\' subcommand, prompt for AWS credentials'
|
16
17
|
on 'v', 'version', 'Display version'
|
17
18
|
end
|
@@ -25,6 +26,12 @@ unless command == 'exec'
|
|
25
26
|
puts Bog::VERSION
|
26
27
|
exit 0
|
27
28
|
end
|
29
|
+
|
30
|
+
if @options.list?
|
31
|
+
Bog::Command::List.execute
|
32
|
+
exit 0
|
33
|
+
end
|
34
|
+
|
28
35
|
else
|
29
36
|
@options = { :commands => ARGV[2..-1].join(' ') }
|
30
37
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'bog/profile'
|
2
|
+
|
3
|
+
module Bog
|
4
|
+
class Command
|
5
|
+
class List
|
6
|
+
def self.execute
|
7
|
+
profiles = Dir.glob(
|
8
|
+
File.expand_path(ENV['HOME'] + "/.bog/profiles/*/") )
|
9
|
+
profiles.collect! { |p| p.split('/').last }
|
10
|
+
profiles.select { |p|
|
11
|
+
p == Bog::Profile.current.profile_name }[0] << "*"
|
12
|
+
puts profiles
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/bog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -103,6 +103,7 @@ files:
|
|
103
103
|
- lib/bog/command/default.rb
|
104
104
|
- lib/bog/command/exec.rb
|
105
105
|
- lib/bog/command/init.rb
|
106
|
+
- lib/bog/command/list.rb
|
106
107
|
- lib/bog/command/show.rb
|
107
108
|
- lib/bog/initializer.rb
|
108
109
|
- lib/bog/initializer/aws.rb
|