Skip to content

Instantly share code, notes, and snippets.

abstract (1.0.0)
addressable (2.1.0, 2.0.2)
amqp (0.6.0)
builder (2.1.2)
cgi_multipart_eof_fix (2.5.0)
chef (0.8.0)
chef-server-api (0.8.0)
chef-server-webui (0.8.0)
coderay (0.8.357)
cucumber (0.3.104)
@chef
chef / file.rb
Created September 17, 2009 19:20 — forked from quirkey/file.rb
class Array
def includes?(other_array)
(self & other_array) == other_array
end
end
[1,2,3].includes?([2,3]) #=> true
[1,2,3].includes?([3,4]) #=> false
<fb:request-form type="Friends of Baseball" content="Our goal is to soon reach 500 to recieve a pledge grant of $500 in equipment from our friends at Demarini for our teams.
&lt;fb:req-choice url='http://www.facebook.com/apps/application.php?id=4949752878&ref=s#/fobaseball?ref=ts' label='Make new friends' /&gt;" invite="true"
action="http://apps.facebook.com//apps/application.php?id=4949752878&ref=s#/fobaseball/index.htm">
<fb:multi-friend-selector rows="4" actiontext="Join the Friends of Baseball Fan Page" />
</fb:request-form>
require 'tempfile'
require 'chef/provider/script'
class Chef
class Provider
class ErlCall < Chef::Provider::Script
def action_run
case @new_resource.name_type
when "sname"
default[:packages][:dist_only] = false
@chef
chef / gist:179370
Created September 1, 2009 20:33 — forked from sigmonsays/gist:179357
set_unless[:test][:frontend][:message] = "message from Xenu"
set_unless[:test][:frontend][:per_node] = "default value"
@chef
chef / gist:179369
Created September 1, 2009 20:33 — forked from sigmonsays/gist:179357
test Mash.new unless attribute? :test
test[:frontend] = {} unless test.attribute? :frontend
test[:frontend][:message] = "message from Xenu"
test[:frontend][:per_node] = "default value" unless test[:frontend].attribute? :per_node
define :foobar do
execute "something" do
command "rm -rf #{params[:name]}"
only_if params[:only_if]
end
end
foobar "/" do
only_if { false }
end
@chef
chef / compile.rb
Created August 11, 2009 20:37 — forked from adamhjk/compile.rb
#
# Author:: Adam Jacob (<[email protected]>)
# Copyright:: Copyright (c) 2008 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
irb(main):024:0> c.node[:languages][:ruby][:version]
=> "1.8.6"
irb(main):025:0> "baby " + c.node[:languages][:ruby][:version]
=> "baby 1.8.6"
irb(main):026:0> "baby " + c.node[:languages][:ruby]
TypeError: can't convert Chef::Node::Attribute into String
from (irb):26:in `+'
from (irb):26
from :0