Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update and fix a number of small issues with recipes.

  • Loading branch information...
commit c7a66765299ab05a9e4c9bfb04e677530b21ff8f 1 parent fd68b07
Michael Bleigh mbleigh authored
9 recipes/hoptoad.rb
View
@@ -1,12 +1,14 @@
gem 'hoptoad_notifier'
-after_bundler do
- if config['use_heroku']
+if config['use_heroku']
+ after_everything do
say_wizard "Adding hoptoad:basic Heroku addon (you can always upgrade later)"
run "heroku addons:add hoptoad:basic"
generate "hoptoad --heroku"
- else
+ end
+else
+ after_bundler do
generate "hoptoad --api-key #{config['api_key']}"
end
end
@@ -19,6 +21,7 @@
category: services
exclusive: exception_notification
tags: [exception_notification]
+run_after: [heroku]
config:
- use_heroku:
18 recipes/jquery.rb
View
@@ -1,15 +1,10 @@
-inside "public/javascripts" do
- get "https://github.com/rails/jquery-ujs/raw/master/src/rails.js", "rails.js"
- get "http://code.jquery.com/jquery-1.5.1.min.js", "jquery.js"
-end
+gem 'jquery-rails'
-application do
- "\nconfig.action_view.javascript_expansions[:defaults] = %w(jquery rails)\n"
+after_bundler do
+ ui = config['ui'] ? ' --ui' : ''
+ generate "jquery:install#{ui}"
end
-gsub_file "config/application.rb", /# JavaScript.*\n/, ""
-gsub_file "config/application.rb", /# config\.action_view\.javascript.*\n/, ""
-
__END__
name: jQuery
@@ -21,3 +16,8 @@
tags: [javascript, framework]
args: ["-J"]
+
+config:
+ - ui:
+ type: boolean
+ prompt: Install jQuery UI?
4 recipes/mongohq.rb
View
@@ -12,7 +12,7 @@
<% end %>
YAML
- after_bundler do
+ after_everything do
say_wizard 'Adding mongohq:free addon (you can always upgrade later)'
system 'heroku addons:add mongohq:free'
end
@@ -43,7 +43,7 @@
author: mbleigh
requires_any: [mongo_mapper, mongoid]
-run_after: [mongo_mapper, mongoid]
+run_after: [mongo_mapper, mongoid, heroku]
exclusive: mongodb_host
category: services
tags: [mongodb]
3  recipes/redistogo.rb
View
@@ -9,7 +9,7 @@
env("REDISTOGO_URL", "redis://localhost:6379")
-after_bundler do
+after_everything do
if config['use_heroku']
say_wizard "Adding redistogo:nano Heroku addon, you can always upgrade later."
run "heroku addons:add redistogo:nano"
@@ -17,6 +17,7 @@
env("REDISTOGO_URL", config['url'], 'production') if config['url']
end
end
+
__END__
name: RedisToGo
1  templates/helpers.erb
View
@@ -35,6 +35,7 @@ def multiple_choice(question, choices)
end
@current_recipe = nil
+@configs = {}
@after_blocks = []
def after_bundler(&block); @after_blocks << [@current_recipe, block]; end
7 templates/layout.erb
View
@@ -38,5 +38,8 @@ RUBY
say_wizard "Running Bundler install. This will take a while."
run 'bundle install'
say_wizard "Running after Bundler callbacks."
-@after_blocks.each{|b| @current_recipe = b[0]; b[1].call}
-@after_everything_blocks.each{|b| @current_recipe = b[0]; b[1].call}
+@after_blocks.each{|b| config = @configs[b[0]] || {}; @current_recipe = b[0]; b[1].call}
+
+@current_recipe = nil
+say_wizard "Running after everything callbacks."
+@after_everything_blocks.each{|b| config = @configs[b[0]] || {}; @current_recipe = b[0]; b[1].call}
1  templates/recipe.erb
View
@@ -5,5 +5,6 @@
say_recipe '<%= name %>'
<%= config.compile if config %>
+@configs[@current_recipe] = config
<%= template %>
Please sign in to comment.
Something went wrong with that request. Please try again.