knife-info 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +5 -4
- data/lib/chef/knife/info.rb +15 -11
- data/lib/knife-info/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDE4OWQxNzE0YWZiNGM2N2QwMjFlZjI4MTNjMjYzMTEyMmMyNDY4Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Y2M0ZTlhZWY4MTczZDk2YWNlMDVkMTg5MDZhMmJkODY2MmJjMWQ2Mg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzYwMmUyNTJiNDJiOWJkNzc5OTlhZTM5ZDc5MjIxMTVkNzllMGUwNjIyYjI5
|
10
|
+
MWI4ZjM1ZDMzNDBmZWY1MGI3NTdhMDEwOTI5MzgxM2Y0MDQ3ZDk3Yzg2ZmZj
|
11
|
+
ZWU4MzRkYzQyYTEwYWJkMWRmOTA1MTBlOWQ4MGUxNWNlNzlmOWQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDc1NjRjNjkwZDZhZGYyNTk0MTM2NmVhMjdlODkwYjYyZDU0NGEwN2IyY2I4
|
14
|
+
NzIxMjFlY2Y5YWFjNzA4NTJiMzE4YThhNzc3Yjg4Y2NjMTg0NTdhNzAzMjI2
|
15
|
+
NzYxNmIyMmU3NjNkYWEyYzRjNGM5ZjJjYmMxNmIxN2RmNTI2MDA=
|
data/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
# knife Info [![Build Status](https://travis-ci.org/outofjungle/knife-info.png?branch=master)](https://travis-ci.org/outofjungle/knife-info)
|
1
|
+
# knife Info [![Gem Version](https://badge.fury.io/rb/knife-info.png)](http://badge.fury.io/rb/knife-info) [![Build Status](https://travis-ci.org/outofjungle/knife-info.png?branch=master)](https://travis-ci.org/outofjungle/knife-info) [![Code Climate](https://codeclimate.com/github/outofjungle/knife-info.png)](https://codeclimate.com/github/outofjungle/knife-info) [![Dependency Status](https://gemnasium.com/outofjungle/knife-info.png)](https://gemnasium.com/outofjungle/knife-info)
|
2
2
|
|
3
3
|
## Description
|
4
4
|
|
5
|
-
This is an EXPERIMENTAL knife plugin that displays
|
5
|
+
This is an EXPERIMENTAL knife plugin that displays information from `knife.rb` config file in knife's configuration file search path.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
This knife plugin is packaged as a gem.
|
10
|
-
git repository and run the following:
|
9
|
+
This knife plugin is packaged as a gem. To install it, clone this
|
10
|
+
git repository and run the following command:
|
11
11
|
|
12
12
|
rake install
|
13
13
|
|
@@ -24,3 +24,4 @@ git repository and run the following:
|
|
24
24
|
## TODO
|
25
25
|
|
26
26
|
* Support for `--[no-]color` option
|
27
|
+
* Support for `json` output
|
data/lib/chef/knife/info.rb
CHANGED
@@ -24,21 +24,25 @@ module KnifeInfo
|
|
24
24
|
:boolean => true | false
|
25
25
|
|
26
26
|
def run
|
27
|
-
|
27
|
+
read_config_data
|
28
|
+
|
29
|
+
unless @config_file.nil?
|
30
|
+
case
|
31
|
+
when config[:long] then ui.msg(long_print)
|
32
|
+
when config[:medium] then ui.msg(medium_print)
|
33
|
+
else ui.msg(tiny_print)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def read_config_data
|
39
|
+
@config_file = Chef::Knife.locate_config_file
|
28
40
|
|
29
41
|
uri = URI(server_url)
|
30
42
|
@host = uri.host
|
31
43
|
|
32
|
-
%r(.*/(?<org>.*)$) =~ uri.path
|
44
|
+
%r(.*/organizations/(?<org>.*)$) =~ uri.path
|
33
45
|
@organization = org || ''
|
34
|
-
|
35
|
-
if config[:long]
|
36
|
-
ui.msg(long_print)
|
37
|
-
elsif config[:medium]
|
38
|
-
ui.msg(medium_print)
|
39
|
-
else config[:tiny]
|
40
|
-
ui.msg(tiny_print)
|
41
|
-
end
|
42
46
|
end
|
43
47
|
|
44
48
|
def user_string
|
@@ -59,7 +63,7 @@ module KnifeInfo
|
|
59
63
|
Host: #{@host}
|
60
64
|
Username: #{username}
|
61
65
|
Organization: #{@organization}
|
62
|
-
Config File: #{@
|
66
|
+
Config File: #{@config_file}
|
63
67
|
VERBOSE
|
64
68
|
end
|
65
69
|
|
data/lib/knife-info/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-info
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Venkat Venkataraju
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|