rails_apps_composer 2.2.32 → 2.2.33

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -188,7 +188,7 @@ $ rails_apps_composer new myapp -r core
188
188
 
189
189
  Would you like to skip Test::Unit? (yes for RSpec) (y/n)
190
190
  Would you like to skip Active Record? (yes for MongoDB) (y/n)
191
- What gem would you like to add? (blank to finish)
191
+ What gem would you like to add? (blank to finish)
192
192
 
193
193
  Generating basic application, using:
194
194
  "rails new myapp -m <temp_file>"
@@ -231,7 +231,7 @@ mvc: controllers, models, routes, views
231
231
  other: extras
232
232
  testing: testing
233
233
 
234
- Which recipe would you like to add? (blank to finish)
234
+ Which recipe would you like to add? (blank to finish)
235
235
  What gem would you like to add? (blank to finish)
236
236
  Generating and saving application template...
237
237
  Done.
@@ -343,7 +343,7 @@ If you get an error like this:
343
343
  Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
344
344
  composer Running 'after bundler' callbacks.
345
345
  The template [...] could not be loaded.
346
- Error: You have already activated ..., but your Gemfile requires ....
346
+ Error: You have already activated ..., but your Gemfile requires ....
347
347
  Using bundle exec may solve this.
348
348
  </pre>
349
349
 
@@ -7,7 +7,7 @@ module RailsWizard
7
7
  def initialize(schema, defaults=nil)
8
8
  @questions = ActiveSupport::OrderedHash.new
9
9
  @defaults = defaults
10
- schema.each do |hash|
10
+ schema.each do |hash|
11
11
  key = hash.keys.first
12
12
  details = hash.values.first
13
13
 
@@ -68,7 +68,7 @@ module RailsWizard
68
68
  end
69
69
 
70
70
  class TrueFalse < Prompt
71
- def question
71
+ def question
72
72
  "yes_wizard?(#{prompt.inspect})"
73
73
  end
74
74
  end
@@ -76,7 +76,7 @@ module RailsWizard
76
76
  class MultipleChoice < Prompt
77
77
  def question
78
78
  "multiple_choice(#{prompt.inspect}, #{@details['choices'].inspect})"
79
- end
79
+ end
80
80
  end
81
81
 
82
82
  QUESTION_TYPES = {
@@ -55,7 +55,7 @@ module RailsWizard
55
55
  RailsWizard::Diagnostics.prefs.inspect
56
56
  end
57
57
  end
58
-
58
+
59
59
  # Sort the recipes list taking 'run_after' directives into account.
60
60
  def resolve_recipes
61
61
  @resolve_recipes ||= begin
@@ -81,7 +81,7 @@ module RailsWizard
81
81
 
82
82
  def recipes_with_dependencies
83
83
  @recipes_with_dependencies ||= recipe_classes
84
-
84
+
85
85
  added_more = false
86
86
  for recipe in recipe_classes
87
87
  recipe.requires.each do |requirement|
@@ -16,7 +16,7 @@ after_bundler do
16
16
  end
17
17
  RUBY
18
18
  end
19
- end
19
+ end
20
20
  ### HOME_CONTROLLER ###
21
21
  if ['home_app','users_app','admin_app','subdomains_app'].include? prefs[:starter_app]
22
22
  generate(:controller, "home index")
data/recipes/core.rb CHANGED
@@ -11,4 +11,4 @@ description: "Select all core recipes."
11
11
  author: RailsApps
12
12
 
13
13
  requires: [git, railsapps, setup, readme, gems, testing, email, models, controllers, views, routes, frontend, init, prelaunch, saas, extras]
14
- category: collections
14
+ category: collections
data/recipes/email.rb CHANGED
@@ -17,9 +17,9 @@ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
17
17
  RUBY
18
18
  end
19
19
  ### TEST
20
- inject_into_file 'config/environments/test.rb', :before => "\nend" do
20
+ inject_into_file 'config/environments/test.rb', :before => "\nend" do
21
21
  <<-RUBY
22
- \n
22
+ \n
23
23
  # ActionMailer Config
24
24
  config.action_mailer.default_url_options = { :host => 'example.com' }
25
25
  RUBY
data/recipes/example.rb CHANGED
@@ -58,7 +58,7 @@ config:
58
58
  type: boolean
59
59
  prompt: Do you also want to test your application on Mars?
60
60
  if: space_test
61
- if_recipe: mars_lander
61
+ if_recipe: mars_lander
62
62
  - test_count:
63
63
  type: string
64
64
  prompt: How many times would you like to repeat the test?
@@ -67,4 +67,4 @@ config:
67
67
  type: multiple_choice
68
68
  prompt: "What orbit do you want?"
69
69
  choices: [ [Low Earth orbit, leo], [Sun-synchronous, spy], [Geostationary, gps] ]
70
- if: space_test
70
+ if: space_test
data/recipes/frontend.rb CHANGED
@@ -20,7 +20,7 @@ after_bundler do
20
20
  copy_from_repo 'app/views/layouts/_navigation-devise.html.erb', :prefs => 'devise'
21
21
  copy_from_repo 'app/views/layouts/_navigation-omniauth.html.erb', :prefs => 'omniauth'
22
22
  end
23
- copy_from_repo 'app/views/layouts/_navigation-subdomains_app.html.erb', :prefs => 'subdomains_app'
23
+ copy_from_repo 'app/views/layouts/_navigation-subdomains_app.html.erb', :prefs => 'subdomains_app'
24
24
  ## APPLICATION NAME
25
25
  application_layout_file = Dir['app/views/layouts/application.html.*'].first
26
26
  navigation_partial_file = Dir['app/views/layouts/_navigation.html.*'].first
data/recipes/git.rb CHANGED
@@ -17,4 +17,4 @@ name: git
17
17
  description: "Initialize git for your application."
18
18
  author: RailsApps
19
19
 
20
- category: configuration
20
+ category: configuration
data/recipes/init.rb CHANGED
@@ -17,30 +17,34 @@ after_everything do
17
17
  when 'mandrill'
18
18
  credentials = "MANDRILL_USERNAME: Your_Username\nMANDRILL_API_KEY: Your_API_Key\n"
19
19
  end
20
- append_file 'config/application.yml', credentials
21
- ## DEFAULT USER
22
- append_file 'config/application.yml' do <<-FILE
20
+ append_file 'config/application.yml', credentials if prefs[:local_env_file]
21
+ if prefs[:local_env_file]
22
+ ## DEFAULT USER
23
+ append_file 'config/application.yml' do <<-FILE
23
24
  ADMIN_NAME: First User
24
25
  ADMIN_EMAIL: user@example.com
25
26
  ADMIN_PASSWORD: changeme
26
27
  FILE
27
- end
28
- ## AUTHENTICATION
29
- if prefer :authentication, 'omniauth'
30
- append_file 'config/application.yml' do <<-FILE
28
+ end
29
+ ## AUTHENTICATION
30
+ if prefer :authentication, 'omniauth'
31
+ append_file 'config/application.yml' do <<-FILE
31
32
  OMNIAUTH_PROVIDER_KEY: Your_OmniAuth_Provider_Key
32
33
  OMNIAUTH_PROVIDER_SECRET: Your_OmniAuth_Provider_Secret
33
34
  FILE
35
+ end
36
+ end
37
+ ## AUTHORIZATION
38
+ if (prefer :authorization, 'cancan')
39
+ append_file 'config/application.yml', "ROLES: [admin, user, VIP]\n"
34
40
  end
35
- end
36
- ## AUTHORIZATION
37
- if (prefer :authorization, 'cancan')
38
- append_file 'config/application.yml', "ROLES: [admin, user, VIP]\n"
39
41
  end
40
42
  ### SUBDOMAINS ###
41
43
  copy_from_repo 'config/application.yml', :repo => 'https://raw.github.com/RailsApps/rails3-subdomains/master/' if prefer :starter_app, 'subdomains_app'
42
44
  ### APPLICATION.EXAMPLE.YML ###
43
- copy_file destination_root + '/config/application.yml', destination_root + '/config/application.example.yml'
45
+ if prefs[:local_env_file]
46
+ copy_file destination_root + '/config/application.yml', destination_root + '/config/application.example.yml'
47
+ end
44
48
  ### DATABASE SEED ###
45
49
  append_file 'db/seeds.rb' do <<-FILE
46
50
  # Environment variables (ENV['...']) are set in the file config/application.yml.
data/recipes/prelaunch.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/prelaunch.rb
3
3
 
4
4
  if prefer :railsapps, 'rails-prelaunch-signup'
5
-
5
+
6
6
  after_everything do
7
7
  say_wizard "recipe running after 'bundle install'"
8
8
  repo = 'https://raw.github.com/RailsApps/rails-prelaunch-signup/master/'
@@ -56,7 +56,7 @@ if prefer :railsapps, 'rails-prelaunch-signup'
56
56
  copy_from_repo 'db/seeds.rb', :repo => repo
57
57
  run 'bundle exec rake db:seed'
58
58
  run 'bundle exec rake db:test:prepare'
59
-
59
+
60
60
  # >-------------------------------[ Controllers ]--------------------------------<
61
61
 
62
62
  copy_from_repo 'app/controllers/confirmations_controller.rb', :repo => repo
@@ -65,7 +65,7 @@ if prefer :railsapps, 'rails-prelaunch-signup'
65
65
  copy_from_repo 'app/controllers/users_controller.rb', :repo => repo
66
66
 
67
67
  # >-------------------------------[ Mailers ]--------------------------------<
68
-
68
+
69
69
  generate 'mailer UserMailer'
70
70
  copy_from_repo 'spec/mailers/user_mailer_spec.rb', :repo => repo
71
71
  copy_from_repo 'app/mailers/user_mailer.rb', :repo => repo
@@ -89,7 +89,7 @@ if prefer :railsapps, 'rails-prelaunch-signup'
89
89
  copy_from_repo 'config/routes.rb', :repo => repo
90
90
  ### CORRECT APPLICATION NAME ###
91
91
  gsub_file 'config/routes.rb', /^.*.routes.draw do/, "#{app_const}.routes.draw do"
92
-
92
+
93
93
  # >-------------------------------[ Assets ]--------------------------------<
94
94
 
95
95
  copy_from_repo 'app/assets/javascripts/application.js', :repo => repo
@@ -98,14 +98,14 @@ if prefer :railsapps, 'rails-prelaunch-signup'
98
98
 
99
99
  # >-------------------------------[ Cucumber ]--------------------------------<
100
100
  say_wizard "copying Cucumber scenarios from the rails-prelaunch-signup examples"
101
- copy_from_repo 'features/admin/send_invitations.feature', :repo => repo
101
+ copy_from_repo 'features/admin/send_invitations.feature', :repo => repo
102
102
  copy_from_repo 'features/admin/view_progress.feature', :repo => repo
103
103
  copy_from_repo 'features/visitors/request_invitation.feature', :repo => repo
104
104
  copy_from_repo 'features/users/sign_in.feature', :repo => repo
105
105
  copy_from_repo 'features/users/sign_up.feature', :repo => repo
106
106
  copy_from_repo 'features/users/user_show.feature', :repo => repo
107
107
  copy_from_repo 'features/step_definitions/admin_steps.rb', :repo => repo
108
- copy_from_repo 'features/step_definitions/user_steps.rb', :repo => repo
108
+ copy_from_repo 'features/step_definitions/user_steps.rb', :repo => repo
109
109
  copy_from_repo 'features/step_definitions/visitor_steps.rb', :repo => repo
110
110
  copy_from_repo 'config/locales/devise.en.yml', :repo => repo
111
111
 
data/recipes/readme.rb CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  after_everything do
5
5
  say_wizard "recipe running after everything"
6
-
6
+
7
7
  # remove default READMEs
8
8
  %w{
9
9
  README
@@ -25,11 +25,11 @@ after_everything do
25
25
  gsub_file "README.textile", /PREFERENCES/, prefs.inspect
26
26
  gsub_file "README", /RECIPES/, recipes.sort.inspect
27
27
  gsub_file "README", /PREFERENCES/, prefs.inspect
28
-
28
+
29
29
  # Ruby on Rails
30
30
  gsub_file "README.textile", /\* Ruby/, "* Ruby version #{RUBY_VERSION}"
31
31
  gsub_file "README.textile", /\* Rails/, "* Rails version #{Rails::VERSION::STRING}"
32
-
32
+
33
33
  # Database
34
34
  gsub_file "README.textile", /SQLite/, "PostgreSQL" if prefer :database, 'postgresql'
35
35
  gsub_file "README.textile", /SQLite/, "MySQL" if prefer :database, 'mysql'
@@ -73,7 +73,7 @@ after_everything do
73
73
 
74
74
  git :add => '-A' if prefer :git, true
75
75
  git :commit => '-qm "rails_apps_composer: add README files"' if prefer :git, true
76
-
76
+
77
77
  end # after_everything
78
78
 
79
79
  __END__
data/recipes/routes.rb CHANGED
@@ -33,4 +33,4 @@ author: RailsApps
33
33
 
34
34
  requires: [setup, gems, models, controllers, views]
35
35
  run_after: [setup, gems, models, controllers, views]
36
- category: mvc
36
+ category: mvc
data/recipes/setup.rb CHANGED
@@ -12,9 +12,9 @@ gemfile = File.read(destination_root() + '/Gemfile')
12
12
  sqlite_detected = gemfile.include? 'sqlite3'
13
13
 
14
14
  ## Web Server
15
- prefs[:dev_webserver] = multiple_choice "Web server for development?", [["WEBrick (default)", "webrick"],
15
+ prefs[:dev_webserver] = multiple_choice "Web server for development?", [["WEBrick (default)", "webrick"],
16
16
  ["Thin", "thin"], ["Unicorn", "unicorn"], ["Puma", "puma"]] unless prefs.has_key? :dev_webserver
17
- webserver = multiple_choice "Web server for production?", [["Same as development", "same"],
17
+ webserver = multiple_choice "Web server for production?", [["Same as development", "same"],
18
18
  ["Thin", "thin"], ["Unicorn", "unicorn"], ["Puma", "puma"]] unless prefs.has_key? :prod_webserver
19
19
  if webserver == 'same'
20
20
  case prefs[:dev_webserver]
@@ -30,7 +30,7 @@ else
30
30
  end
31
31
 
32
32
  ## Database Adapter
33
- prefs[:database] = multiple_choice "Database used in development?", [["SQLite", "sqlite"], ["PostgreSQL", "postgresql"],
33
+ prefs[:database] = multiple_choice "Database used in development?", [["SQLite", "sqlite"], ["PostgreSQL", "postgresql"],
34
34
  ["MySQL", "mysql"], ["MongoDB", "mongodb"]] unless prefs.has_key? :database
35
35
  case prefs[:database]
36
36
  when 'mongodb'
@@ -54,14 +54,14 @@ prefs[:templates] = multiple_choice "Template engine?", [["ERB", "erb"], ["Haml"
54
54
  ## Testing Framework
55
55
  if recipes.include? 'testing'
56
56
  prefs[:unit_test] = multiple_choice "Unit testing?", [["Test::Unit", "test_unit"], ["RSpec", "rspec"], ["MiniTest", "minitest"]] unless prefs.has_key? :unit_test
57
- prefs[:integration] = multiple_choice "Integration testing?", [["None", "none"], ["RSpec with Capybara", "rspec-capybara"],
57
+ prefs[:integration] = multiple_choice "Integration testing?", [["None", "none"], ["RSpec with Capybara", "rspec-capybara"],
58
58
  ["Cucumber with Capybara", "cucumber"], ["Turnip with Capybara", "turnip"], ["MiniTest with Capybara", "minitest-capybara"]] unless prefs.has_key? :integration
59
59
  prefs[:fixtures] = multiple_choice "Fixture replacement?", [["None","none"], ["Factory Girl","factory_girl"], ["Machinist","machinist"], ["Fabrication","fabrication"]] unless prefs.has_key? :fixtures
60
60
  end
61
61
 
62
62
  ## Front-end Framework
63
63
  if recipes.include? 'frontend'
64
- prefs[:frontend] = multiple_choice "Front-end framework?", [["None", "none"], ["Twitter Bootstrap", "bootstrap"],
64
+ prefs[:frontend] = multiple_choice "Front-end framework?", [["None", "none"], ["Twitter Bootstrap", "bootstrap"],
65
65
  ["Zurb Foundation", "foundation"], ["Skeleton", "skeleton"], ["Just normalize CSS for consistent styling", "normalize"]] unless prefs.has_key? :frontend
66
66
  if prefer :frontend, 'bootstrap'
67
67
  case HOST_OS
@@ -76,7 +76,7 @@ end
76
76
 
77
77
  ## Email
78
78
  if recipes.include? 'email'
79
- prefs[:email] = multiple_choice "Add support for sending email?", [["None", "none"], ["Gmail","gmail"], ["SMTP","smtp"],
79
+ prefs[:email] = multiple_choice "Add support for sending email?", [["None", "none"], ["Gmail","gmail"], ["SMTP","smtp"],
80
80
  ["SendGrid","sendgrid"], ["Mandrill","mandrill"]] unless prefs.has_key? :email
81
81
  else
82
82
  prefs[:email] = 'none'
@@ -90,11 +90,11 @@ if recipes.include? 'models'
90
90
  if prefer :orm, 'mongoid'
91
91
  prefs[:devise_modules] = multiple_choice "Devise modules?", [["Devise with default modules","default"]] unless prefs.has_key? :devise_modules
92
92
  else
93
- prefs[:devise_modules] = multiple_choice "Devise modules?", [["Devise with default modules","default"], ["Devise with Confirmable module","confirmable"],
93
+ prefs[:devise_modules] = multiple_choice "Devise modules?", [["Devise with default modules","default"], ["Devise with Confirmable module","confirmable"],
94
94
  ["Devise with Confirmable and Invitable modules","invitable"]] unless prefs.has_key? :devise_modules
95
95
  end
96
96
  when 'omniauth'
97
- prefs[:omniauth_provider] = multiple_choice "OmniAuth provider?", [["Facebook", "facebook"], ["Twitter", "twitter"], ["GitHub", "github"],
97
+ prefs[:omniauth_provider] = multiple_choice "OmniAuth provider?", [["Facebook", "facebook"], ["Twitter", "twitter"], ["GitHub", "github"],
98
98
  ["LinkedIn", "linkedin"], ["Google-Oauth-2", "google_oauth2"], ["Tumblr", "tumblr"]] unless prefs.has_key? :omniauth_provider
99
99
  end
100
100
  prefs[:authorization] = multiple_choice "Authorization?", [["None", "none"], ["CanCan with Rolify", "cancan"]] unless prefs.has_key? :authorization
@@ -106,18 +106,18 @@ prefs[:form_builder] = multiple_choice "Use a form builder gem?", [["None", "non
106
106
  ## MVC
107
107
  if (recipes.include? 'models') && (recipes.include? 'controllers') && (recipes.include? 'views') && (recipes.include? 'routes')
108
108
  if prefer :authorization, 'cancan'
109
- prefs[:starter_app] = multiple_choice "Install a starter app?", [["None", "none"], ["Home Page", "home_app"],
109
+ prefs[:starter_app] = multiple_choice "Install a starter app?", [["None", "none"], ["Home Page", "home_app"],
110
110
  ["Home Page, User Accounts", "users_app"], ["Home Page, User Accounts, Admin Dashboard", "admin_app"]] unless prefs.has_key? :starter_app
111
111
  elsif prefer :authentication, 'devise'
112
112
  if prefer :orm, 'mongoid'
113
- prefs[:starter_app] = multiple_choice "Install a starter app?", [["None", "none"], ["Home Page", "home_app"],
113
+ prefs[:starter_app] = multiple_choice "Install a starter app?", [["None", "none"], ["Home Page", "home_app"],
114
114
  ["Home Page, User Accounts", "users_app"], ["Home Page, User Accounts, Subdomains", "subdomains_app"]] unless prefs.has_key? :starter_app
115
115
  else
116
- prefs[:starter_app] = multiple_choice "Install a starter app?", [["None", "none"], ["Home Page", "home_app"],
116
+ prefs[:starter_app] = multiple_choice "Install a starter app?", [["None", "none"], ["Home Page", "home_app"],
117
117
  ["Home Page, User Accounts", "users_app"]] unless prefs.has_key? :starter_app
118
118
  end
119
119
  elsif prefer :authentication, 'omniauth'
120
- prefs[:starter_app] = multiple_choice "Install a starter app?", [["None", "none"], ["Home Page", "home_app"],
120
+ prefs[:starter_app] = multiple_choice "Install a starter app?", [["None", "none"], ["Home Page", "home_app"],
121
121
  ["Home Page, User Accounts", "users_app"]] unless prefs.has_key? :starter_app
122
122
  else
123
123
  prefs[:starter_app] = multiple_choice "Install a starter app?", [["None", "none"], ["Home Page", "home_app"]] unless prefs.has_key? :starter_app
data/recipes/views.rb CHANGED
@@ -54,4 +54,4 @@ author: RailsApps
54
54
 
55
55
  requires: [setup, gems, models, controllers]
56
56
  run_after: [setup, gems, models, controllers]
57
- category: mvc
57
+ category: mvc
@@ -11,7 +11,7 @@ def say_recipe(name); say "\033[1m\033[36m" + "recipe".rjust(10) + "\033[0m" + "
11
11
  def say_wizard(text); say_custom(@current_recipe || 'composer', text) end
12
12
 
13
13
  def ask_wizard(question)
14
- ask "\033[1m\033[30m\033[46m" + (@current_recipe || "prompt").rjust(10) + "\033[1m\033[36m" + " #{question}\033[0m"
14
+ ask "\033[1m\033[36m" + (@current_recipe || "prompt").rjust(10) + "\033[1m\033[36m" + " #{question}\033[0m"
15
15
  end
16
16
 
17
17
  def yes_wizard?(question)
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RailsWizard
2
- VERSION = "2.2.32"
2
+ VERSION = "2.2.33"
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.32
4
+ version: 2.2.33
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: 2013-02-14 00:00:00.000000000 Z
12
+ date: 2013-02-16 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: 2607671084260746200
205
+ hash: -2885590873741171090
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: 2607671084260746200
214
+ hash: -2885590873741171090
215
215
  requirements: []
216
216
  rubyforge_project: rails_apps_composer
217
217
  rubygems_version: 1.8.25