rails_apps_composer 1.0.25 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.textile +20 -6
- data/recipes/cucumber.rb +1 -1
- data/recipes/navigation.rb +8 -7
- data/recipes/subdomains.rb +17 -4
- data/recipes/users_page.rb +1 -1
- data/templates/layout.erb +1 -0
- data/version.rb +1 -1
- metadata +18 -18
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.
|
34
|
-
* Rails
|
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.
|
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.
|
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.
|
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.
|
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
|
data/recipes/navigation.rb
CHANGED
@@ -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
|
-
-
|
134
|
+
- if request.subdomain.present? && request.subdomain != "www"
|
135
135
|
- if user_signed_in?
|
136
136
|
%li
|
137
|
-
= link_to('Edit account',
|
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('
|
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',
|
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
|
data/recipes/subdomains.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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'
|
data/recipes/users_page.rb
CHANGED
@@ -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\"/, '
|
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
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.
|
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-
|
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: &
|
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: *
|
24
|
+
version_requirements: *2161307300
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activesupport
|
27
|
-
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: *
|
35
|
+
version_requirements: *2161306780
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: thor
|
38
|
-
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: *
|
46
|
+
version_requirements: *2161306100
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
|
-
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: *
|
57
|
+
version_requirements: *2161305540
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: mg
|
60
|
-
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: *
|
68
|
+
version_requirements: *2161305000
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: activesupport
|
71
|
-
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: *
|
79
|
+
version_requirements: *2161296980
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: i18n
|
82
|
-
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: *
|
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:
|
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:
|
192
|
+
hash: 1441423725882514269
|
193
193
|
requirements: []
|
194
194
|
rubyforge_project: rails_apps_composer
|
195
195
|
rubygems_version: 1.8.11
|