rails_apps_composer 2.1.8 → 2.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +23 -13
- data/lib/rails_wizard/command.rb +27 -22
- data/recipes/extras.rb +1 -1
- data/version.rb +1 -1
- metadata +4 -4
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. The Rails Composer tool 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
|
|
@@ -70,15 +70,15 @@ h2. Dependencies
|
|
70
70
|
Before using the rails_apps_composer gem, you will need:
|
71
71
|
|
72
72
|
* The Ruby language (version 1.9.3)
|
73
|
-
* Rails 3.
|
73
|
+
* Rails 3.2 or newer
|
74
74
|
|
75
75
|
The rails_apps_composer program uses the version of Rails that is currently installed when you launch the program. If you want to use the newest Rails version, upgrade before running rails_apps_composer.
|
76
76
|
|
77
|
-
See the article "Installing Rails":http://railsapps.github.com/installing-rails.html for advice about updating Rails and your development environment.
|
77
|
+
See the article "Installing Rails":http://railsapps.github.com/installing-rails.html for advice about updating Rails and your development environment. You'll avoid many potential headaches if you review the article step by step before beginning development.
|
78
78
|
|
79
79
|
h4. Database
|
80
80
|
|
81
|
-
|
81
|
+
Unless you use SQLite, which runs by default on Mac OS X, you'll need to have a database server running before you run rails_apps_composer. This is true if you want to use PostgreSQL, MySQL, or MongoDB. I recommend using SQLite if you don't want to set up a database server.
|
82
82
|
|
83
83
|
h2. Installation
|
84
84
|
|
@@ -122,6 +122,10 @@ The above list is current for rails_apps_composer 2.1; later releases will conta
|
|
122
122
|
|
123
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
|
+
h3. Recommended Recipes
|
126
|
+
|
127
|
+
I recommend selecting the _core_ recipe if you are just getting started. The _core_ recipe installs a collection of the most useful recipes.
|
128
|
+
|
125
129
|
h3. Recipe Order and Interdependency
|
126
130
|
|
127
131
|
The order in which you input a list or recipes determines the order of execution unless a recipe contains a @requires@ or @run_after@ directive.
|
@@ -136,13 +140,15 @@ See the "Anatomy of a Recipe":http://railsapps.github.com/tutorial-rails-apps-co
|
|
136
140
|
|
137
141
|
h3. Skipping Test::Unit or Active Record
|
138
142
|
|
139
|
-
If you plan to use RSpec instead of Test::Unit, or use an ORM such as Mongoid instead of Active Record, you
|
143
|
+
If you plan to use RSpec instead of Test::Unit, or use an ORM such as Mongoid instead of Active Record, you must pass the @-T@ or @-O@ flags to the program so it will skip Test::Unit or Active Record.
|
144
|
+
|
145
|
+
The rails_apps_composer program will ask if you want to skip Test::Unit or Active Record when you generate an application interactively.
|
140
146
|
|
141
|
-
|
147
|
+
Any recipe can set the @-T@ or @-O@ arguments using the @args@ directive.
|
142
148
|
|
143
|
-
|
149
|
+
Also, you can set @-T@ or @-O@ arguments in the defaults file.
|
144
150
|
|
145
|
-
|
151
|
+
Setting @-T@ or @-O@ arguments has no affect on application templates. An application template runs after the @rails new@ command so it cannot set the @-T@ or @-O@ arguments. When you generate an application template, the program will not ask if you want to skip Test::Unit or Active Record.
|
146
152
|
|
147
153
|
h3. Using Local Recipes
|
148
154
|
|
@@ -184,13 +190,17 @@ Generating basic application, using:
|
|
184
190
|
"rails new myapp -m <temp_file>"
|
185
191
|
</pre>
|
186
192
|
|
187
|
-
|
193
|
+
If you want to skip the prompts asking about Test::Unit and Active Record, you can set these arguments in a defaults file.
|
194
|
+
|
195
|
+
You will be able to choose recipes that are contained in the rails_apps_composer gem plus any local recipes you've added with the @-l@ argument.
|
196
|
+
|
197
|
+
Choose the _core_ recipe if you are not sure which recipes to select.
|
188
198
|
|
189
199
|
You can specify any gem. Any string you enter will be added as a gem in the starter app Gemfile.
|
190
200
|
|
191
201
|
h3. Generate an Application from a List of Recipes
|
192
202
|
|
193
|
-
Provide a list of recipes using the @-r@ flag.
|
203
|
+
Provide a list of recipes using the @-r@ flag. In this example, the _core_ recipe selects all available core recipes:
|
194
204
|
|
195
205
|
<pre>
|
196
206
|
$ rails_apps_composer new myapp -r core
|
@@ -217,7 +227,7 @@ Use the @my_defaults.yaml@ file to specify a list of recipes, preferences, and e
|
|
217
227
|
|
218
228
|
h3. Generate an Application Template Interactively
|
219
229
|
|
220
|
-
You may want an application template to share with others. For an example
|
230
|
+
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.
|
221
231
|
|
222
232
|
Specify a filename for the template:
|
223
233
|
|
@@ -335,11 +345,11 @@ h2. Issues
|
|
335
345
|
|
336
346
|
Any issues? Please create an "issue":http://github.com/RailsApps/rails_apps_composer/issues on GitHub. Reporting issues (and patching!) helps everyone.
|
337
347
|
|
338
|
-
|
348
|
+
If you include the _readme_ recipe when you generate an application, the generated *README* file will contain a diagnostics report (unless the program aborts before the _readme_ recipe runs). Please include the diagnostics report when you create an issue on GitHub.
|
339
349
|
|
340
350
|
h2. Credits
|
341
351
|
|
342
|
-
Daniel Kehoe maintains this gem as part of the "RailsApps
|
352
|
+
Daniel Kehoe maintains this gem as part of the "RailsApps project":http://railsapps.github.com/.
|
343
353
|
|
344
354
|
This gem is derived from "Michael Bleigh's RailsWizard gem":https://github.com/intridea/rails_wizard. The original idea and the innovative implementation is the work of Michael Bleigh.
|
345
355
|
|
data/lib/rails_wizard/command.rb
CHANGED
@@ -10,8 +10,8 @@ module RailsWizard
|
|
10
10
|
method_option :recipe_dirs, :type => :array, :aliases => "-l"
|
11
11
|
def new(name)
|
12
12
|
add_recipes
|
13
|
-
args = ask_for_args
|
14
13
|
recipes, defaults = load_defaults
|
14
|
+
args = ask_for_args(defaults)
|
15
15
|
recipes = ask_for_recipes(recipes)
|
16
16
|
gems = ask_for_gems
|
17
17
|
run_template(name, recipes, gems, args, defaults, nil)
|
@@ -111,30 +111,35 @@ module RailsWizard
|
|
111
111
|
gems
|
112
112
|
end
|
113
113
|
|
114
|
-
def
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
114
|
+
def ask_for_arg(question, default = nil)
|
115
|
+
if default.nil?
|
116
|
+
result = nil
|
117
|
+
while answer = ask(question)
|
118
|
+
case answer.downcase
|
119
|
+
when "yes", "y"
|
120
|
+
result = true
|
121
|
+
break
|
122
|
+
when "no", "n"
|
123
|
+
result = false
|
124
|
+
break
|
125
|
+
end
|
125
126
|
end
|
127
|
+
result
|
128
|
+
else
|
129
|
+
default
|
126
130
|
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def ask_for_args(defaults)
|
134
|
+
args = []
|
135
|
+
default_args = defaults["args"] || {}
|
136
|
+
|
137
|
+
question = "#{bold}Would you like to skip Test::Unit? (yes for RSpec) \033[33m(y/n)\033[0m#{clear}"
|
138
|
+
args << "-T" if ask_for_arg(question, default_args[:skip_test_unit])
|
139
|
+
|
127
140
|
question = "#{bold}Would you like to skip Active Record? (yes for MongoDB) \033[33m(y/n)\033[0m#{clear}"
|
128
|
-
|
129
|
-
|
130
|
-
when "yes", "y"
|
131
|
-
args << "-O"
|
132
|
-
break
|
133
|
-
when "no", "n"
|
134
|
-
args << ""
|
135
|
-
break
|
136
|
-
end
|
137
|
-
end
|
141
|
+
args << "-O" if ask_for_arg(question, default_args[:skip_active_record])
|
142
|
+
|
138
143
|
args
|
139
144
|
end
|
140
145
|
|
data/recipes/extras.rb
CHANGED
@@ -40,7 +40,7 @@ if prefs[:jsruntime]
|
|
40
40
|
say_wizard "recipe adding 'therubyracer' JavaScript runtime gem"
|
41
41
|
# maybe it was already added for bootstrap-less?
|
42
42
|
unless prefer :bootstrap, 'less'
|
43
|
-
gem 'therubyracer', :group => :assets, :platform => :ruby
|
43
|
+
gem 'therubyracer', '>= 0.10.2', :group => :assets, :platform => :ruby
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
data/version.rb
CHANGED
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.
|
4
|
+
version: 2.1.9
|
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-
|
12
|
+
date: 2012-08-20 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: -
|
205
|
+
hash: -2221592407130434466
|
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: -
|
214
|
+
hash: -2221592407130434466
|
215
215
|
requirements: []
|
216
216
|
rubyforge_project: rails_apps_composer
|
217
217
|
rubygems_version: 1.8.24
|