rails_wizard 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/recipes/capybara.rb CHANGED
@@ -3,7 +3,7 @@ gem 'capybara', :group => [:development, :test]
3
3
  after_bundler do
4
4
  create_file "spec/support/capybara.rb", <<-RUBY
5
5
  require 'capybara/rails'
6
- require 'capbybara/rspec'
6
+ require 'capybara/rspec'
7
7
  RUBY
8
8
 
9
9
  create_file "spec/requests/home_spec.rb", <<-RUBY
data/recipes/hoptoad.rb CHANGED
@@ -1,12 +1,14 @@
1
1
 
2
2
  gem 'hoptoad_notifier'
3
3
 
4
- after_bundler do
5
- if config['use_heroku']
4
+ if config['use_heroku']
5
+ after_everything do
6
6
  say_wizard "Adding hoptoad:basic Heroku addon (you can always upgrade later)"
7
7
  run "heroku addons:add hoptoad:basic"
8
8
  generate "hoptoad --heroku"
9
- else
9
+ end
10
+ else
11
+ after_bundler do
10
12
  generate "hoptoad --api-key #{config['api_key']}"
11
13
  end
12
14
  end
@@ -19,6 +21,7 @@ description: Add Hoptoad exception reporting to your application.
19
21
  category: services
20
22
  exclusive: exception_notification
21
23
  tags: [exception_notification]
24
+ run_after: [heroku]
22
25
 
23
26
  config:
24
27
  - use_heroku:
data/recipes/jquery.rb CHANGED
@@ -1,15 +1,10 @@
1
- inside "public/javascripts" do
2
- get "https://github.com/rails/jquery-ujs/raw/master/src/rails.js", "rails.js"
3
- get "http://code.jquery.com/jquery-1.5.1.min.js", "jquery.js"
4
- end
1
+ gem 'jquery-rails'
5
2
 
6
- application do
7
- "\nconfig.action_view.javascript_expansions[:defaults] = %w(jquery rails)\n"
3
+ after_bundler do
4
+ ui = config['ui'] ? ' --ui' : ''
5
+ generate "jquery:install#{ui}"
8
6
  end
9
7
 
10
- gsub_file "config/application.rb", /# JavaScript.*\n/, ""
11
- gsub_file "config/application.rb", /# config\.action_view\.javascript.*\n/, ""
12
-
13
8
  __END__
14
9
 
15
10
  name: jQuery
@@ -21,3 +16,8 @@ category: assets
21
16
  tags: [javascript, framework]
22
17
 
23
18
  args: ["-J"]
19
+
20
+ config:
21
+ - ui:
22
+ type: boolean
23
+ prompt: Install jQuery UI?
data/recipes/mongohq.rb CHANGED
@@ -12,7 +12,7 @@ mongohq:
12
12
  <% end %>
13
13
  YAML
14
14
 
15
- after_bundler do
15
+ after_everything do
16
16
  say_wizard 'Adding mongohq:free addon (you can always upgrade later)'
17
17
  system 'heroku addons:add mongohq:free'
18
18
  end
@@ -43,7 +43,7 @@ description: "Utilize MongoHQ as the production data host for your application."
43
43
  author: mbleigh
44
44
 
45
45
  requires_any: [mongo_mapper, mongoid]
46
- run_after: [mongo_mapper, mongoid]
46
+ run_after: [mongo_mapper, mongoid, heroku]
47
47
  exclusive: mongodb_host
48
48
  category: services
49
49
  tags: [mongodb]
data/recipes/redistogo.rb CHANGED
@@ -9,7 +9,7 @@ end
9
9
 
10
10
  env("REDISTOGO_URL", "redis://localhost:6379")
11
11
 
12
- after_bundler do
12
+ after_everything do
13
13
  if config['use_heroku']
14
14
  say_wizard "Adding redistogo:nano Heroku addon, you can always upgrade later."
15
15
  run "heroku addons:add redistogo:nano"
@@ -17,6 +17,7 @@ after_bundler do
17
17
  env("REDISTOGO_URL", config['url'], 'production') if config['url']
18
18
  end
19
19
  end
20
+
20
21
  __END__
21
22
 
22
23
  name: RedisToGo
@@ -0,0 +1,43 @@
1
+ gem 'settingslogic'
2
+
3
+ say_wizard "Generating config/application.yml..."
4
+
5
+ append_file "config/application.rb", <<-RUBY
6
+
7
+ require 'settings'
8
+ RUBY
9
+
10
+ create_file "lib/settings.rb", <<-RUBY
11
+ class Settings < Settingslogic
12
+ source "#\{Rails.root\}/config/application.yml"
13
+ namespace Rails.env
14
+ end
15
+
16
+ RUBY
17
+
18
+ create_file "config/application.yml", <<-YAML
19
+ defaults: &defaults
20
+ cool:
21
+ saweet: nested settings
22
+ neat_setting: 24
23
+ awesome_setting: <%= "Did you know 5 + 5 = #{5 + 5}?" %>
24
+
25
+ development:
26
+ <<: *defaults
27
+ neat_setting: 800
28
+
29
+ test:
30
+ <<: *defaults
31
+
32
+ production:
33
+ <<: *defaults
34
+ YAML
35
+
36
+ __END__
37
+
38
+ name: Settingslogic
39
+ description: "A simple and straightforward settings solution that uses an ERB enabled YAML file and a singleton design pattern."
40
+ author: elandesign
41
+
42
+ category: other
43
+ tags: [utilities, configuration]
@@ -35,6 +35,7 @@ def multiple_choice(question, choices)
35
35
  end
36
36
 
37
37
  @current_recipe = nil
38
+ @configs = {}
38
39
 
39
40
  @after_blocks = []
40
41
  def after_bundler(&block); @after_blocks << [@current_recipe, block]; end
data/templates/layout.erb CHANGED
@@ -38,5 +38,8 @@ RUBY
38
38
  say_wizard "Running Bundler install. This will take a while."
39
39
  run 'bundle install'
40
40
  say_wizard "Running after Bundler callbacks."
41
- @after_blocks.each{|b| @current_recipe = b[0]; b[1].call}
42
- @after_everything_blocks.each{|b| @current_recipe = b[0]; b[1].call}
41
+ @after_blocks.each{|b| config = @configs[b[0]] || {}; @current_recipe = b[0]; b[1].call}
42
+
43
+ @current_recipe = nil
44
+ say_wizard "Running after everything callbacks."
45
+ @after_everything_blocks.each{|b| config = @configs[b[0]] || {}; @current_recipe = b[0]; b[1].call}
data/templates/recipe.erb CHANGED
@@ -5,5 +5,6 @@
5
5
  say_recipe '<%= name %>'
6
6
 
7
7
  <%= config.compile if config %>
8
+ @configs[@current_recipe] = config
8
9
 
9
10
  <%= template %>
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RailsWizard
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rails_wizard
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Michael Bleigh
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-22 00:00:00 -05:00
13
+ date: 2011-03-31 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -108,6 +108,7 @@ files:
108
108
  - recipes/rspec.rb
109
109
  - recipes/sass.rb
110
110
  - recipes/sequel.rb
111
+ - recipes/settingslogic.rb
111
112
  - recipes/slim.rb
112
113
  - recipes/test_unit.rb
113
114
  - README.markdown
@@ -138,7 +139,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
139
  requirements:
139
140
  - - ">="
140
141
  - !ruby/object:Gem::Version
141
- hash: 2031770524673691899
142
+ hash: 2312082114480437037
142
143
  segments:
143
144
  - 0
144
145
  version: "0"
@@ -147,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
148
  requirements:
148
149
  - - ">="
149
150
  - !ruby/object:Gem::Version
150
- hash: 2031770524673691899
151
+ hash: 2312082114480437037
151
152
  segments:
152
153
  - 0
153
154
  version: "0"