2016-09-08 4 views
0

ロール内で見つかった値に基づいて、そのコードセクションのみを実行します。シェフのconfigオブジェクト

これはシェフかナイフクラスの一部である定数ですか?

ありがとうございました

+0

:私は、私が設定したいくつかの設定でバージョンの名前いくつかのオプションを持っている場合は、私はその後のような何かを行うことができますか? – Tensibai

+0

私は自分の職場で与えられた新しいコード –

+0

残りのコードの手がかりなしに、どうしているのか、どのように推測するのでしょうか? – Tensibai

答えて

0

私はそれを理解しました。これは、カスタムナイフプラグインを作成するときに追加できるオプションに関連しています。どここのスニペットが来ているから

What my option may look like... 
option :omg, 
    :short => '-V', 
    :long => '--version', 
    :boolean => true, 
    :description => "Print items with this version or lower." 

Enter the following in your terminal... 
$ knife my_custom_plugin --version 1.0 

In your code... 
def run 
    if config[:version] 
    # If the version flag was passed in 
    puts "Version flag passed in." 
    else 
    # If the version flag was not passed in 
    puts "Version flag not passed in." 
    end 
end 

Custom Knife Plugin Reference