This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # starting point (line is too long) | |
| def send_mail(source) | |
| Mailer.deliver(to: 'bob@example.com', from: 'us@example.com', subject: 'Important message', body: source.text) | |
| end | |
| # bad (normal indent) | |
| def send_mail(source) | |
| Mailer.deliver( | |
| to: 'bob@example.com', | |
| from: 'us@example.com', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| my_variable = { | |
| a: 'a', | |
| b: 'b' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo ./install.sh -v 10.24.0 | |
| Downloading Chef 10.24.0 for el... | |
| Unable to retrieve a valid package! | |
| Please file a bug report at http://tickets.opscode.com | |
| Project: Chef | |
| Component: Packages | |
| Label: Omnibus | |
| Version: 10.24.0 | |
| Please detail your operating system type, version and any other relevant details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo bash install.sh -- -s -v 10.24.0 | |
| Downloading Chef for el... | |
| Unable to retrieve a valid package! | |
| Please file a bug report at http://tickets.opscode.com | |
| Project: Chef | |
| Component: Packages | |
| Label: Omnibus | |
| Version: | |
| Please detail your operating system type, version and any other relevant details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ bundle exec knife search node 'chef_environment:the_env AND run_list:recipe\[the_cookbook\:\:the_recipe\]' -VV | |
| ERROR: knife encountered an unexpected error | |
| This may be a bug in the 'search' knife command or plugin | |
| Please collect the output of this command with the `-VV` option before filing a bug report. | |
| Exception: NoMethodError: undefined method `name' for #<Hash:0x007fd3161bcf60> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Hash.from_dotted_path(:'a.b.c', "value") | |
| #=> {:a => {:b => {:c => "value"}}} | |
| or | |
| #=> {"a" => {"b" => {"c" => "value"}}} | |
| # Passing a string as a first parameter will always return the second. Note that the first parameter in the example above is a Symbol. Wondering if this method should return what's passed in or return strings as keys always. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ArrayExt | |
| def add_element(element, side = :tail) | |
| case side | |
| when :head | |
| unshift element | |
| when :tail | |
| self << element | |
| else | |
| raise ArgumentError.new('argument \'side\' must be one of :head, :tail') | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Berksfile: | |
| # cookbook 'nodejs', github: 'mdxp/nodejs-cookbook' | |
| $ berks install | |
| Installing nodejs (1.0.2) from github: 'mdxp/nodejs-cookbook' with branch: '055db6715e6129e1badbb4c79b6ef8ffb244bd9d' | |
| Using build-essential (1.1.0) | |
| Using apt (1.4.8) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <<<<<<< HEAD | |
| ======= | |
| ======= | |
| >>>>>>> 0b88b7c... move skip_federated above where it's used |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rapier:riot_replay jkiehl$ cat recipes/default.rb | |
| if node['testtt'] | |
| raise "omg" | |
| end | |
| node.set['testtt'] = true | |
| rapier:test jkiehl$ vagrant provision | |
| [replay] Running provisioner: Vagrant::Provisioners::ChefSolo... | |
| [replay] Generating chef JSON and uploading... |