rails_apps_composer 2.4.44 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails_wizard/diagnostics.rb +3 -0
- data/recipes/core.rb +1 -1
- data/recipes/gems.rb +54 -34
- data/recipes/railsapps.rb +0 -19
- data/recipes/setup.rb +27 -16
- data/recipes/tests4.rb +100 -0
- data/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36ee352051fbe10da787c9650b2d93c1ea4e196a
|
4
|
+
data.tar.gz: c858e82ff0c5be3f9004ca8eca377fb1896d0f80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d5a9ad35ea687c81e626114e1f57a10eefa81cb91776aee25b98e53a43c42edb346daa7404c8a2ba7aa9820f2201f77ae886f7e3e862799d20dc0ad4f529fac
|
7
|
+
data.tar.gz: 135d89811df5767c941828411f38fef1508155320b8d60db3b8afdf11a02abab74d6b7fe8f8b926383d983fc599bcc9958209a2508c9e741f02de7f2847e7bd6
|
@@ -23,6 +23,9 @@ module RailsWizard
|
|
23
23
|
@@recipes << %w(controllers email example extras frontend gems git init models prelaunch railsapps readme routes setup testing views)
|
24
24
|
@@recipes << %w(controllers email example extras frontend gems git init models prelaunch railsapps readme routes saas setup testing views)
|
25
25
|
@@recipes << %w(apps4 controllers core email extras frontend gems git init models prelaunch railsapps readme routes saas setup testing views)
|
26
|
+
@@recipes << %w(apps4 controllers core email extras frontend gems git init models prelaunch railsapps readme routes saas setup testing tests4 views)
|
27
|
+
@@recipes << %w(apps4 controllers core deployment email extras frontend gems git init models prelaunch railsapps readme routes saas setup testing views)
|
28
|
+
@@recipes << %w(apps4 controllers core deployment email extras frontend gems git init models prelaunch railsapps readme routes saas setup testing tests4 views)
|
26
29
|
|
27
30
|
### collections of preferences that are known to work together
|
28
31
|
|
data/recipes/core.rb
CHANGED
@@ -10,5 +10,5 @@ name: core
|
|
10
10
|
description: "Select all core recipes."
|
11
11
|
author: RailsApps
|
12
12
|
|
13
|
-
requires: [git, railsapps, setup, readme, gems, testing, email, models, controllers, views, routes, frontend, init, apps4, prelaunch, saas, extras, deployment]
|
13
|
+
requires: [git, railsapps, setup, readme, gems, testing, tests4, email, models, controllers, views, routes, frontend, init, apps4, prelaunch, saas, extras, deployment]
|
14
14
|
category: collections
|
data/recipes/gems.rb
CHANGED
@@ -63,43 +63,63 @@ if prefer :templates, 'slim'
|
|
63
63
|
end
|
64
64
|
|
65
65
|
## Testing Framework
|
66
|
-
if
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
66
|
+
if rails_4_1?
|
67
|
+
if prefer :tests, 'rspec'
|
68
|
+
add_gem 'rspec-rails', '>= 3.0.0.beta2', :group => [:development, :test]
|
69
|
+
add_gem 'factory_girl_rails', :group => [:development, :test]
|
70
|
+
add_gem 'faker', :group => :test
|
71
|
+
add_gem 'capybara', :group => :test
|
72
|
+
add_gem 'database_cleaner', :group => :test
|
73
|
+
add_gem 'launchy', :group => :test
|
74
|
+
add_gem 'selenium-webdriver', :group => :test
|
75
|
+
if prefer :continuous_testing, 'guard'
|
76
|
+
add_gem 'guard-bundler', :group => :development
|
77
|
+
add_gem 'guard-rails', :group => :development
|
78
|
+
add_gem 'guard-rspec', :group => :development
|
79
|
+
add_gem 'rb-inotify', :group => :development, :require => false
|
80
|
+
add_gem 'rb-fsevent', :group => :development, :require => false
|
81
|
+
add_gem 'rb-fchange', :group => :development, :require => false
|
75
82
|
end
|
76
83
|
end
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
if prefer :
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
84
|
+
else
|
85
|
+
if prefer :unit_test, 'rspec'
|
86
|
+
add_gem 'rspec-rails', :group => [:development, :test]
|
87
|
+
add_gem 'capybara', :group => :test if prefer :integration, 'rspec-capybara'
|
88
|
+
add_gem 'database_cleaner', '1.0.1', :group => :test
|
89
|
+
if prefer :orm, 'mongoid'
|
90
|
+
if rails_4?
|
91
|
+
add_gem 'mongoid-rspec', '>= 1.10.0', :group => :test
|
92
|
+
else
|
93
|
+
add_gem 'mongoid-rspec', :group => :test
|
94
|
+
end
|
95
|
+
end
|
96
|
+
add_gem 'email_spec', :group => :test
|
97
|
+
end
|
98
|
+
if prefer :unit_test, 'minitest'
|
99
|
+
add_gem 'minitest-spec-rails', :group => :test
|
100
|
+
add_gem 'minitest-wscolor', :group => :test
|
101
|
+
add_gem 'capybara', :group => :test if prefer :integration, 'minitest-capybara'
|
102
|
+
end
|
103
|
+
if prefer :integration, 'cucumber'
|
104
|
+
add_gem 'cucumber-rails', :group => :test, :require => false
|
105
|
+
add_gem 'database_cleaner', '1.0.1', :group => :test unless prefer :unit_test, 'rspec'
|
106
|
+
add_gem 'launchy', :group => :test
|
107
|
+
add_gem 'capybara', :group => :test
|
108
|
+
end
|
109
|
+
add_gem 'turnip', '>= 1.1.0', :group => :test if prefer :integration, 'turnip'
|
110
|
+
if prefer :continuous_testing, 'guard'
|
111
|
+
add_gem 'guard-bundler', :group => :development
|
112
|
+
add_gem 'guard-cucumber', :group => :development if prefer :integration, 'cucumber'
|
113
|
+
add_gem 'guard-rails', :group => :development
|
114
|
+
add_gem 'guard-rspec', :group => :development if prefer :unit_test, 'rspec'
|
115
|
+
add_gem 'rb-inotify', :group => :development, :require => false
|
116
|
+
add_gem 'rb-fsevent', :group => :development, :require => false
|
117
|
+
add_gem 'rb-fchange', :group => :development, :require => false
|
118
|
+
end
|
119
|
+
add_gem 'factory_girl_rails', :group => [:development, :test] if prefer :fixtures, 'factory_girl'
|
120
|
+
add_gem 'fabrication', :group => [:development, :test] if prefer :fixtures, 'fabrication'
|
121
|
+
add_gem 'machinist', :group => :test if prefer :fixtures, 'machinist'
|
99
122
|
end
|
100
|
-
add_gem 'factory_girl_rails', :group => [:development, :test] if prefer :fixtures, 'factory_girl'
|
101
|
-
add_gem 'fabrication', :group => [:development, :test] if prefer :fixtures, 'fabrication'
|
102
|
-
add_gem 'machinist', :group => :test if prefer :fixtures, 'machinist'
|
103
123
|
|
104
124
|
## Front-end Framework
|
105
125
|
add_gem 'rails_layout', :group => :development
|
data/recipes/railsapps.rb
CHANGED
@@ -75,9 +75,6 @@ case prefs[:apps4]
|
|
75
75
|
prefs[:templates] = 'erb'
|
76
76
|
prefs[:git] = true
|
77
77
|
prefs[:database] = 'default'
|
78
|
-
prefs[:unit_test] = false
|
79
|
-
prefs[:integration] = false
|
80
|
-
prefs[:fixtures] = false
|
81
78
|
prefs[:frontend] = 'foundation5'
|
82
79
|
prefs[:email] = 'gmail'
|
83
80
|
prefs[:authentication] = false
|
@@ -85,7 +82,6 @@ case prefs[:apps4]
|
|
85
82
|
prefs[:authorization] = false
|
86
83
|
prefs[:starter_app] = false
|
87
84
|
prefs[:form_builder] = 'simple_form'
|
88
|
-
prefs[:continuous_testing] = false
|
89
85
|
prefs[:quiet_assets] = true
|
90
86
|
prefs[:local_env_file] = 'none'
|
91
87
|
prefs[:better_errors] = true
|
@@ -96,9 +92,6 @@ case prefs[:apps4]
|
|
96
92
|
when 'rails-bootstrap'
|
97
93
|
prefs[:git] = true
|
98
94
|
prefs[:database] = 'default'
|
99
|
-
prefs[:unit_test] = false
|
100
|
-
prefs[:integration] = false
|
101
|
-
prefs[:fixtures] = false
|
102
95
|
prefs[:frontend] = 'bootstrap3'
|
103
96
|
prefs[:email] = 'none'
|
104
97
|
prefs[:authentication] = false
|
@@ -114,9 +107,6 @@ case prefs[:apps4]
|
|
114
107
|
when 'rails-foundation'
|
115
108
|
prefs[:git] = true
|
116
109
|
prefs[:database] = 'default'
|
117
|
-
prefs[:unit_test] = false
|
118
|
-
prefs[:integration] = false
|
119
|
-
prefs[:fixtures] = false
|
120
110
|
prefs[:frontend] = 'foundation5'
|
121
111
|
prefs[:email] = 'none'
|
122
112
|
prefs[:authentication] = false
|
@@ -131,9 +121,6 @@ case prefs[:apps4]
|
|
131
121
|
prefs[:deployment] = 'none'
|
132
122
|
when 'rails-devise'
|
133
123
|
prefs[:git] = true
|
134
|
-
prefs[:unit_test] = false
|
135
|
-
prefs[:integration] = false
|
136
|
-
prefs[:fixtures] = false
|
137
124
|
prefs[:authentication] = 'devise'
|
138
125
|
prefs[:authorization] = false
|
139
126
|
prefs[:starter_app] = false
|
@@ -144,9 +131,6 @@ case prefs[:apps4]
|
|
144
131
|
prefs[:deployment] = 'none'
|
145
132
|
when 'rails-devise-pundit'
|
146
133
|
prefs[:git] = true
|
147
|
-
prefs[:unit_test] = false
|
148
|
-
prefs[:integration] = false
|
149
|
-
prefs[:fixtures] = false
|
150
134
|
prefs[:authentication] = 'devise'
|
151
135
|
prefs[:authorization] = 'pundit'
|
152
136
|
prefs[:starter_app] = 'admin_app'
|
@@ -157,9 +141,6 @@ case prefs[:apps4]
|
|
157
141
|
prefs[:deployment] = 'none'
|
158
142
|
when 'rails-omniauth'
|
159
143
|
prefs[:git] = true
|
160
|
-
prefs[:unit_test] = false
|
161
|
-
prefs[:integration] = false
|
162
|
-
prefs[:fixtures] = false
|
163
144
|
prefs[:email] = 'none'
|
164
145
|
prefs[:authentication] = 'omniauth'
|
165
146
|
prefs[:authorization] = 'none'
|
data/recipes/setup.rb
CHANGED
@@ -34,8 +34,13 @@ if prefs[:prod_webserver] == 'same'
|
|
34
34
|
end
|
35
35
|
|
36
36
|
## Database Adapter
|
37
|
-
|
38
|
-
["
|
37
|
+
if rails_4_1?
|
38
|
+
prefs[:database] = multiple_choice "Database used in development?", [["SQLite", "sqlite"], ["PostgreSQL", "postgresql"],
|
39
|
+
["MySQL", "mysql"]] unless prefs.has_key? :database
|
40
|
+
else
|
41
|
+
prefs[:database] = multiple_choice "Database used in development?", [["SQLite", "sqlite"], ["PostgreSQL", "postgresql"],
|
42
|
+
["MySQL", "mysql"], ["MongoDB", "mongodb"]] unless prefs.has_key? :database
|
43
|
+
end
|
39
44
|
case prefs[:database]
|
40
45
|
when 'mongodb'
|
41
46
|
unless sqlite_detected
|
@@ -56,12 +61,24 @@ end
|
|
56
61
|
prefs[:templates] = multiple_choice "Template engine?", [["ERB", "erb"], ["Haml", "haml"], ["Slim", "slim"]] unless prefs.has_key? :templates
|
57
62
|
|
58
63
|
## Testing Framework
|
59
|
-
if
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
64
|
+
if rails_4_1?
|
65
|
+
if recipes.include? 'tests4'
|
66
|
+
prefs[:tests] = multiple_choice "Test framework?", [["None", "none"],
|
67
|
+
["RSpec with Capybara", "rspec"]] unless prefs.has_key? :tests
|
68
|
+
case prefs[:tests]
|
69
|
+
when 'rspec'
|
70
|
+
say_wizard "Adding DatabaseCleaner, FactoryGirl, Faker, Launchy, Selenium"
|
71
|
+
prefs[:continuous_testing] = multiple_choice "Continuous testing?", [["None", "none"], ["Guard", "guard"]] unless prefs.has_key? :continuous_testing
|
72
|
+
end
|
73
|
+
end
|
74
|
+
else
|
75
|
+
if recipes.include? 'testing'
|
76
|
+
prefs[:unit_test] = multiple_choice "Unit testing?", [["Test::Unit", "test_unit"], ["RSpec", "rspec"], ["MiniTest", "minitest"]] unless prefs.has_key? :unit_test
|
77
|
+
prefs[:integration] = multiple_choice "Integration testing?", [["None", "none"], ["RSpec with Capybara", "rspec-capybara"],
|
78
|
+
["Cucumber with Capybara", "cucumber"], ["Turnip with Capybara", "turnip"], ["MiniTest with Capybara", "minitest-capybara"]] unless prefs.has_key? :integration
|
79
|
+
prefs[:continuous_testing] = multiple_choice "Continuous testing?", [["None", "none"], ["Guard", "guard"]] unless prefs.has_key? :continuous_testing
|
80
|
+
prefs[:fixtures] = multiple_choice "Fixture replacement?", [["None","none"], ["Factory Girl","factory_girl"], ["Machinist","machinist"], ["Fabrication","fabrication"]] unless prefs.has_key? :fixtures
|
81
|
+
end
|
65
82
|
end
|
66
83
|
|
67
84
|
## Front-end Framework
|
@@ -91,14 +108,8 @@ if recipes.include? 'models'
|
|
91
108
|
if prefer :orm, 'mongoid'
|
92
109
|
prefs[:devise_modules] = multiple_choice "Devise modules?", [["Devise with default modules","default"]] unless prefs.has_key? :devise_modules
|
93
110
|
else
|
94
|
-
|
95
|
-
|
96
|
-
["Devise with Confirmable module","confirmable"],
|
97
|
-
["Devise with Confirmable and Invitable modules","invitable"]] unless prefs.has_key? :devise_modules
|
98
|
-
else
|
99
|
-
prefs[:devise_modules] = multiple_choice "Devise modules?", [["Devise with default modules","default"],
|
100
|
-
["Devise with Confirmable module","confirmable"]] unless prefs.has_key? :devise_modules
|
101
|
-
end
|
111
|
+
prefs[:devise_modules] = multiple_choice "Devise modules?", [["Devise with default modules","default"],
|
112
|
+
["Devise with Confirmable module","confirmable"]] unless prefs.has_key? :devise_modules
|
102
113
|
end
|
103
114
|
when 'omniauth'
|
104
115
|
prefs[:omniauth_provider] = multiple_choice "OmniAuth provider?", [["Facebook", "facebook"], ["Twitter", "twitter"], ["GitHub", "github"],
|
data/recipes/tests4.rb
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
# Application template recipe for the rails_apps_composer. Change the recipe here:
|
2
|
+
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/tests4.rb
|
3
|
+
|
4
|
+
after_bundler do
|
5
|
+
say_wizard "recipe running after 'bundle install'"
|
6
|
+
### RSPEC ###
|
7
|
+
if prefer :tests, 'rspec'
|
8
|
+
say_wizard "recipe installing RSpec"
|
9
|
+
run 'rm -rf test/' # Removing test folder (not needed for RSpec)
|
10
|
+
generate 'rspec:install'
|
11
|
+
inject_into_file '.rspec', "--format documentation\n", :after => "--color\n"
|
12
|
+
gsub_file 'spec/spec_helper.rb', /ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)/, "ActiveRecord::Migration.maintain_test_schema!"
|
13
|
+
inject_into_file 'config/application.rb', :after => "Rails::Application\n" do <<-RUBY
|
14
|
+
|
15
|
+
config.generators do |g|
|
16
|
+
g.test_framework :rspec,
|
17
|
+
fixtures: true,
|
18
|
+
view_specs: false,
|
19
|
+
helper_specs: false,
|
20
|
+
routing_specs: false,
|
21
|
+
controller_specs: false,
|
22
|
+
request_specs: false
|
23
|
+
g.fixture_replacement :factory_girl, dir: "spec/factories"
|
24
|
+
end
|
25
|
+
|
26
|
+
RUBY
|
27
|
+
end
|
28
|
+
### Configure Launchy to display CSS and JavaScript
|
29
|
+
create_file 'spec/support/capybara.rb', "Capybara.asset_host = 'http://localhost:3000'\n"
|
30
|
+
### Configure Database Cleaner to test JavaScript
|
31
|
+
gsub_file 'spec/spec_helper.rb', /config.use_transactional_fixtures = true/, "config.use_transactional_fixtures = false"
|
32
|
+
create_file 'spec/support/database_cleaner.rb' do
|
33
|
+
<<-RUBY
|
34
|
+
RSpec.configure do |config|
|
35
|
+
config.before(:suite) do
|
36
|
+
DatabaseCleaner.clean_with(:truncation)
|
37
|
+
end
|
38
|
+
|
39
|
+
config.before(:each) do
|
40
|
+
DatabaseCleaner.strategy = :transaction
|
41
|
+
end
|
42
|
+
|
43
|
+
config.before(:each, :js => true) do
|
44
|
+
DatabaseCleaner.strategy = :truncation
|
45
|
+
end
|
46
|
+
|
47
|
+
config.before(:each) do
|
48
|
+
DatabaseCleaner.start
|
49
|
+
end
|
50
|
+
|
51
|
+
config.append_after(:each) do
|
52
|
+
DatabaseCleaner.clean
|
53
|
+
end
|
54
|
+
end
|
55
|
+
RUBY
|
56
|
+
end
|
57
|
+
### Configure FactoryGirl for shortcuts
|
58
|
+
create_file 'spec/support/factory_girl.rb' do
|
59
|
+
<<-RUBY
|
60
|
+
RSpec.configure do |config|
|
61
|
+
config.include FactoryGirl::Syntax::Methods
|
62
|
+
end
|
63
|
+
RUBY
|
64
|
+
end
|
65
|
+
## RSPEC AND DEVISE
|
66
|
+
if prefer :authentication, 'devise'
|
67
|
+
# add Devise test helpers
|
68
|
+
create_file 'spec/support/devise.rb' do
|
69
|
+
<<-RUBY
|
70
|
+
RSpec.configure do |config|
|
71
|
+
config.include Devise::TestHelpers, :type => :controller
|
72
|
+
end
|
73
|
+
RUBY
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
### GUARD
|
78
|
+
if prefer :continuous_testing, 'guard'
|
79
|
+
say_wizard "recipe initializing Guard"
|
80
|
+
run 'bundle exec guard init'
|
81
|
+
end
|
82
|
+
### GIT ###
|
83
|
+
git :add => '-A' if prefer :git, true
|
84
|
+
git :commit => '-qm "rails_apps_composer: testing framework"' if prefer :git, true
|
85
|
+
end # after_bundler
|
86
|
+
|
87
|
+
after_everything do
|
88
|
+
say_wizard "recipe running after everything"
|
89
|
+
# copy tests from repos here
|
90
|
+
end # after_everything
|
91
|
+
|
92
|
+
__END__
|
93
|
+
|
94
|
+
name: tests4
|
95
|
+
description: "Add testing framework."
|
96
|
+
author: RailsApps
|
97
|
+
|
98
|
+
requires: [setup, gems]
|
99
|
+
run_after: [setup, gems]
|
100
|
+
category: testing
|
data/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_apps_composer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Kehoe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -139,6 +139,7 @@ files:
|
|
139
139
|
- recipes/saas.rb
|
140
140
|
- recipes/setup.rb
|
141
141
|
- recipes/testing.rb
|
142
|
+
- recipes/tests4.rb
|
142
143
|
- recipes/views.rb
|
143
144
|
- spec/rails_wizard/config_spec.rb
|
144
145
|
- spec/rails_wizard/recipe_spec.rb
|