rails_apps_composer 2.2.10 → 2.2.11

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -32,28 +32,7 @@ h2. What's New
32
32
 
33
33
  See the "CHANGELOG":https://github.com/RailsApps/rails_apps_composer/blob/master/CHANGELOG.textile for details.
34
34
 
35
- h3. Version 2.1
36
-
37
- * optional local recipes
38
-
39
- h3. Version 2.0
40
-
41
- * the "Guide":http://railsapps.github.com/tutorial-rails-apps-composer.html provides complete documentation
42
- * diagnostics compare your selected recipes and preferences to known working combinations
43
- * the generated application README.textile file provides a diagnostics report
44
- * an improved "quiz" sets preferences
45
- * a new preferences hash makes preferences available to all recipes
46
- * recipes and preferences can be set in a defaults file
47
- * gems can be added at a prompt or from a defaults file (no need to write a recipe for many gems)
48
- * a new 'copy_from_repo' method adds powerful downloading of files to any recipe
49
- * downloading of files from the example app repos reduces the complexity of recipes
50
- * the 'copy_from_repo' method converts ERB files to Haml or Slim
51
- * recipes have been reorganized for easier maintenance
52
- * recipes are based on functionality (e.g., authentication, testing) instead of gems (Devise, RSpec)
53
- * a prompt sets -T or -O args when generating an application
54
- * the 'extras' recipe creates a project-specific gemset and .rvmrc file
55
-
56
- Most important, many unsupported or outdated recipes have been removed. If your favorite recipe is missing, please update it and test it with version 2.0, then submit a pull request. I'm happy to add new recipes.
35
+ If your favorite recipe is missing, please fork the repo, add the recipe and test it, then submit a pull request. I'm happy to add new recipes.
57
36
 
58
37
  h2. Who This Is For
59
38
 
@@ -196,6 +175,8 @@ Choose the _core_ recipe if you are not sure which recipes to select.
196
175
 
197
176
  You can specify any gem. Any string you enter will be added as a gem in the starter app Gemfile.
198
177
 
178
+ If you want to skip the prompts asking which recipe or gem you'd like to add, use the "quiet flag" parameter on the command line by adding @-q@.
179
+
199
180
  h3. Generate an Application from a List of Recipes
200
181
 
201
182
  Provide a list of recipes using the @-r@ flag. In this example, the _core_ recipe selects all available core recipes:
@@ -211,7 +192,7 @@ Generating basic application, using:
211
192
  "rails new myapp -m <temp_file>"
212
193
  </pre>
213
194
 
214
- The program will prompt you for your preferences before generating an application.
195
+ The program will prompt you for your preferences before generating an application (unless you set the "quiet flag" @-q@).
215
196
 
216
197
  h3. Generate an Application from Defaults
217
198
 
@@ -223,6 +204,12 @@ $ rails_apps_composer new myapp -d my_defaults.yaml
223
204
 
224
205
  Use the @my_defaults.yaml@ file to specify a list of recipes, preferences, and extra gems. You can use any name (and file extension) for the file. See the "Defaults File":http://railsapps.github.com/tutorial-rails-apps-composer.html#Defaults section in the Guide concerning the format of the defaults file.
225
206
 
207
+ Use the "quiet flag" @-q@ if you want to skip all prompts:
208
+
209
+ <pre>
210
+ $ rails_apps_composer new myapp -q -d my_defaults.yaml
211
+ </pre>
212
+
226
213
  h3. Generate an Application Template Interactively
227
214
 
228
215
  You may want an application template to share with others. For an example, see the "Rails Composer":http://railsapps.github.com/rails-composer/ project which is an application template generated from the rails_apps_composer core recipes.
@@ -262,7 +249,7 @@ Generating and saving application template...
262
249
  Done.
263
250
  </pre>
264
251
 
265
- The command with the @template@ argument followed by a filename and a list of recipes generates an application template.
252
+ The command with the @template@ argument followed by a filename and a list of recipes generates an application template. Use the "quiet flag" @-q@ if you want to skip all prompts.
266
253
 
267
254
  h3. Generate an Application Template from Defaults
268
255
 
@@ -272,7 +259,7 @@ Generate an application template using a defaults file and the @-d@ flag:
272
259
  $ rails_apps_composer template ~/Desktop/template.rb -d my_defaults.yaml
273
260
  </pre>
274
261
 
275
- Use the @my_defaults.yaml@ file to specify a list of recipes, preferences, and extra gems. You can use any name (and file extension) for the file. See the "Defaults File":http://railsapps.github.com/tutorial-rails-apps-composer.html#Defaults section in the Guide concerning the format of the defaults file.
262
+ Use the @my_defaults.yaml@ file to specify a list of recipes, preferences, and extra gems. You can use any name (and file extension) for the file. See the "Defaults File":http://railsapps.github.com/tutorial-rails-apps-composer.html#Defaults section in the Guide concerning the format of the defaults file. Use the "quiet flag" @-q@ if you want to skip all prompts.
276
263
 
277
264
  h3. Generate an Application from a Template
278
265
 
@@ -8,6 +8,7 @@ module RailsWizard
8
8
  method_option :recipes, :type => :array, :aliases => "-r"
9
9
  method_option :defaults, :type => :string, :aliases => "-d"
10
10
  method_option :recipe_dirs, :type => :array, :aliases => "-l"
11
+ method_option :quiet, :type => :boolean, :aliases => "-q", :default => false
11
12
  def new(name)
12
13
  add_recipes
13
14
  recipes, defaults = load_defaults
@@ -21,6 +22,7 @@ module RailsWizard
21
22
  method_option :recipes, :type => :array, :aliases => "-r"
22
23
  method_option :defaults, :type => :string, :aliases => "-d"
23
24
  method_option :recipe_dirs, :type => :array, :aliases => "-l"
25
+ method_option :quiet, :type => :boolean, :aliases => "-q", :default => false
24
26
  def template(template_name)
25
27
  add_recipes
26
28
  recipes, defaults = load_defaults
@@ -83,6 +85,8 @@ module RailsWizard
83
85
  def ask_for_recipes(recipes)
84
86
  if options[:recipes]
85
87
  return recipes + options[:recipes]
88
+ elsif options[:quiet]
89
+ return recipes
86
90
  end
87
91
  while recipe = ask("#{print_recipes(recipes)}#{bold}Which recipe would you like to add? #{clear}#{yellow}(blank to finish)#{clear}")
88
92
  if recipe == ''
@@ -101,11 +105,13 @@ module RailsWizard
101
105
 
102
106
  def ask_for_gems(defaults)
103
107
  gems = defaults["gems"] || []
104
- while getgem = ask("#{bold}What gem would you like to add? #{clear}#{yellow}(blank to finish)#{clear}")
105
- if getgem == ''
106
- break
107
- else
108
- gems << getgem.downcase
108
+ unless options[:quiet]
109
+ while getgem = ask("#{bold}What gem would you like to add? #{clear}#{yellow}(blank to finish)#{clear}")
110
+ if getgem == ''
111
+ break
112
+ else
113
+ gems << getgem.downcase
114
+ end
109
115
  end
110
116
  end
111
117
  gems
@@ -48,7 +48,7 @@ RUBY
48
48
  copy_from_repo 'app/controllers/profiles_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-subdomains/master/' if prefer :starter_app, 'subdomains_app'
49
49
  ### GIT ###
50
50
  git :add => '-A' if prefer :git, true
51
- git :commit => "-qm 'rails_apps_composer: controllers'" if prefer :git, true
51
+ git :commit => '-qm "rails_apps_composer: controllers"' if prefer :git, true
52
52
  end # after_bundler
53
53
 
54
54
  __END__
data/recipes/email.rb CHANGED
@@ -88,7 +88,7 @@ TEXT
88
88
  end
89
89
  ### GIT
90
90
  git :add => '-A' if prefer :git, true
91
- git :commit => "-qm 'rails_apps_composer: set email accounts'" if prefer :git, true
91
+ git :commit => '-qm "rails_apps_composer: set email accounts"' if prefer :git, true
92
92
  end # after_bundler
93
93
 
94
94
  __END__
data/recipes/extras.rb CHANGED
@@ -87,11 +87,14 @@ after_everything do
87
87
  gsub_file 'config/routes.rb', /\n^\s*\n/, "\n"
88
88
  # GIT
89
89
  git :add => '-A' if prefer :git, true
90
- git :commit => "-qm 'rails_apps_composer: extras'" if prefer :git, true
90
+ git :commit => '-qm "rails_apps_composer: extras"' if prefer :git, true
91
91
  end
92
92
 
93
93
  ## GITHUB
94
94
  if config['github']
95
+ prefs[:github] = true
96
+ end
97
+ if prefs[:github]
95
98
  gem 'hub', '>= 1.10.2', :require => nil, :group => [:development]
96
99
  after_everything do
97
100
  say_wizard "recipe creating GitHub repository"
data/recipes/frontend.rb CHANGED
@@ -52,7 +52,7 @@ RUBY
52
52
  remove_file 'app/assets/stylesheets/application.css'
53
53
  ### GIT ###
54
54
  git :add => '-A' if prefer :git, true
55
- git :commit => "-qm 'rails_apps_composer: front-end framework'" if prefer :git, true
55
+ git :commit => '-qm "rails_apps_composer: front-end framework"' if prefer :git, true
56
56
  end # after_bundler
57
57
 
58
58
  __END__
data/recipes/gems.rb CHANGED
@@ -114,7 +114,7 @@ end
114
114
 
115
115
  ## Git
116
116
  git :add => '-A' if prefer :git, true
117
- git :commit => "-qm 'rails_apps_composer: Gemfile'" if prefer :git, true
117
+ git :commit => '-qm "rails_apps_composer: Gemfile"' if prefer :git, true
118
118
 
119
119
  ### CREATE DATABASE ###
120
120
  after_bundler do
@@ -138,6 +138,9 @@ after_bundler do
138
138
  rescue StandardError => e
139
139
  raise "unable to create a user for PostgreSQL, reason: #{e}"
140
140
  end
141
+ gsub_file "config/database.yml", /database: myapp_development/, "database: #{app_name}_development"
142
+ gsub_file "config/database.yml", /database: myapp_test/, "database: #{app_name}_test"
143
+ gsub_file "config/database.yml", /database: myapp_production/, "database: #{app_name}_production"
141
144
  end
142
145
  if prefer :database, 'mysql'
143
146
  mysql_username = ask_wizard("Username for MySQL? (leave blank to use the app name)")
@@ -166,7 +169,7 @@ after_bundler do
166
169
  run 'bundle exec rake db:create' if prefer :orm, 'mongoid'
167
170
  ## Git
168
171
  git :add => '-A' if prefer :git, true
169
- git :commit => "-qm 'rails_apps_composer: create database'" if prefer :git, true
172
+ git :commit => '-qm "rails_apps_composer: create database"' if prefer :git, true
170
173
  end # after_bundler
171
174
 
172
175
  ### GENERATORS ###
@@ -185,7 +188,7 @@ after_bundler do
185
188
  end
186
189
  ## Git
187
190
  git :add => '-A' if prefer :git, true
188
- git :commit => "-qm 'rails_apps_composer: generators'" if prefer :git, true
191
+ git :commit => '-qm "rails_apps_composer: generators"' if prefer :git, true
189
192
  end # after_bundler
190
193
 
191
194
  __END__
data/recipes/git.rb CHANGED
@@ -8,7 +8,7 @@ if prefer :git, true
8
8
  copy_from 'https://raw.github.com/RailsApps/rails-composer/master/files/gitignore.txt', '.gitignore'
9
9
  git :init
10
10
  git :add => '-A'
11
- git :commit => "-qm 'rails_apps_composer: initial commit'"
11
+ git :commit => '-qm "rails_apps_composer: initial commit"'
12
12
  end
13
13
 
14
14
  __END__
data/recipes/init.rb CHANGED
@@ -59,7 +59,7 @@ FILE
59
59
  run 'bundle exec rake db:seed'
60
60
  ### GIT ###
61
61
  git :add => '-A' if prefer :git, true
62
- git :commit => "-qm 'rails_apps_composer: set up database'" if prefer :git, true
62
+ git :commit => '-qm "rails_apps_composer: set up database"' if prefer :git, true
63
63
  end # after_everything
64
64
 
65
65
  __END__
data/recipes/models.rb CHANGED
@@ -90,7 +90,7 @@ RUBY
90
90
  end
91
91
  ### GIT ###
92
92
  git :add => '-A' if prefer :git, true
93
- git :commit => "-qm 'rails_apps_composer: models'" if prefer :git, true
93
+ git :commit => '-qm "rails_apps_composer: models"' if prefer :git, true
94
94
  end # after_bundler
95
95
 
96
96
  __END__
data/recipes/prelaunch.rb CHANGED
@@ -22,7 +22,7 @@ if prefer :railsapps, 'rails-prelaunch-signup'
22
22
  gsub_file 'config/routes.rb', /\n^\s*\n/, "\n"
23
23
  # GIT
24
24
  git :add => '-A' if prefer :git, true
25
- git :commit => "-qm 'rails_apps_composer: clean up starter app'" if prefer :git, true
25
+ git :commit => '-qm "rails_apps_composer: clean up starter app"' if prefer :git, true
26
26
 
27
27
  # >-------------------------------[ Create a git branch ]--------------------------------<
28
28
  if prefer :git, true
@@ -105,7 +105,7 @@ if prefer :railsapps, 'rails-prelaunch-signup'
105
105
 
106
106
  ### GIT ###
107
107
  git :add => '-A' if prefer :git, true
108
- git :commit => "-qm 'rails_apps_composer: prelaunch app'" if prefer :git, true
108
+ git :commit => '-qm "rails_apps_composer: prelaunch app"' if prefer :git, true
109
109
  end # after_bundler
110
110
  end # rails-prelaunch-signup
111
111
 
data/recipes/readme.rb CHANGED
@@ -72,7 +72,7 @@ after_everything do
72
72
  gsub_file "README.textile", /Authorization: None/, "Authorization: CanCan" if prefer :authorization, 'cancan'
73
73
 
74
74
  git :add => '-A' if prefer :git, true
75
- git :commit => "-qm 'rails_apps_composer: add README files'" if prefer :git, true
75
+ git :commit => '-qm "rails_apps_composer: add README files"' if prefer :git, true
76
76
 
77
77
  end # after_everything
78
78
 
data/recipes/routes.rb CHANGED
@@ -22,7 +22,7 @@ after_bundler do
22
22
  gsub_file 'config/routes.rb', /^.*.routes.draw do/, "#{app_const}.routes.draw do"
23
23
  ### GIT ###
24
24
  git :add => '-A' if prefer :git, true
25
- git :commit => "-qm 'rails_apps_composer: routes'" if prefer :git, true
25
+ git :commit => '-qm "rails_apps_composer: routes"' if prefer :git, true
26
26
  end # after_bundler
27
27
 
28
28
  __END__
data/recipes/testing.rb CHANGED
@@ -87,7 +87,7 @@ RUBY
87
87
  end
88
88
  ### GIT ###
89
89
  git :add => '-A' if prefer :git, true
90
- git :commit => "-qm 'rails_apps_composer: testing framework'" if prefer :git, true
90
+ git :commit => '-qm "rails_apps_composer: testing framework"' if prefer :git, true
91
91
  end # after_bundler
92
92
 
93
93
  after_everything do
@@ -145,7 +145,7 @@ after_everything do
145
145
  end
146
146
  ## GIT
147
147
  git :add => '-A' if prefer :git, true
148
- git :commit => "-qm 'rails_apps_composer: rspec files'" if prefer :git, true
148
+ git :commit => '-qm "rails_apps_composer: rspec files"' if prefer :git, true
149
149
  end
150
150
  ### CUCUMBER ###
151
151
  if prefer :integration, 'cucumber'
@@ -215,7 +215,7 @@ RUBY
215
215
  end
216
216
  ## GIT
217
217
  git :add => '-A' if prefer :git, true
218
- git :commit => "-qm 'rails_apps_composer: cucumber files'" if prefer :git, true
218
+ git :commit => '-qm "rails_apps_composer: cucumber files"' if prefer :git, true
219
219
  end
220
220
  end # after_everything
221
221
 
data/recipes/views.rb CHANGED
@@ -25,7 +25,7 @@ after_bundler do
25
25
  copy_from_repo 'app/views/profiles/show-subdomains_app.html.erb', :prefs => 'subdomains_app'
26
26
  ### GIT ###
27
27
  git :add => '-A' if prefer :git, true
28
- git :commit => "-qm 'rails_apps_composer: views'" if prefer :git, true
28
+ git :commit => '-qm "rails_apps_composer: views"' if prefer :git, true
29
29
  end # after_bundler
30
30
 
31
31
  __END__
@@ -31,9 +31,9 @@ def no_wizard?(question); !yes_wizard?(question) end
31
31
  def multiple_choice(question, choices)
32
32
  say_custom('question', question)
33
33
  values = {}
34
- choices.each_with_index do |choice,i|
34
+ choices.each_with_index do |choice,i|
35
35
  values[(i + 1).to_s] = choice[1]
36
- say_custom (i + 1).to_s + ')', choice[0]
36
+ say_custom( (i + 1).to_s + ')', choice[0] )
37
37
  end
38
38
  answer = ask_wizard("Enter your selection:") while !values.keys.include?(answer)
39
39
  values[answer]
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RailsWizard
2
- VERSION = "2.2.10"
2
+ VERSION = "2.2.11"
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.2.10
4
+ version: 2.2.11
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-10-01 00:00:00.000000000 Z
12
+ date: 2012-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
@@ -201,7 +201,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
201
201
  version: '0'
202
202
  segments:
203
203
  - 0
204
- hash: -1318389471776458398
204
+ hash: 1592200544975630112
205
205
  required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  none: false
207
207
  requirements:
@@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
210
  version: '0'
211
211
  segments:
212
212
  - 0
213
- hash: -1318389471776458398
213
+ hash: 1592200544975630112
214
214
  requirements: []
215
215
  rubyforge_project: rails_apps_composer
216
216
  rubygems_version: 1.8.24