rails_apps_composer 2.2.2 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rails_wizard/diagnostics.rb +16 -5
- data/recipes/controllers.rb +4 -1
- data/recipes/frontend.rb +11 -3
- data/recipes/init.rb +2 -2
- data/recipes/setup.rb +1 -3
- data/templates/layout.erb +1 -0
- data/version.rb +1 -1
- metadata +4 -4
@@ -16,18 +16,29 @@ module RailsWizard
|
|
16
16
|
@@recipes << %w(gems git readme setup)
|
17
17
|
@@recipes << %w(extras gems git readme setup)
|
18
18
|
@@recipes << %w(controllers email extras frontend gems git init models railsapps readme routes setup testing views)
|
19
|
-
@@recipes << %w(
|
19
|
+
@@recipes << %w(controllers core email extras frontend gems git init models railsapps readme routes setup testing views)
|
20
|
+
@@recipes << %w(controllers core email extras frontend gems git init models prelaunch railsapps readme routes setup testing views)
|
20
21
|
@@recipes << %w(controllers email example extras frontend gems git init models railsapps readme routes setup testing views)
|
21
22
|
@@recipes << %w(controllers email example extras frontend gems git init models prelaunch railsapps readme routes setup testing views)
|
22
|
-
|
23
|
-
|
23
|
+
|
24
24
|
### collections of preferences that are known to work together
|
25
|
+
|
26
|
+
# ignore these preferences (because they don't cause conflicts)
|
27
|
+
# :git
|
28
|
+
# :dev_webserver
|
29
|
+
# :prod_webserver
|
30
|
+
# :templates
|
31
|
+
# :ban_spiders
|
32
|
+
# :jsruntime
|
33
|
+
# :rvmrc
|
34
|
+
|
25
35
|
@@prefs = []
|
26
|
-
@@prefs << {:railsapps=>"rails3-bootstrap-devise-cancan", :database=>"sqlite", :
|
27
|
-
@@prefs << {:railsapps=>"rails3-devise-rspec-cucumber", :database=>"sqlite", :
|
36
|
+
@@prefs << {:railsapps=>"rails3-bootstrap-devise-cancan", :database=>"sqlite", :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"}
|
37
|
+
@@prefs << {:railsapps=>"rails3-devise-rspec-cucumber", :database=>"sqlite", :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"}
|
28
38
|
@@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'}
|
29
39
|
@@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'}
|
30
40
|
@@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'}
|
41
|
+
@@prefs << {:railsapps=>"none", :database=>"sqlite", :unit_test=>"rspec", :integration=>"capybara", :fixtures=>"factory_girl", :frontend=>"bootstrap", :bootstrap=>"sass", :email=>"none", :authentication=>"omniauth", :omniauth_provider=>"twitter", :authorization=>"cancan", :form_builder=>"none", :starter_app=>"admin_app"}
|
31
42
|
|
32
43
|
def self.recipes
|
33
44
|
@@recipes
|
data/recipes/controllers.rb
CHANGED
@@ -8,7 +8,7 @@ after_bundler do
|
|
8
8
|
copy_from_repo 'app/controllers/application_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-mongoid-omniauth/master/'
|
9
9
|
end
|
10
10
|
if prefer :authorization, 'cancan'
|
11
|
-
inject_into_file 'app/controllers/application_controller.rb', :before =>
|
11
|
+
inject_into_file 'app/controllers/application_controller.rb', :before => "\nend" do <<-RUBY
|
12
12
|
rescue_from CanCan::AccessDenied do |exception|
|
13
13
|
redirect_to root_path, :alert => exception.message
|
14
14
|
end
|
@@ -39,6 +39,9 @@ RUBY
|
|
39
39
|
filename = 'app/controllers/sessions_controller.rb'
|
40
40
|
copy_from_repo filename, :repo => 'https://raw.github.com/RailsApps/rails3-mongoid-omniauth/master/'
|
41
41
|
gsub_file filename, /twitter/, prefs[:omniauth_provider] unless prefer :omniauth_provider, 'twitter'
|
42
|
+
if prefer :authorization, 'cancan'
|
43
|
+
inject_into_file filename, " user.add_role :admin if User.count == 1 # make the first user an admin\n", :after => "session[:user_id] = user.id\n"
|
44
|
+
end
|
42
45
|
end
|
43
46
|
### PROFILES_CONTROLLER ###
|
44
47
|
copy_from_repo 'app/controllers/profiles_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-subdomains/master/' if prefer :starter_app, 'subdomains_app'
|
data/recipes/frontend.rb
CHANGED
@@ -9,9 +9,17 @@ after_bundler do
|
|
9
9
|
copy_from_repo 'app/views/layouts/_messages.html.erb'
|
10
10
|
copy_from_repo 'app/views/layouts/_messages-bootstrap.html.erb', :prefs => 'bootstrap'
|
11
11
|
copy_from_repo 'app/views/layouts/_navigation.html.erb'
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
if prefer :authorization, 'cancan'
|
13
|
+
case prefs[:authentication]
|
14
|
+
when 'devise'
|
15
|
+
copy_from_repo 'app/views/layouts/_navigation-cancan.html.erb', :prefs => 'cancan'
|
16
|
+
when 'omniauth'
|
17
|
+
copy_from 'https://raw.github.com/RailsApps/rails-composer/master/files/app/views/layouts/_navigation-cancan-omniauth.html.erb', 'app/views/layouts/_navigation.html.erb'
|
18
|
+
end
|
19
|
+
else
|
20
|
+
copy_from_repo 'app/views/layouts/_navigation-devise.html.erb', :prefs => 'devise'
|
21
|
+
copy_from_repo 'app/views/layouts/_navigation-omniauth.html.erb', :prefs => 'omniauth'
|
22
|
+
end
|
15
23
|
copy_from_repo 'app/views/layouts/_navigation-subdomains_app.html.erb', :prefs => 'subdomains_app'
|
16
24
|
## APPLICATION NAME
|
17
25
|
application_layout_file = Dir['app/views/layouts/application.html.*'].first
|
data/recipes/init.rb
CHANGED
@@ -46,12 +46,12 @@ FILE
|
|
46
46
|
end
|
47
47
|
### APPLY SEED ###
|
48
48
|
unless prefer :orm, 'mongoid'
|
49
|
-
##
|
49
|
+
## ACTIVE_RECORD
|
50
50
|
say_wizard "applying migrations and seeding the database"
|
51
51
|
run 'bundle exec rake db:migrate'
|
52
52
|
run 'bundle exec rake db:test:prepare'
|
53
53
|
else
|
54
|
-
##
|
54
|
+
## MONGOID
|
55
55
|
say_wizard "dropping database, creating indexes and seeding the database"
|
56
56
|
run 'bundle exec rake db:drop'
|
57
57
|
run 'bundle exec rake db:mongoid:create_indexes'
|
data/recipes/setup.rb
CHANGED
@@ -90,9 +90,7 @@ if recipes.include? 'models'
|
|
90
90
|
prefs[:omniauth_provider] = multiple_choice "OmniAuth provider?", [["Facebook", "facebook"], ["Twitter", "twitter"], ["GitHub", "github"],
|
91
91
|
["LinkedIn", "linkedin"], ["Google-Oauth-2", "google-oauth2"], ["Tumblr", "tumblr"]] unless prefs.has_key? :omniauth_provider
|
92
92
|
end
|
93
|
-
|
94
|
-
prefs[:authorization] = multiple_choice "Authorization?", [["None", "none"], ["CanCan with Rolify", "cancan"]] unless prefs.has_key? :authorization
|
95
|
-
end
|
93
|
+
prefs[:authorization] = multiple_choice "Authorization?", [["None", "none"], ["CanCan with Rolify", "cancan"]] unless prefs.has_key? :authorization
|
96
94
|
end
|
97
95
|
|
98
96
|
## Form Builder
|
data/templates/layout.erb
CHANGED
@@ -79,6 +79,7 @@ redacted_prefs = prefs.clone
|
|
79
79
|
redacted_prefs.delete(:git)
|
80
80
|
redacted_prefs.delete(:dev_webserver)
|
81
81
|
redacted_prefs.delete(:prod_webserver)
|
82
|
+
redacted_prefs.delete(:templates)
|
82
83
|
redacted_prefs.delete(:ban_spiders)
|
83
84
|
redacted_prefs.delete(:jsruntime)
|
84
85
|
redacted_prefs.delete(:rvmrc)
|
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.2.
|
4
|
+
version: 2.2.3
|
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-28 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:
|
204
|
+
hash: -4080718973943065094
|
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:
|
213
|
+
hash: -4080718973943065094
|
214
214
|
requirements: []
|
215
215
|
rubyforge_project: rails_apps_composer
|
216
216
|
rubygems_version: 1.8.24
|