knife-helper 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2346b8f815a790aee2fc611d0a2487e9f80893c
4
- data.tar.gz: f7a7fe20d1895c448b21870d8749a78f5b555fd4
3
+ metadata.gz: ef2d92029961512c387c27d225dfc085fab4a9c2
4
+ data.tar.gz: 5e621d5bf2dc2a150e6312edd33c37ab23064ec8
5
5
  SHA512:
6
- metadata.gz: 631f756d11bef99b2b851c87a0213094416c45764fb9bd11b61993de8e15b178c49925f91576a4c261954b3785848571b2ddb1171d42527568d2c5de7ff06b41
7
- data.tar.gz: 31fda5f76f7db025eda6360f68e1b96d5d1f2cf378128ee4e6def55e31b42de8efadd871ee80d32120dde4ac6638fca97fa8ee0a722e4c6f309db7d5d48df05d
6
+ metadata.gz: 40654093cb4dc049b74294a484dd9ca83d6b8341aa2e4421b48df8260179d132e33c0a4c2c12d42290f28a995324b84f299c8884cfad4c5973aac496204da267
7
+ data.tar.gz: 463e3b0ab0150b9d7ac0b8d22db0a6231ac68d4966684cba2d09127eb748cddbf4a320b85dc5b343bd656a782a1a75bb9544162ed8005920ef0ced50213cf965
data/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ ## 0.0.2
2
+
3
+ * Add `user_bundle` option
4
+ * Change `exec_path` to `command_base`
5
+
6
+ ## 0.0.1
7
+
8
+ * Initial release
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Knife::Helper
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/knife-helper.svg)](http://badge.fury.io/rb/knife-helper) [![Build Status](https://travis-ci.org/marcy-terui/knife-helper.svg?branch=master)](https://travis-ci.org/marcy-terui/knife-helper)
4
+
3
5
  Helper and Command builder for `knife` (`chef-server`, `knife-zero`, etc)
4
6
 
5
7
  ## Installation
@@ -47,7 +49,7 @@ $ knife helper exec NAME (option)
47
49
  ```yaml
48
50
  ---
49
51
  settings:
50
- exec_path: /home/marcy/.rbenv/versions/2.1.5/bin/knife
52
+ command_base: /home/marcy/.rbenv/versions/2.1.5/bin/knife
51
53
 
52
54
  commands:
53
55
  - name: default
@@ -56,7 +58,7 @@ commands:
56
58
  options:
57
59
  ```
58
60
 
59
- ### settings:exec_path
61
+ ### settings:command_base
60
62
  Path to `knife` execution script.
61
63
 
62
64
  ### commands:name
@@ -68,6 +70,8 @@ Condition for search and execute command.
68
70
  ### commands:option
69
71
  Command options.
70
72
 
73
+ ## ChangeLog
74
+ see [CHANGELOG](https://github.com/marcy-terui/knife-helper/blob/master/CHANGELOG.md)
71
75
 
72
76
  ## Contributing
73
77
 
@@ -40,6 +40,13 @@ class Chef
40
40
  :boolean => true,
41
41
  :default => false
42
42
 
43
+ option :use_bundle,
44
+ :short => "-b",
45
+ :long => "--bundle",
46
+ :description => "Exec commands by bundler",
47
+ :boolean => true,
48
+ :default => false
49
+
43
50
  def run
44
51
  create_helper_yml
45
52
  create_knife_rb
@@ -50,8 +57,9 @@ class Chef
50
57
  private
51
58
 
52
59
  def create_helper_yml
60
+ command_base = config[:use_bundle] ? "bundle exec knife" : $0
53
61
  ::Knife::Helper::Template.new("helper.yml.erb", ".knife.helper.yml",
54
- :exec_path => $0
62
+ :command_base => command_base
55
63
  ).flush
56
64
  end
57
65
 
@@ -4,7 +4,7 @@ module Knife
4
4
  class Commands
5
5
 
6
6
  def initialize(config)
7
- @base = config['settings']['exec_path']
7
+ @base = config['settings']['command_base']
8
8
  @commands = config['commands']
9
9
  end
10
10
 
@@ -1,5 +1,5 @@
1
1
  module Knife
2
2
  module Helper
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -9,7 +9,7 @@ describe Knife::Helper::Commands do
9
9
  let(:config) do
10
10
  {
11
11
  'settings' => {
12
- 'exec_path' => '/test/knife'
12
+ 'command_base' => '/test/knife'
13
13
  },
14
14
  'commands' => [
15
15
  {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  settings:
3
- exec_path: <%= config[:exec_path] %>
3
+ command_base: <%= config[:command_base] %>
4
4
 
5
5
  commands:
6
6
  - name: default
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masashi Terui
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-08 00:00:00.000000000 Z
11
+ date: 2015-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -104,6 +104,7 @@ files:
104
104
  - ".gitignore"
105
105
  - ".rspec"
106
106
  - ".travis.yml"
107
+ - CHANGELOG.md
107
108
  - Gemfile
108
109
  - LICENSE.txt
109
110
  - README.md