README.md in chef-sugar-2.4.1 vs README.md in chef-sugar-2.5.0

- old
+ new

@@ -137,21 +137,26 @@ ['hello'].blank? #=> false ``` ### Data Bag - `encrypted_data_bag_item` - a handy DSL method for loading encrypted data bag items the same way you load a regular data bag item; this requires `Chef::Config[:encrypted_data_bag_secret]` is set! -- `encrypted_data_bag_item_for_environment` - find the data bag entry for the current node's Chef environment. +- `encrypted_data_bag_item_for_environment` - find the encrypted data bag entry for the current node's Chef environment. +- `data_bag_item_for_environment` - find the data bag entry for the current node's Chef environment. #### Examples ```ruby encrypted_data_bag_item('accounts', 'hipchat') ``` ```ruby encrypted_data_bag_item_for_environment('accounts', 'github') ``` +```ruby +data_bag_item_for_environment('accounts', 'github') +``` + ### Docker Chef Sugar looks for hints to see if the node being converged is a Docker container. When [Ohai supports checking other nodes](https://github.com/opscode/ohai/pull/428), Chef Sugar will automatically pick up the information. - `docker?` @@ -256,17 +261,20 @@ ) end ``` ### Node + +Additional methods for the `node` object + - `deep_fetch` - safely fetch a nested attribute. - `deep_fetch!` - fetch a nested attribute, raising a more semantic error if the key does not exist. - `in?` - determine if the node is in the given Chef environment. #### Examples ```ruby -credentials = if in?('production') +credentials = if node.in?('production') Chef::EncryptedDataBag.new('...') else data_bag('...') end ``` @@ -387,10 +395,12 @@ not_if { vagrant? } end ``` ### Virtualization +- `kvm?` - `lxc?` +- `virtualbox?` - `vmware?` #### Examples ```ruby service 'ntpd' do