sdanna@gaius ~/tmp/example > tree
.
├── cookbooks
│ └── foobar
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── attributes
│ ├── definitions
The following are brief justifications of the foodcritic exceptions being used in the first pass of foodcritic bug-bashing. In most cases we are excluding rules to make the amount of work more manageable for this first pass. In a few cases, the core cookbook team doesn't think that a rule is appropriate for the Opscode community cookbooks.
Ensuring that a cookbook works without a Chef Server is often more work than a simple if
statement around a call to search
. The READMEs for these cookbooks should clearly state that they currently require a Chef Server and adding conditionals throughout a recipe to also account for this limitation often only serves to clutter the recipe.
In the long run, we welcome better support for chef-solo-style use cases.
> cat providers/default.rb | |
action :start do | |
ruby_block "foo" do | |
true | |
true | |
true | |
true | |
true | |
true | |
true |
#!/usr/bin/env ruby | |
# What does getrlimit tell us? | |
# What are we doing here and why? | |
# If we are on linux, is there a better alternative? | |
(3).upto(Process.getrlimit(Process::RLIMIT_NOFILE)[0]) do |n| | |
begin | |
if(fd = File.for_fd(n)) | |
puts "Closing FD #{n}" | |
fd.close |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <strings.h> | |
int main(int argc, char *argv[]) { | |
int pipefd[2]; | |
pid_t cpid1; | |
pid_t cpid2; |
ruby_block "dump run_state" do | |
block do | |
require 'pp' | |
pp node.run_state | |
end | |
end |
whyrun_safe_ruby_block "log" do | |
block do | |
Chef::Log.info "foo" | |
end | |
end |
#!/usr/bin/env bash | |
# | |
# Authors:: Chef Support Team <[email protected]> | |
# | |
modified_within_last_x_minutes=180 | |
tail_lines=10000 | |
type='EC' | |
if [[ -n $1 ]]; | |
then |
class Chef::Resource::File | |
def verify(&block) | |
if block_given? | |
@verify_block=block | |
else | |
@verify_block | |
end | |
end | |
end |
sdanna@thrace ~/tmp/foo > irb | |
irb(main):001:0> Dir.pwd | |
=> "/Users/sdanna/tmp/foo" | |
irb(main):002:0> | |
[1]+ Stopped irb | |
146 sdanna@thrace ~/tmp/foo > cd | |
sdanna@thrace ~ > rm -rf ~/tmp/foo | |
sdanna@thrace ~ > fg | |
irb (wd: ~/tmp/foo) | |
Dir.pwd |