rails_apps_composer 2.1.6 → 2.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -59,7 +59,7 @@ h2. Who This Is For
59
59
 
60
60
  This gem is for experienced Rails developers who need a tool to create and maintain a Rails starter app or Rails application template. If you're regularly building Rails applications that use certain popular gems or rely on common functionality such as authentication, you can benefit from the rails_apps_composer gem.
61
61
 
62
- If you are new to Rails, try the "Rails Composer":http://railsapps.github.com/rails-composer/ tool instead. It provides an application template that is generated from the rails_apps_composer gem's core recipes. It is easier to use.
62
+ If you are new to Rails, try the "Rails Composer":http://railsapps.github.com/rails-composer/ tool instead. It provides an application template that is generated from the rails_apps_composer gem's core recipes. The Rails Composer tool is easier to use; use the rails_apps_composer gem if you want a custom application template, a custom combination of recipes, or the convenience of setting a defaults file.
63
63
 
64
64
  h2. Alternatives
65
65
 
@@ -118,9 +118,9 @@ testing # Add testing framework.
118
118
  views # Add views needed for starter apps.
119
119
  </pre>
120
120
 
121
- The above list is current for rails_apps_composer 2.0; later releases will contain more recipes.
121
+ The above list is current for rails_apps_composer 2.1; later releases will contain more recipes.
122
122
 
123
- You can learn more about the available recipes by examing the source code in the repository "recipes directory":https://github.com/RailsApps/rails_apps_composer/tree/master/recipes.
123
+ See the Guide for more "detailed descriptions of recipes":http://railsapps.github.com/tutorial-rails-apps-composer.html#Recipes. You can find all available recipes in the repository "recipes directory":https://github.com/RailsApps/rails_apps_composer/tree/master/recipes. Examining the recipe source code is the very best way to learn what a recipe will do.
124
124
 
125
125
  h3. Recipe Order and Interdependency
126
126
 
@@ -36,7 +36,8 @@ module RailsWizard
36
36
  else
37
37
  recipes = RailsWizard::Recipes.list_classes
38
38
  end
39
-
39
+ puts "#{bold}#{cyan}To learn more about recipes, see#{clear}:"
40
+ puts "#{bold}#{cyan}http://railsapps.github.com/tutorial-rails-apps-composer.html#Recipes#{clear}\n"
40
41
  recipes.each do |recipe|
41
42
  puts recipe.key.ljust(15) + "# #{recipe.description}"
42
43
  end
data/recipes/frontend.rb CHANGED
@@ -32,6 +32,8 @@ after_bundler do
32
32
  body { padding-top: 60px; }
33
33
  @import "bootstrap-responsive";
34
34
  RUBY
35
+ elsif prefer :frontend, 'foundation'
36
+ insert_into_file 'app/assets/stylesheets/application.css.scss', " *= require foundation_and_overrides\n", :after => "require_self\n"
35
37
  elsif prefer :frontend, 'skeleton'
36
38
  copy_from 'https://raw.github.com/necolas/normalize.css/master/normalize.css', 'app/assets/stylesheets/normalize.css'
37
39
  copy_from 'https://raw.github.com/dhgamache/Skeleton/master/stylesheets/base.css', 'app/assets/stylesheets/base.css'
data/recipes/gems.rb CHANGED
@@ -7,29 +7,24 @@
7
7
  insert_into_file 'Gemfile', "ruby '1.9.3'\n", :before => "gem 'rails', '3.2.6'" if prefer :deploy, 'heroku'
8
8
 
9
9
  ## Web Server
10
- gem 'thin', '>= 1.4.1', :group => [:development, :test] if prefer :dev_webserver, 'thin'
11
- gem 'unicorn', '>= 4.3.1', :group => [:development, :test] if prefer :dev_webserver, 'unicorn'
12
- gem 'puma', '>= 1.5.0', :group => [:development, :test] if prefer :dev_webserver, 'puma'
13
- gem 'thin', '>= 1.4.1', :group => :production if prefer :prod_webserver, 'thin'
14
- gem 'unicorn', '>= 4.3.1', :group => :production if prefer :prod_webserver, 'unicorn'
15
- gem 'puma', '>= 1.6.1', :group => :production if prefer :prod_webserver, 'puma'
10
+ if (prefs[:dev_webserver] == prefs[:prod_webserver])
11
+ gem 'thin', '>= 1.4.1' if prefer :dev_webserver, 'thin'
12
+ gem 'unicorn', '>= 4.3.1' if prefer :dev_webserver, 'unicorn'
13
+ gem 'puma', '>= 1.6.1' if prefer :dev_webserver, 'puma'
14
+ else
15
+ gem 'thin', '>= 1.4.1', :group => [:development, :test] if prefer :dev_webserver, 'thin'
16
+ gem 'unicorn', '>= 4.3.1', :group => [:development, :test] if prefer :dev_webserver, 'unicorn'
17
+ gem 'puma', '>= 1.6.1', :group => [:development, :test] if prefer :dev_webserver, 'puma'
18
+ gem 'thin', '>= 1.4.1', :group => :production if prefer :prod_webserver, 'thin'
19
+ gem 'unicorn', '>= 4.3.1', :group => :production if prefer :prod_webserver, 'unicorn'
20
+ gem 'puma', '>= 1.6.1', :group => :production if prefer :prod_webserver, 'puma'
21
+ end
16
22
 
17
23
  ## Database Adapter
18
24
  gsub_file 'Gemfile', /gem 'sqlite3'\n/, '' unless prefer :database, 'sqlite'
19
25
  gem 'mongoid', '>= 3.0.3' if prefer :orm, 'mongoid'
20
26
  gem 'pg', '>= 0.14.0' if prefer :database, 'postgresql'
21
27
  gem 'mysql2', '>= 0.3.11' if prefer :database, 'mysql'
22
- copy_from_repo 'config/database-postgresql.yml', :prefs => 'postgresql'
23
- copy_from_repo 'config/database-mysql.yml', :prefs => 'mysql'
24
- gsub_file "config/database.yml", /username: .*/, "username: #{app_name}" unless prefer :orm, 'mongoid'
25
- gsub_file "config/database.yml", /password: .*/, "password: #{app_name}" unless prefer :orm, 'mongoid'
26
- begin
27
- run "createuser #{app_name}" if prefer :database, 'postgresql'
28
- run 'bundle exec rake db:drop' if prefer :database, 'postgresql'
29
- run 'bundle exec rake db:create:all' if prefer :database, 'postgresql'
30
- rescue StandardError
31
- raise "unable to create a user and database for PostgreSQL"
32
- end
33
28
 
34
29
  ## Template Engine
35
30
  if prefer :templates, 'haml'
@@ -72,7 +67,8 @@ gem 'machinist', '>= 2.0', :group => :test if prefer :fixtures, 'machinist'
72
67
 
73
68
  ## Front-end Framework
74
69
  gem 'bootstrap-sass', '>= 2.0.4.0' if prefer :bootstrap, 'sass'
75
- gem 'zurb-foundation', '>= 3.0.8', :group => :assets if prefer :frontend, 'foundation'
70
+ gem 'compass-rails', '>= 1.0.3', :group => :assets if prefer :frontend, 'foundation'
71
+ gem 'zurb-foundation', '>= 3.0.9', :group => :assets if prefer :frontend, 'foundation'
76
72
  if prefer :bootstrap, 'less'
77
73
  gem 'twitter-bootstrap-rails', '>= 2.1.1', :group => :assets
78
74
  # install gem 'therubyracer' to use Less
@@ -117,11 +113,39 @@ end
117
113
  git :add => '.' if prefer :git, true
118
114
  git :commit => "-aqm 'rails_apps_composer: Gemfile'" if prefer :git, true
119
115
 
120
- ### GENERATORS ###
116
+ ### CREATE DATABASE ###
121
117
  after_bundler do
122
- ## Database
118
+ copy_from_repo 'config/database-postgresql.yml', :prefs => 'postgresql'
119
+ copy_from_repo 'config/database-mysql.yml', :prefs => 'mysql'
123
120
  generate 'mongoid:config' if prefer :orm, 'mongoid'
124
121
  remove_file 'config/database.yml' if prefer :orm, 'mongoid'
122
+ if prefer :database, 'postgresql'
123
+ begin
124
+ say_wizard "Creating a user named '#{app_name}' for PostgreSQL"
125
+ run "createuser #{app_name}" if prefer :database, 'postgresql'
126
+ gsub_file "config/database.yml", /username: .*/, "username: #{app_name}"
127
+ rescue StandardError
128
+ raise "unable to create a user for PostgreSQL"
129
+ end
130
+ end
131
+ unless prefer :database, 'sqlite'
132
+ affirm = multiple_choice "Drop any existing databases named #{app_name}?",
133
+ [["Yes (continue)",true], ["No (abort)",false]]
134
+ if affirm
135
+ run 'bundle exec rake db:drop'
136
+ else
137
+ raise "aborted at user's request"
138
+ end
139
+ end
140
+ run 'bundle exec rake db:create:all' unless prefer :orm, 'mongoid'
141
+ run 'bundle exec rake db:create' if prefer :orm, 'mongoid'
142
+ ## Git
143
+ git :add => '.' if prefer :git, true
144
+ git :commit => "-aqm 'rails_apps_composer: create database'" if prefer :git, true
145
+ end # after_bundler
146
+
147
+ ### GENERATORS ###
148
+ after_bundler do
125
149
  ## Front-end Framework
126
150
  generate 'foundation:install' if prefer :frontend, 'foundation'
127
151
  ## Git
data/recipes/railsapps.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/railsapps.rb
3
3
 
4
4
  prefs[:railsapps] = multiple_choice "Install an example application?",
5
- [["No, let me build my own application", "none"],
5
+ [["let me build my own application", "none"],
6
6
  ["rails3-bootstrap-devise-cancan", "rails3-bootstrap-devise-cancan"],
7
7
  ["rails3-devise-rspec-cucumber", "rails3-devise-rspec-cucumber"],
8
8
  ["rails3-mongoid-devise", "rails3-mongoid-devise"],
data/recipes/setup.rb CHANGED
@@ -52,7 +52,7 @@ prefs[:templates] = multiple_choice "Template engine?", [["ERB", "erb"], ["Haml"
52
52
  ## Testing Framework
53
53
  if recipes.include? 'testing'
54
54
  prefs[:unit_test] = multiple_choice "Unit testing?", [["Test::Unit", "test_unit"], ["RSpec", "rspec"]] unless prefs.has_key? :unit_test
55
- prefs[:integration] = multiple_choice "Integration testing?", [["RSpec with Capybara", "capybara"],
55
+ prefs[:integration] = multiple_choice "Integration testing?", [["None", "none"], ["RSpec with Capybara", "capybara"],
56
56
  ["Cucumber with Capybara", "cucumber"], ["Turnip with Capybara", "turnip"]] unless prefs.has_key? :integration
57
57
  prefs[:fixtures] = multiple_choice "Fixture replacement?", [["None","none"], ["Factory Girl","factory_girl"], ["Machinist","machinist"]] unless prefs.has_key? :fixtures
58
58
  end
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RailsWizard
2
- VERSION = "2.1.6"
2
+ VERSION = "2.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_apps_composer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.6
4
+ version: 2.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-14 00:00:00.000000000 Z
12
+ date: 2012-08-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
@@ -202,7 +202,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
202
202
  version: '0'
203
203
  segments:
204
204
  - 0
205
- hash: -1555427350048369200
205
+ hash: 6717265878412409
206
206
  required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  none: false
208
208
  requirements:
@@ -211,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
211
  version: '0'
212
212
  segments:
213
213
  - 0
214
- hash: -1555427350048369200
214
+ hash: 6717265878412409
215
215
  requirements: []
216
216
  rubyforge_project: rails_apps_composer
217
217
  rubygems_version: 1.8.24