Skip to content

Instantly share code, notes, and snippets.

define :mysql_database, :action => 'create' do
def mysql(command, config=nil, )
"mysql --defaults-file=#{config} --execute=#{command.inspect}"
end
include_recipe "mysql::client"
# For now, use the super-user conf
case @node[:platform]
when "debian", "ubuntu"
<VirtualHost *:80>
ServerName mc-portal.hellovenado.com
# Radiant additions
namespace :deploy do
task :migrate_extensions, :role => :db do
run "cd #{current_path}; rake #{rails_env} db:migrate:extensions"
end
task :update_extensions, :role => :db do
run "cd #{current_path}; rake #{rails_env} radiant:extensions:update_all"
end
end
diff --git a/lib/dataset.rb b/lib/dataset.rb
index 54bd20b..5be76d5 100644
--- a/lib/dataset.rb
+++ b/lib/dataset.rb
@@ -69,7 +69,9 @@ require 'dataset/record/model'
#
module Dataset
def self.included(test_context) # :nodoc:
- if test_context.name =~ /TestCase\Z/
+ if test_context.name =~ /World\Z/
rules <- space? declaration_sequence space?
declaration_sequence <- head:declaration tail:(space declaration)*
declaration <- nonterminal space '<-' space parsing_expression
parsing_expression <- choice / sequence / primary
choice <- head:alternative tail:(space? '/' space? alternative)+
@seancribbs
seancribbs / crazy-chef-recipe.erl
Created May 16, 2009 02:34
Sketch of what a Chef recipe might look like in Erlang. But it should never happen.
#remote_file{
name="/usr/local/src/ruby-enterprise-1.8.6-20090421.tar.gz",
url="http://rubyforge.org/frs/download.php/55511/ruby-enterprise-1.8.6-20090421.tar.gz",
not_if=fun() -> filelib:is_file("/usr/local/src/ruby-enterprise.tar.gz") end
},
#execute{
name="expand REE tarball",
command="tar xzf ruby-enterprise-1.8.6-20090421.tar.gz",
pwd="/usr/local/src",
rm -f src/herml_scan.erl
rm -f src/herml_parse.erl
rm -f ebin/*
rm -f ebin_tests/*
erl -noshell -s init stop -eval 'leex:file("src/herml_scan.xrl", [{outdir, "src"}])'
erl -noshell -s init stop -eval 'yecc:file("src/herml_parse.yrl")'
cp src/herml.app ebin
cd src;erl -make
Recompile: herml_scan
Recompile: herml_reader
@seancribbs
seancribbs / sphinx_cucumber.rb
Created May 18, 2009 15:24
Runs a Sphinx search server during Cucumber features.
module SphinxCucumber
def start_sphinx!
ThinkingSphinx.tap do |sphinx|
# Don't show delta indexing output while running features,
# but enable deltas so we can find records we create
sphinx.deltas_enabled = true
sphinx.suppress_delta_output = true
# Build the sphinx config and start the server [cribbed from the plugin]
ThinkingSphinx::Configuration.instance.tap do |config|
namespace :deploy do
task :default do
run "cd #{deploy_to} && git pull"
clear_cache
end
task :clear_cache do
# do something here to clear the cache
end
end
additive <- multitive "+" additive / multitive;
multitive <- primary "*" multitive / primary;
primary <- "(" additive ")" / decimal;
decimal <- [0-9];