bog 0.1.2 → 0.1.3

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTk4OGFhNTdmMGZhNDE5YTc5MTk4ZGFlZWU5MzcxMTI2MTcxYWZjNg==
4
+ ZjZjNmU2ZTQ1NzNjOWNjYTQ2NzNiZTFlYTQyZDk4ZTc0ZjQ0NjQyMg==
5
5
  data.tar.gz: !binary |-
6
- NDZiODkyOTZlYTdmYmE1OWJmOGE4OWRlYzRiZTQ2ZDcwMWU2MmJiYg==
6
+ NzM4NmJlZDFmZWZjNTM5ZTQ1ZGM3N2VkZWUxZjBjNWZmODExNzc5Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MmE3ZjkwYzg2ZjUyNTE0NDliYzEwNDc0ZjZmYTc0MTA1N2NhZjU5MjhjNjNk
10
- MTdlYzZjOWEyOTExZGUxNTNlODU2ZmZlN2VmYzIwZTU1ZjcyNWMxMDUzOGI5
11
- ZTBjNGQ2NGY2ZjU5NzljOGVlOTM4ZGRjZTg0NmM2Yzg0Mjg3NGU=
9
+ YzhmMzBmNTU1OWJlMThmZTgxMzJkYzY0YjdiYTZhNDBmNDViZGIzOGNlMmMx
10
+ OWVlMGZiYjBjMzY1YTQ0MDY5NTE2NWZkMTM0YWE2M2Y5NWFmODRiMDg5ODky
11
+ MGU5YmUwNWY4NjVmZWNhMmY0NTA5OTc5OTkwMzJmY2I2MTEwZDc=
12
12
  data.tar.gz: !binary |-
13
- ZmQxZDVkZjU1ODljNTQ4Y2RhZTA5OTA3NjNiNGYzYzVkYmY5NzBkYTA3M2Yw
14
- YTFmMGNmNzBlYTg2Njg3OTc5ZGM3MDJhY2ZmMGMzNGRjZGZmMWI1ZmRlNjYy
15
- ODRhMDdmMjNhNzkyOWQ3YWJiOGQzMjZhN2JmOWRlMTdjMWI0ZGQ=
13
+ ODA3ZmIyY2Y1YWIwMjNhYzJlZDYwNWU3ZTE1ZmMzYzg5ZmM3NzA3YzJhNTQx
14
+ MTZhMzA0Y2M5ZTY2OGUzYzkzZWFkYzA2OWQ2OWI3MDcxMTQzZGU4ZTFlMWE2
15
+ MTU2MjQ5N2I4NmQ3NDlmZjE3MGVkYzI5Yjk5ZjFhZjAzNDE2OTM=
@@ -1,10 +1,12 @@
1
1
  language: ruby
2
2
  cache: bundler
3
+ sudo: false
3
4
  rvm:
4
5
  - 1.9.3
5
- - 2.0.0
6
- - 2.1.0
7
- - 2.2.2
6
+ - 2.0
7
+ - 2.1
8
+ - 2.2
9
+ - 2.3.1
8
10
  deploy:
9
11
  provider: rubygems
10
12
  gem: bog
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 Secrect Access Key:
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
@@ -1,3 +1,3 @@
1
1
  module Bog
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
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: 2015-12-01 00:00:00.000000000 Z
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