rails_apps_composer 1.0.25 → 1.0.26

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -30,8 +30,8 @@ h2. Dependencies
30
30
 
31
31
  Before generating a new Rails app, you will need:
32
32
 
33
- * The Ruby language (version 1.9.2)
34
- * Rails (3.0 or 3.1)
33
+ * The Ruby language (version 1.9.3)
34
+ * Rails 3.1
35
35
 
36
36
  Recipes will detect which version of Rails is in use. Some of the recipes behave differently depending on the version of Rails.
37
37
 
@@ -76,7 +76,7 @@ $ rails_apps_composer new myapp -r jquery haml
76
76
  For example, to build the "rails3-mongoid-devise":http://github.com/RailsApps/rails3-mongoid-devise/ example application, run the command:
77
77
 
78
78
  <pre>
79
- $ rails_apps_composer new myapp -r jquery haml rspec cucumber guard mongoid action_mailer devise add_user home_page home_page_users seed_database users_page css_setup application_layout navigation cleanup ban_spiders git
79
+ $ rails_apps_composer new myapp -r jquery haml rspec cucumber guard mongoid action_mailer devise add_user home_page home_page_users seed_database users_page css_setup application_layout html5 navigation cleanup ban_spiders extras git
80
80
  </pre>
81
81
 
82
82
  Replace @myapp@ with the name you want for your application.
@@ -127,7 +127,7 @@ To build a reusable application template for the "rails3-devise-rspec-cucumber":
127
127
  $ rake print --silent RECIPES=jquery,haml,rspec,cucumber,guard,action_mailer,devise,add_user,home_page,home_page_users,seed_database,users_page,css_setup,application_layout,html5,navigation,cleanup,ban_spiders,extras,git > ~/Desktop/template.txt
128
128
  </pre>
129
129
 
130
- Then generate the application using the @-T@ flag. Add the @-J@ flag for Rails 3.0.
130
+ Then generate the application using the @-T@ flag.
131
131
 
132
132
  <pre>
133
133
  $ rails new myapp -m ~/Desktop/template.txt -T
@@ -141,7 +141,7 @@ To build a reusable application template for the "rails3-mongoid-devise":http://
141
141
  $ rake print --silent RECIPES=jquery,haml,rspec,cucumber,guard,mongoid,action_mailer,devise,add_user,home_page,home_page_users,seed_database,users_page,css_setup,application_layout,html5,navigation,cleanup,ban_spiders,extras,git > ~/Desktop/template.txt
142
142
  </pre>
143
143
 
144
- Then generate the application using the @-T -O@ flags. Add the @-J@ flag for Rails 3.0.
144
+ Then generate the application using the @-T -O@ flags.
145
145
 
146
146
  <pre>
147
147
  $ rails new myapp -m ~/Desktop/template.txt -T -O
@@ -155,7 +155,21 @@ To build a reusable application template for the "rails3-mongoid-omniauth":http:
155
155
  $ rake print --silent RECIPES=jquery,haml,rspec,cucumber,guard,mongoid,seed_database,add_user,omniauth,home_page,home_page_users,css_setup,application_layout,html5,navigation,users_page,omniauth_email,cleanup,ban_spiders,extras,git > ~/Desktop/template.txt
156
156
  </pre>
157
157
 
158
- Then generate the application using the @-T -O@ flags. Add the @-J@ flag for Rails 3.0.
158
+ Then generate the application using the @-T -O@ flags.
159
+
160
+ <pre>
161
+ $ rails new myapp -m ~/Desktop/template.txt -T -O
162
+ </pre>
163
+
164
+ h4. Template for Rails 3 + Subdomains
165
+
166
+ To build a reusable application template for the "rails3-subdomains":https://github.com/RailsApps/rails3-subdomains example application, run the command:
167
+
168
+ <pre>
169
+ $ rake print --silent RECIPES=jquery,haml,rspec,cucumber,guard,mongoid,action_mailer,devise,add_user,home_page,home_page_users,seed_database,users_page,css_setup,application_layout,subdomains,html5,navigation,cleanup,ban_spiders,extras,git > ~/Desktop/template.txt
170
+ </pre>
171
+
172
+ Then generate the application using the @-T -O@ flags.
159
173
 
160
174
  <pre>
161
175
  $ rails new myapp -m ~/Desktop/template.txt -T -O
data/recipes/cucumber.rb CHANGED
@@ -11,7 +11,7 @@ if config['cucumber']
11
11
  else
12
12
  # for Rails 3.1+, use optimistic versioning for gems
13
13
  gem 'cucumber-rails', '>= 1.2.0', :group => :test
14
- gem 'capybara', '>= 1.1.1', :group => :test
14
+ gem 'capybara', '>= 1.1.2', :group => :test
15
15
  gem 'database_cleaner', '>= 0.7.0', :group => :test
16
16
  gem 'launchy', '>= 2.0.5', :group => :test
17
17
  end
@@ -131,20 +131,21 @@ ERB
131
131
  create_file 'app/views/shared/_navigation.html.haml' do <<-'HAML'
132
132
  %li
133
133
  = link_to 'Main', root_url(:host => request.domain)
134
- - unless request.subdomain.present? && request.subdomain != "www"
134
+ - if request.subdomain.present? && request.subdomain != "www"
135
135
  - if user_signed_in?
136
136
  %li
137
- = link_to('Edit account', edit_user_registration_path)
137
+ = link_to('Edit account', edit_user_registration_url)
138
+ %li
139
+ = link_to('Logout', destroy_user_session_url, :method=>'delete')
138
140
  - else
139
141
  %li
140
- = link_to('Sign up', new_user_registration_path)
142
+ = link_to('Login', new_user_session_url)
141
143
  - else
144
+ %li
145
+ = link_to('Sign up', new_user_registration_url(:host => request.domain))
142
146
  - if user_signed_in?
143
147
  %li
144
- = link_to('Logout', destroy_user_session_path, :method=>'delete')
145
- - else
146
- %li
147
- = link_to('Login', new_user_session_path)
148
+ = link_to('Logout', destroy_user_session_url, :method=>'delete')
148
149
  HAML
149
150
  end
150
151
  end
@@ -13,7 +13,7 @@ if recipes.include? 'haml'
13
13
  when 'one-per-user'
14
14
  # user name as a subdomain
15
15
  inject_into_file 'app/models/user.rb', :before => 'validates_uniqueness_of' do <<-RUBY
16
- validates_format_of :name, with: /^[a-z0-9_]+$/, message: 'must be lowercase alphanumerics only'
16
+ validates_format_of :name, with: /^[a-z0-9_]+$/, message: 'must be lowercase alphanumerics only'
17
17
  validates_length_of :name, maximum: 32, message: 'exceeds maximum of 32 characters'
18
18
  validates_exclusion_of :name, in: ['www', 'mail', 'ftp'], message: 'is not available'
19
19
 
@@ -64,13 +64,26 @@ RUBY
64
64
  # create routes for subdomains
65
65
  gsub_file 'config/routes.rb', /root :to => "home#index"/, ''
66
66
  inject_into_file 'config/routes.rb', :after => 'resources :users, :only => :show' do <<-RUBY
67
+
67
68
  constraints(Subdomain) do
68
69
  match '/' => 'profiles#show'
69
70
  end
70
71
  root :to => "home#index"
71
72
  RUBY
72
73
  end
73
-
74
+ remove_file 'app/views/users/show.html.haml'
75
+ # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
76
+ # We have to use single-quote-style-heredoc to avoid interpolation.
77
+ create_file 'app/views/users/show.html.haml' do
78
+ <<-'HAML'
79
+ %p
80
+ User: #{@user.name}
81
+ %p
82
+ Email: #{@user.email if @user.email}
83
+ %p
84
+ Profile: #{link_to root_url(:subdomain => @user.name), root_url(:subdomain => @user.name)}
85
+ HAML
86
+ end
74
87
  remove_file 'app/views/home/index.html.haml'
75
88
  # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
76
89
  # We have to use single-quote-style-heredoc to avoid interpolation.
@@ -79,10 +92,10 @@ RUBY
79
92
  %h3 Home
80
93
  - @users.each do |user|
81
94
  %br/
82
- User: #{link_to user.name, user}
83
- Profile: #{link_to root_url(:subdomain => user.name), root_url(:subdomain => user.name)}
95
+ #{user.name} profile: #{link_to root_url(:subdomain => user.name), root_url(:subdomain => user.name)}
84
96
  HAML
85
97
  end
98
+ gsub_file 'app/controllers/users_controller.rb', /before_filter :authenticate_user!/, ''
86
99
  end
87
100
  end
88
101
  elsif recipes.include? 'rails 3.0'
@@ -22,7 +22,7 @@ RUBY
22
22
  # Modify the routes
23
23
  #----------------------------------------------------------------------------
24
24
  # @devise_for :users@ route must be placed above @resources :users, :only => :show@.
25
- gsub_file 'config/routes.rb', /get \"users\/show\"/, '#get \"users\/show\"'
25
+ gsub_file 'config/routes.rb', /get \"users\/show\"/, ''
26
26
  gsub_file 'config/routes.rb', /devise_for :users/ do
27
27
  <<-RUBY
28
28
  devise_for :users
data/templates/layout.erb CHANGED
@@ -50,6 +50,7 @@ say_wizard "Checking configuration. Please confirm your preferences."
50
50
  # >---------------------------[ Autoload Modules/Classes ]-----------------------------<
51
51
 
52
52
  inject_into_file 'config/application.rb', :after => 'config.autoload_paths += %W(#{config.root}/extras)' do <<-'RUBY'
53
+
53
54
  config.autoload_paths += %W(#{config.root}/lib)
54
55
  RUBY
55
56
  end
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RailsWizard
2
- VERSION = "1.0.25"
2
+ VERSION = "1.0.26"
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: 1.0.25
4
+ version: 1.0.26
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-15 00:00:00.000000000 Z
12
+ date: 2011-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
16
- requirement: &2153235160 !ruby/object:Gem::Requirement
16
+ requirement: &2161307300 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153235160
24
+ version_requirements: *2161307300
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &2153234660 !ruby/object:Gem::Requirement
27
+ requirement: &2161306780 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2153234660
35
+ version_requirements: *2161306780
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: thor
38
- requirement: &2153234160 !ruby/object:Gem::Requirement
38
+ requirement: &2161306100 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2153234160
46
+ version_requirements: *2161306100
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &2153233600 !ruby/object:Gem::Requirement
49
+ requirement: &2161305540 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 2.5.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2153233600
57
+ version_requirements: *2161305540
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mg
60
- requirement: &2153232980 !ruby/object:Gem::Requirement
60
+ requirement: &2161305000 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2153232980
68
+ version_requirements: *2161305000
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: activesupport
71
- requirement: &2153232320 !ruby/object:Gem::Requirement
71
+ requirement: &2161296980 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 3.0.0
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2153232320
79
+ version_requirements: *2161296980
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: i18n
82
- requirement: &2153231640 !ruby/object:Gem::Requirement
82
+ requirement: &2161296400 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2153231640
90
+ version_requirements: *2161296400
91
91
  description: A gem with recipes to create Rails application templates you can use
92
92
  to generate Rails starter apps.
93
93
  email:
@@ -180,7 +180,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
180
180
  version: '0'
181
181
  segments:
182
182
  - 0
183
- hash: -3880893974405196726
183
+ hash: 1441423725882514269
184
184
  required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  none: false
186
186
  requirements:
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  segments:
191
191
  - 0
192
- hash: -3880893974405196726
192
+ hash: 1441423725882514269
193
193
  requirements: []
194
194
  rubyforge_project: rails_apps_composer
195
195
  rubygems_version: 1.8.11