knife-info 0.0.2 → 0.0.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
- ZWM1ODkyZTJlNzc3MDBhZjdlZGIyZTg0YzE2NzRiYTQ5MmM2YzdlMg==
4
+ ZDE4OWQxNzE0YWZiNGM2N2QwMjFlZjI4MTNjMjYzMTEyMmMyNDY4Mg==
5
5
  data.tar.gz: !binary |-
6
- Y2VkYTg1YWQxMmI4N2U3ZThmZDI4ZDliNjdhMGJkN2JkN2NiMWE3NQ==
6
+ Y2M0ZTlhZWY4MTczZDk2YWNlMDVkMTg5MDZhMmJkODY2MmJjMWQ2Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWEyZjAwYzIzZjUzMjU1OGZjNzEwOTgwODliODQ2MjAwZWFkZWVlMWQzZmY0
10
- NjQ0YzliNzM2YTVkOTAwYzBmMzVkNGMyNDQ3NDlmZGIyMTg0MmYwZmI5NDcy
11
- ZjdkNjJmNzhhMTljOWYxOWVkNzM4ZDExZmFhNzYxYzM0ZDNkM2I=
9
+ YzYwMmUyNTJiNDJiOWJkNzc5OTlhZTM5ZDc5MjIxMTVkNzllMGUwNjIyYjI5
10
+ MWI4ZjM1ZDMzNDBmZWY1MGI3NTdhMDEwOTI5MzgxM2Y0MDQ3ZDk3Yzg2ZmZj
11
+ ZWU4MzRkYzQyYTEwYWJkMWRmOTA1MTBlOWQ4MGUxNWNlNzlmOWQ=
12
12
  data.tar.gz: !binary |-
13
- NGVmOTcwNTZkYmU5ODk4OWMzYWI0YTFmYzk2ZDYyMmFkMTJhMTgzNzg2YTI1
14
- ODlmNTYzZTMwZDM1NzRkYTIyNDUyNTQ0NDFlMjY1MTc0YjdjNzliNDMyOTE0
15
- NjNlMTM0YzVmZDA4NmRiYTZkNmEzZDlmNDliOTYzYzNlNTc0Yzk=
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 the information from the `knife.rb` config file in the kinfe search path.
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. To install it, clone the
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
@@ -24,21 +24,25 @@ module KnifeInfo
24
24
  :boolean => true | false
25
25
 
26
26
  def run
27
- @config_file_location = Chef::Knife.locate_config_file
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: #{@config_file_location}
66
+ Config File: #{@config_file}
63
67
  VERBOSE
64
68
  end
65
69
 
@@ -1,4 +1,4 @@
1
1
  module KnifeInfo
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
4
4
 
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.2
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-05 00:00:00.000000000 Z
11
+ date: 2013-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef