rails_apps_composer 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -34,7 +34,7 @@ See the "CHANGELOG":https://github.com/RailsApps/rails_apps_composer/blob/master
34
34
 
35
35
  h3. Version 2.1
36
36
 
37
- * use local recipes
37
+ * optional local recipes
38
38
 
39
39
  h3. Version 2.0
40
40
 
@@ -97,11 +97,13 @@ auth # Add authentication and authorization.
97
97
  controllers # Add controllers needed for starter apps.
98
98
  database # Set up and initialize database.
99
99
  email # Configure email accounts.
100
+ example # Example of a recipe
100
101
  extras # Various extras.
101
102
  frontend # Install a front-end framework for HTML5 and CSS.
102
103
  gems # Add the gems your application needs.
104
+ git # Initialize git for your application.
103
105
  models # Add models needed for starter apps.
104
- prelaunch # Generates a Prelaunch Signup App
106
+ railsapps # Install RailsApps example applications.
105
107
  readme # Build a README file for your application.
106
108
  routes # Add routes needed for starter apps.
107
109
  setup # Make choices for your application.
@@ -135,6 +137,18 @@ When you generate an application template, you will not be asked if you want to
135
137
 
136
138
  Any recipe can set the @-T@ or @-O@ arguments using the @args@ directive. However, this has no affect on application templates and is only useful when an application is generated interactively.
137
139
 
140
+ h3. Using Local Recipes
141
+
142
+ You can use local recipes you've created yourself by using the @-l@ flag and supplying the name of a directory that contains local recipes. The @-l@ flag can be combined with any other command so you can create applications or application templates, interactively or from a defaults file.
143
+
144
+ For example, generate an application interactively using local recipes:
145
+
146
+ <pre>
147
+ $ rails_apps_composer new myapp -l ~/recipes/
148
+ </pre>
149
+
150
+ If you create local recipes, please consider contributing them to the project.
151
+
138
152
  h3. Generate an Application Interactively
139
153
 
140
154
  You'll be prompted for recipes and gems:
@@ -146,9 +160,8 @@ Would you like to skip Test::Unit? (yes for RSpec) (y/n)
146
160
  Would you like to skip Active Record? (yes for NoSQL) (y/n)
147
161
 
148
162
  Available Recipes:
149
- apps: prelaunch
150
163
  auth: auth
151
- configuration: email, gems, readme, setup
164
+ configuration: email, gems, git, railsapps, readme, setup
152
165
  example: example
153
166
  frontend: frontend
154
167
  initialize: database
@@ -169,10 +182,10 @@ You can specify any gem. Any string you enter will be added as a gem in the star
169
182
 
170
183
  h3. Generate an Application from a List of Recipes
171
184
 
172
- Provide a list of recipes:
185
+ Provide a list of recipes using the @-r@ flag:
173
186
 
174
187
  <pre>
175
- $ rails_apps_composer new myapp -r setup readme gems testing auth email models controllers views routes frontend database extras
188
+ $ rails_apps_composer new myapp -r git setup readme gems testing auth email models controllers views routes frontend database extras
176
189
 
177
190
  Would you like to skip Test::Unit? (yes for RSpec) (y/n)
178
191
  Would you like to skip Active Record? (yes for NoSQL) (y/n)
@@ -186,13 +199,13 @@ The program will prompt you for your preferences before generating an applicatio
186
199
 
187
200
  h3. Generate an Application from Defaults
188
201
 
189
- Use a defaults file for recipes, preferences, and extra gems so you don't have to provide them interactively. Then generate an application with:
202
+ Use a defaults file for recipes, preferences, and extra gems so you don't have to provide them interactively. Then generate an application using the @-d@ flag:
190
203
 
191
204
  <pre>
192
- $ rails_apps_composer new myapp --defaults=my_defaults.yaml
205
+ $ rails_apps_composer new myapp -d my_defaults.yaml
193
206
  </pre>
194
207
 
195
- 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 to learn about the format of the defaults file.
208
+ 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 below concerning the format of the defaults file.
196
209
 
197
210
  h3. Generate an Application Template Interactively
198
211
 
@@ -204,9 +217,8 @@ Specify a filename for the template:
204
217
  $ rails_apps_composer template ~/Desktop/template.rb
205
218
 
206
219
  Available Recipes:
207
- apps: prelaunch
208
220
  auth: auth
209
- configuration: email, gems, readme, setup
221
+ configuration: email, gems, git, railsapps, readme, setup
210
222
  example: example
211
223
  frontend: frontend
212
224
  initialize: database
@@ -227,7 +239,7 @@ h3. Generate an Application Template from a List of Recipes
227
239
  Specify a filename for the template and provide a list of recipes:
228
240
 
229
241
  <pre>
230
- $ rails_apps_composer template ~/Desktop/template.rb -r setup readme gems testing auth email models controllers views routes frontend database extras
242
+ $ rails_apps_composer template ~/Desktop/template.rb -r git setup readme gems testing auth email models controllers views routes frontend database extras
231
243
 
232
244
  What gem would you like to add? (blank to finish)
233
245
  Generating and saving application template...
@@ -238,13 +250,13 @@ The command with the @template@ argument followed by a filename and a list of re
238
250
 
239
251
  h3. Generate an Application Template from Defaults
240
252
 
241
- Generate an application template using a defaults file:
253
+ Generate an application template using a defaults file and the @-d@ flag:
242
254
 
243
255
  <pre>
244
- $ rails_apps_composer template ~/Desktop/template.rb --defaults=my_defaults.yaml
256
+ $ rails_apps_composer template ~/Desktop/template.rb -d my_defaults.yaml
245
257
  </pre>
246
258
 
247
- 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 to learn about the format of the defaults file.
259
+ 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 below concerning the format of the defaults file.
248
260
 
249
261
  h3. Generate an Application from a Template
250
262
 
@@ -1,16 +1,31 @@
1
1
  module RailsWizard
2
2
  module Diagnostics
3
- # collections of recipes that are known to work together
3
+
4
+ ### collections of recipes that are known to work together
4
5
  @@recipes = []
5
- @@recipes << ["example"]
6
- @@recipes << ["setup"]
7
- @@recipes << ["gems", "setup"]
8
- @@recipes << ["gems", "readme", "setup"]
9
- @@recipes << ["extras", "gems", "readme", "setup"]
6
+ @@recipes << %w(example)
7
+ @@recipes << %w(setup)
8
+ @@recipes << %w(railsapps)
9
+ @@recipes << %w(gems setup)
10
+ @@recipes << %w(gems readme setup)
11
+ @@recipes << %w(extras gems readme setup)
12
+ @@recipes << %w(example git)
13
+ @@recipes << %w(git setup)
14
+ @@recipes << %w(git railsapps)
15
+ @@recipes << %w(gems git setup)
16
+ @@recipes << %w(gems git readme setup)
17
+ @@recipes << %w(extras gems git readme setup)
18
+ @@recipes << %w(auth controllers database email extras frontend gems git models railsapps readme routes setup testing views)
19
+ @@recipes << %w(auth controllers database email example extras frontend gems git models railsapps readme routes setup testing views)
10
20
 
11
- # collections of preferences that are known to work together
21
+ ### collections of preferences that are known to work together
12
22
  @@prefs = []
13
- @@prefs << {:database=>"sqlite", :templates=>"erb"}
23
+ @@prefs << {:railsapps=>"rails3-bootstrap-devise-cancan", :database=>"sqlite", :templates=>"erb", :unit_test=>"rspec", :integration=>"cucumber", :fixtures=>"factory_girl", :frontend=>"bootstrap", :bootstrap=>"sass", :email=>"gmail", :authentication=>"devise", :devise_modules=>"default", :authorization=>"cancan", :starter_app=>"admin_app", :form_builder=>"none"}
24
+ @@prefs << {:railsapps=>"rails3-devise-rspec-cucumber", :database=>"sqlite", :templates=>"erb", :unit_test=>"rspec", :integration=>"cucumber", :fixtures=>"factory_girl", :frontend=>"none", :email=>"gmail", :authentication=>"devise", :devise_modules=>"default", :authorization=>"none", :starter_app=>"users_app", :form_builder=>"none"}
25
+ @@prefs << {:railsapps=>"rails3-mongoid-devise", :database=>'mongodb', :orm=>'mongoid', :templates=>'erb', :unit_test=>'rspec', :integration=>'cucumber', :fixtures=>'factory_girl', :frontend=>'none', :email=>'gmail', :authentication=>'devise', :devise_modules=>'default', :authorization=>'none', :starter_app=>'users_app', :form_builder=>'none'}
26
+ @@prefs << {:railsapps=>"rails3-mongoid-omniauth", :database=>'mongodb', :orm=>'mongoid', :templates=>'erb', :unit_test=>'rspec', :integration=>'cucumber', :fixtures=>'factory_girl', :frontend=>'none', :email=>'none', :authentication=>'omniauth', :omniauth_provider=>'twitter', :authorization=>'none', :starter_app=>'users_app', :form_builder=>'none'}
27
+ @@prefs << {:railsapps=>"rails3-subdomains", :database=>'mongodb', :orm=>'mongoid', :templates=>'haml', :unit_test=>'rspec', :integration=>'cucumber', :fixtures=>'factory_girl', :frontend=>'none', :email=>'gmail', :authentication=>'devise', :devise_modules=>'default', :authorization=>'none', :starter_app=>'subdomains_app', :form_builder=>'none'}
28
+
14
29
  def self.recipes
15
30
  @@recipes
16
31
  end
data/recipes/frontend.rb CHANGED
@@ -14,8 +14,8 @@ after_bundler do
14
14
  copy_from_repo 'app/views/layouts/_navigation-omniauth.html.erb', :prefs => 'omniauth'
15
15
  copy_from_repo 'app/views/layouts/_navigation-subdomains_app.html.erb', :prefs => 'subdomains_app'
16
16
  ## APPLICATION NAME
17
- application_layout_file = 'app/views/layouts/application.html.erb'
18
- navigation_partial_file = 'app/views/layouts/_navigation.html.erb'
17
+ application_layout_file = Dir['app/views/layouts/application.html.*'].first
18
+ navigation_partial_file = Dir['app/views/layouts/_navigation.html.*'].first
19
19
  gsub_file application_layout_file, /App_Name/, "#{app_name.humanize.titleize}"
20
20
  gsub_file navigation_partial_file, /App_Name/, "#{app_name.humanize.titleize}"
21
21
  ### CSS ###
data/recipes/git.rb ADDED
@@ -0,0 +1,25 @@
1
+ # Application template recipe for the rails_apps_composer. Change the recipe here:
2
+ # https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/git.rb
3
+
4
+ ## Git
5
+ say_wizard "initialize git"
6
+ prefs[:git] = true unless prefs.has_key? :git
7
+ if prefer :git, true
8
+ begin
9
+ remove_file '.gitignore'
10
+ get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/gitignore.txt', '.gitignore'
11
+ rescue OpenURI::HTTPError
12
+ say_wizard "Unable to obtain gitignore file from the repo"
13
+ end
14
+ git :init
15
+ git :add => '.'
16
+ git :commit => "-aqm 'rails_apps_composer: initial commit'"
17
+ end
18
+
19
+ __END__
20
+
21
+ name: git
22
+ description: "Initialize git for your application."
23
+ author: RailsApps
24
+
25
+ category: configuration
@@ -0,0 +1,92 @@
1
+ # Application template recipe for the rails_apps_composer. Change the recipe here:
2
+ # https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/railsapps.rb
3
+
4
+ prefs[:railsapps] = multiple_choice "Install an example application?",
5
+ [["No, let me build my own application", "none"],
6
+ ["rails3-devise-rspec-cucumber", "rails3-devise-rspec-cucumber"],
7
+ ["rails3-bootstrap-devise-cancan", "rails3-bootstrap-devise-cancan"],
8
+ ["rails3-mongoid-devise", "rails3-mongoid-devise"],
9
+ ["rails3-mongoid-omniauth", "rails3-mongoid-omniauth"],
10
+ ["rails3-subdomains", "rails3-subdomains"]] unless prefs.has_key? :railsapps
11
+
12
+ case prefs[:railsapps]
13
+ when 'rails3-devise-rspec-cucumber'
14
+ prefs[:database] = 'sqlite'
15
+ prefs[:templates] = 'erb'
16
+ prefs[:unit_test] = 'rspec'
17
+ prefs[:integration] = 'cucumber'
18
+ prefs[:fixtures] = 'factory_girl'
19
+ prefs[:frontend] = 'none'
20
+ prefs[:email] = 'gmail'
21
+ prefs[:authentication] = 'devise'
22
+ prefs[:devise_modules] = 'default'
23
+ prefs[:authorization] = 'none'
24
+ prefs[:starter_app] = 'users_app'
25
+ prefs[:form_builder] = 'none'
26
+ when 'rails3-bootstrap-devise-cancan'
27
+ prefs[:database] = 'sqlite'
28
+ prefs[:templates] = 'erb'
29
+ prefs[:unit_test] = 'rspec'
30
+ prefs[:integration] = 'cucumber'
31
+ prefs[:fixtures] = 'factory_girl'
32
+ prefs[:frontend] = 'bootstrap'
33
+ prefs[:bootstrap] = 'sass'
34
+ prefs[:email] = 'gmail'
35
+ prefs[:authentication] = 'devise'
36
+ prefs[:devise_modules] = 'default'
37
+ prefs[:authorization] = 'cancan'
38
+ prefs[:starter_app] = 'admin_app'
39
+ prefs[:form_builder] = 'none'
40
+ when 'rails3-mongoid-devise'
41
+ prefs[:database] = 'mongodb'
42
+ prefs[:orm] = 'mongoid'
43
+ prefs[:templates] = 'erb'
44
+ prefs[:unit_test] = 'rspec'
45
+ prefs[:integration] = 'cucumber'
46
+ prefs[:fixtures] = 'factory_girl'
47
+ prefs[:frontend] = 'none'
48
+ prefs[:email] = 'gmail'
49
+ prefs[:authentication] = 'devise'
50
+ prefs[:devise_modules] = 'default'
51
+ prefs[:authorization] = 'none'
52
+ prefs[:starter_app] = 'users_app'
53
+ prefs[:form_builder] = 'none'
54
+ when 'rails3-mongoid-omniauth'
55
+ prefs[:database] = 'mongodb'
56
+ prefs[:orm] = 'mongoid'
57
+ prefs[:templates] = 'erb'
58
+ prefs[:unit_test] = 'rspec'
59
+ prefs[:integration] = 'cucumber'
60
+ prefs[:fixtures] = 'factory_girl'
61
+ prefs[:frontend] = 'none'
62
+ prefs[:email] = 'none'
63
+ prefs[:authentication] = 'omniauth'
64
+ prefs[:omniauth_provider] = 'twitter'
65
+ prefs[:authorization] = 'none'
66
+ prefs[:starter_app] = 'users_app'
67
+ prefs[:form_builder] = 'none'
68
+ when 'rails3-subdomains'
69
+ prefs[:database] = 'mongodb'
70
+ prefs[:orm] = 'mongoid'
71
+ prefs[:templates] = 'haml'
72
+ prefs[:unit_test] = 'rspec'
73
+ prefs[:integration] = 'cucumber'
74
+ prefs[:fixtures] = 'factory_girl'
75
+ prefs[:frontend] = 'none'
76
+ prefs[:email] = 'gmail'
77
+ prefs[:authentication] = 'devise'
78
+ prefs[:devise_modules] = 'default'
79
+ prefs[:authorization] = 'none'
80
+ prefs[:starter_app] = 'subdomains_app'
81
+ prefs[:form_builder] = 'none'
82
+ end
83
+
84
+ __END__
85
+
86
+ name: railsapps
87
+ description: "Install RailsApps example applications."
88
+ author: RailsApps
89
+
90
+ requires: [auth, controllers, database, email, extras, frontend, gems, git, models, readme, routes, setup, testing, views]
91
+ run_after: [git]
92
+ category: configuration
data/recipes/readme.rb CHANGED
@@ -23,7 +23,9 @@ after_everything do
23
23
  gsub_file "README.textile", /preferences that are known/, "preferences that are NOT known" if diagnostics[:prefs] == 'fail'
24
24
  gsub_file "README.textile", /RECIPES/, recipes.sort.inspect
25
25
  gsub_file "README.textile", /PREFERENCES/, prefs.inspect
26
-
26
+ gsub_file "README", /RECIPES/, recipes.sort.inspect
27
+ gsub_file "README", /PREFERENCES/, prefs.inspect
28
+
27
29
  # Ruby on Rails
28
30
  gsub_file "README.textile", /\* Ruby/, "* Ruby version #{RUBY_VERSION}"
29
31
  gsub_file "README.textile", /\* Rails/, "* Rails version #{Rails::VERSION::STRING}"
data/recipes/setup.rb CHANGED
@@ -5,27 +5,8 @@
5
5
  say_wizard "You are using Ruby version #{RUBY_VERSION}."
6
6
  say_wizard "You are using Rails version #{Rails::VERSION::STRING}."
7
7
 
8
- ## Git
9
- say_wizard "initialize git"
10
- prefs[:git] = true unless prefs.has_key? :git
11
- if prefer :git, true
12
- begin
13
- remove_file '.gitignore'
14
- get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/gitignore.txt', '.gitignore'
15
- rescue OpenURI::HTTPError
16
- say_wizard "Unable to obtain gitignore file from the repo"
17
- end
18
- git :init
19
- git :add => '.'
20
- git :commit => "-aqm 'rails_apps_composer: initial commit'"
21
- end
22
-
23
8
  ## Is sqlite3 in the Gemfile?
24
- f = File.open(destination_root() + '/Gemfile', "r")
25
- gemfile = ''
26
- f.each_line do |line|
27
- gemfile += line
28
- end
9
+ gemfile = File.read(destination_root() + '/Gemfile')
29
10
  sqlite_detected = gemfile.include? 'sqlite3'
30
11
 
31
12
  ## Web Server
@@ -145,4 +126,5 @@ name: setup
145
126
  description: "Make choices for your application."
146
127
  author: RailsApps
147
128
 
129
+ run_after: [git, railsapps]
148
130
  category: configuration
data/templates/layout.erb CHANGED
@@ -99,7 +99,7 @@ end
99
99
 
100
100
  say_wizard "Installing gems. This will take a while."
101
101
  if prefs.has_key? :bundle_path
102
- run "bundle install --without production #{prefs[:bundle_path]}"
102
+ run "bundle install --without production --path #{prefs[:bundle_path]}"
103
103
  else
104
104
  run 'bundle install --without production'
105
105
  end
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RailsWizard
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
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.0
4
+ version: 2.1.1
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-11 00:00:00.000000000 Z
12
+ date: 2012-08-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
@@ -163,8 +163,10 @@ files:
163
163
  - recipes/extras.rb
164
164
  - recipes/frontend.rb
165
165
  - recipes/gems.rb
166
+ - recipes/git.rb
166
167
  - recipes/models.rb
167
168
  - recipes/prelaunch.rb
169
+ - recipes/railsapps.rb
168
170
  - recipes/readme.rb
169
171
  - recipes/routes.rb
170
172
  - recipes/setup.rb
@@ -199,7 +201,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
199
201
  version: '0'
200
202
  segments:
201
203
  - 0
202
- hash: 282801510994621394
204
+ hash: 4222109462404343651
203
205
  required_rubygems_version: !ruby/object:Gem::Requirement
204
206
  none: false
205
207
  requirements:
@@ -208,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
210
  version: '0'
209
211
  segments:
210
212
  - 0
211
- hash: 282801510994621394
213
+ hash: 4222109462404343651
212
214
  requirements: []
213
215
  rubyforge_project: rails_apps_composer
214
216
  rubygems_version: 1.8.24