rails_apps_composer 1.1.8 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -72,7 +72,7 @@ $ rails_apps_composer new myapp -r haml
72
72
  For example, to build the "rails3-mongoid-devise":http://github.com/RailsApps/rails3-mongoid-devise/ example application, run the command:
73
73
 
74
74
  <pre>
75
- $ rails_apps_composer new myapp -r haml rspec cucumber guard mongoid action_mailer devise add_user home_page home_page_users seed_database users_page html5 navigation cleanup extras git
75
+ $ rails_apps_composer new myapp -r haml rspec cucumber guard mongoid action_mailer devise add_user home_page home_page_users seed_database users_page html5 cleanup extras git
76
76
  </pre>
77
77
 
78
78
  Replace @myapp@ with the name you want for your application.
@@ -120,7 +120,7 @@ h4. Template for Rails 3 + Devise + RSpec + Cucumber
120
120
  To build a reusable application template for the "rails3-devise-rspec-cucumber":http://github.com/RailsApps/rails3-devise-rspec-cucumber/ example application, run the command:
121
121
 
122
122
  <pre>
123
- $ rake print --silent RECIPES=haml,rspec,cucumber,guard,action_mailer,devise,add_user,home_page,home_page_users,seed_database,users_page,html5,navigation,cleanup,extras,git > ~/Desktop/template.txt
123
+ $ rake print --silent RECIPES=haml,rspec,cucumber,guard,action_mailer,devise,add_user,home_page,home_page_users,seed_database,users_page,html5,cleanup,extras,git > ~/Desktop/template.txt
124
124
  </pre>
125
125
 
126
126
  Then generate the application using the @-T@ flag.
@@ -134,7 +134,7 @@ h4. Template for Rails 3 + Mongoid + Devise
134
134
  To build a reusable application template for the "rails3-mongoid-devise":http://github.com/RailsApps/rails3-mongoid-devise/ example application, run the command:
135
135
 
136
136
  <pre>
137
- $ rake print --silent RECIPES=haml,rspec,cucumber,guard,mongoid,action_mailer,devise,add_user,home_page,home_page_users,seed_database,users_page,html5,navigation,cleanup,extras,git > ~/Desktop/template.txt
137
+ $ rake print --silent RECIPES=haml,rspec,cucumber,guard,mongoid,action_mailer,devise,add_user,home_page,home_page_users,seed_database,users_page,html5,cleanup,extras,git > ~/Desktop/template.txt
138
138
  </pre>
139
139
 
140
140
  Then generate the application using the @-T -O@ flags.
@@ -148,7 +148,7 @@ h4. Template for Rails 3 + Mongoid + OmniAuth
148
148
  To build a reusable application template for the "rails3-mongoid-omniauth":http://github.com/RailsApps/rails3-mongoid-omniauth/ example application, run the command:
149
149
 
150
150
  <pre>
151
- $ rake print --silent RECIPES=haml,rspec,cucumber,guard,mongoid,seed_database,add_user,omniauth,home_page,home_page_users,html5,navigation,users_page,omniauth_email,cleanup,extras,git > ~/Desktop/template.txt
151
+ $ rake print --silent RECIPES=haml,rspec,cucumber,guard,mongoid,seed_database,add_user,omniauth,home_page,home_page_users,html5,users_page,omniauth_email,cleanup,extras,git > ~/Desktop/template.txt
152
152
  </pre>
153
153
 
154
154
  Then generate the application using the @-T -O@ flags.
@@ -162,7 +162,7 @@ h4. Template for Rails 3 + Subdomains
162
162
  To build a reusable application template for the "rails3-subdomains":https://github.com/RailsApps/rails3-subdomains example application, run the command:
163
163
 
164
164
  <pre>
165
- $ rake print --silent RECIPES=haml,rspec,cucumber,guard,mongoid,action_mailer,devise,add_user,home_page,home_page_users,seed_database,users_page,subdomains,html5,navigation,cleanup,extras,git > ~/Desktop/template.txt
165
+ $ rake print --silent RECIPES=haml,rspec,cucumber,guard,mongoid,action_mailer,devise,add_user,home_page,home_page_users,seed_database,users_page,subdomains,html5,cleanup,extras,git > ~/Desktop/template.txt
166
166
  </pre>
167
167
 
168
168
  Then generate the application using the @-T -O@ flags.
data/recipes/html5.rb CHANGED
@@ -49,10 +49,34 @@ after_bundler do
49
49
  # complex css styles using Twitter Bootstrap
50
50
  get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/twitter-bootstrap/assets/stylesheets/application.css.scss', 'app/assets/stylesheets/application.css.scss'
51
51
  end
52
+ # get an appropriate navigation partial
53
+ if recipes.include? 'haml'
54
+ if recipes.include? 'devise'
55
+ get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/navigation/devise/_navigation.html.haml', 'app/views/layouts/_navigation.html.haml'
56
+ elsif recipes.include? 'omniauth'
57
+ get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/navigation/omniauth/_navigation.html.haml', 'app/views/layouts/_navigation.html.haml'
58
+ elsif recipes.include? 'subdomains'
59
+ get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/navigation/subdomains/_navigation.html.haml', 'app/views/layouts/_navigation.html.haml'
60
+ else
61
+ get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/navigation/none/_navigation.html.haml', 'app/views/layouts/_navigation.html.haml'
62
+ end
63
+ else
64
+ if recipes.include? 'devise'
65
+ get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/navigation/devise/_navigation.html.erb', 'app/views/layouts/_navigation.html.erb'
66
+ elsif recipes.include? 'omniauth'
67
+ get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/navigation/omniauth/_navigation.html.erb', 'app/views/layouts/_navigation.html.erb'
68
+ elsif recipes.include? 'subdomains'
69
+ get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/navigation/subdomains/_navigation.html.erb', 'app/views/layouts/_navigation.html.erb'
70
+ else
71
+ get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/navigation/none/_navigation.html.erb', 'app/views/layouts/_navigation.html.erb'
72
+ end
73
+ end
52
74
  if recipes.include? 'haml'
53
75
  gsub_file 'app/views/layouts/application.html.haml', /App_Name/, "#{app_name.humanize.titleize}"
76
+ gsub_file 'app/views/layouts/_navigation.html.haml', /App_Name/, "#{app_name.humanize.titleize}"
54
77
  else
55
78
  gsub_file 'app/views/layouts/application.html.erb', /App_Name/, "#{app_name.humanize.titleize}"
79
+ gsub_file 'app/views/layouts/_navigation.html.erb', /App_Name/, "#{app_name.humanize.titleize}"
56
80
  end
57
81
  case config['css_option']
58
82
 
@@ -60,7 +84,7 @@ after_bundler do
60
84
  say_wizard 'installing Twitter Bootstrap HTML5 framework (less)'
61
85
  generate 'bootstrap:install'
62
86
  remove_file 'app/assets/stylesheets/application.css' # already created application.css.scss above
63
- insert_into_file 'app/assets/stylesheets/bootstrap_and_overrides.css.less', "body { padding-top: 60px; }\n", :after => "@import "twitter/bootstrap/bootstrap";\n"
87
+ insert_into_file 'app/assets/stylesheets/bootstrap_and_overrides.css.less', "body { padding-top: 60px; }\n", :after => "@import \"twitter/bootstrap/bootstrap\";\n"
64
88
 
65
89
  when 'bootstrap_sass'
66
90
  say_wizard 'installing Twitter Bootstrap HTML5 framework (sass)'
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RailsWizard
2
- VERSION = "1.1.8"
2
+ VERSION = "1.2.0"
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.1.8
4
+ version: 1.2.0
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: 2012-03-06 00:00:00.000000000 Z
12
+ date: 2012-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
16
- requirement: &2161236900 !ruby/object:Gem::Requirement
16
+ requirement: &2157748600 !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: *2161236900
24
+ version_requirements: *2157748600
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &2161236400 !ruby/object:Gem::Requirement
27
+ requirement: &2157748100 !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: *2161236400
35
+ version_requirements: *2157748100
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: thor
38
- requirement: &2161230300 !ruby/object:Gem::Requirement
38
+ requirement: &2157747660 !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: *2161230300
46
+ version_requirements: *2157747660
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &2161229440 !ruby/object:Gem::Requirement
49
+ requirement: &2157747200 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2161229440
57
+ version_requirements: *2157747200
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rspec
60
- requirement: &2161228660 !ruby/object:Gem::Requirement
60
+ requirement: &2157740660 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 2.5.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2161228660
68
+ version_requirements: *2157740660
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mg
71
- requirement: &2161228180 !ruby/object:Gem::Requirement
71
+ requirement: &2157740020 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2161228180
79
+ version_requirements: *2157740020
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: activesupport
82
- requirement: &2161227560 !ruby/object:Gem::Requirement
82
+ requirement: &2157739380 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 3.0.0
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2161227560
90
+ version_requirements: *2157739380
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: i18n
93
- requirement: &2161227120 !ruby/object:Gem::Requirement
93
+ requirement: &2157738900 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *2161227120
101
+ version_requirements: *2157738900
102
102
  description: A gem with recipes to create Rails application templates you can use
103
103
  to generate Rails starter apps.
104
104
  email:
@@ -137,7 +137,6 @@ files:
137
137
  - recipes/mongohq.rb
138
138
  - recipes/mongoid.rb
139
139
  - recipes/mongolab.rb
140
- - recipes/navigation.rb
141
140
  - recipes/omniauth.rb
142
141
  - recipes/omniauth_email.rb
143
142
  - recipes/rails_admin.rb
@@ -178,7 +177,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
178
177
  version: '0'
179
178
  segments:
180
179
  - 0
181
- hash: -4335969651070518607
180
+ hash: 4050339708211014768
182
181
  required_rubygems_version: !ruby/object:Gem::Requirement
183
182
  none: false
184
183
  requirements:
@@ -187,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
186
  version: '0'
188
187
  segments:
189
188
  - 0
190
- hash: -4335969651070518607
189
+ hash: 4050339708211014768
191
190
  requirements: []
192
191
  rubyforge_project: rails_apps_composer
193
192
  rubygems_version: 1.8.16
@@ -1,162 +0,0 @@
1
- # Application template recipe for the rails_apps_composer. Check for a newer version here:
2
- # https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/navigation.rb
3
-
4
- after_bundler do
5
-
6
- say_wizard "Navigation recipe running 'after bundler'"
7
-
8
- if recipes.include? 'devise'
9
- # Create navigation links for Devise
10
- if recipes.include? 'haml'
11
- # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
12
- # We have to use single-quote-style-heredoc to avoid interpolation.
13
- create_file "app/views/shared/_navigation.html.haml" do <<-'HAML'
14
- - if user_signed_in?
15
- %li
16
- = link_to('Logout', destroy_user_session_path, :method=>'delete')
17
- - else
18
- %li
19
- = link_to('Login', new_user_session_path)
20
- - if user_signed_in?
21
- %li
22
- = link_to('Edit account', edit_user_registration_path)
23
- - else
24
- %li
25
- = link_to('Sign up', new_user_registration_path)
26
- HAML
27
- end
28
- else
29
- create_file "app/views/shared/_navigation.html.erb" do <<-ERB
30
- <% if user_signed_in? %>
31
- <li>
32
- <%= link_to('Logout', destroy_user_session_path, :method=>'delete') %>
33
- </li>
34
- <% else %>
35
- <li>
36
- <%= link_to('Login', new_user_session_path) %>
37
- </li>
38
- <% end %>
39
- <% if user_signed_in? %>
40
- <li>
41
- <%= link_to('Edit account', edit_user_registration_path) %>
42
- </li>
43
- <% else %>
44
- <li>
45
- <%= link_to('Sign up', new_user_registration_path) %>
46
- </li>
47
- <% end %>
48
- ERB
49
- end
50
- end
51
-
52
- else
53
- # Create navigation links
54
- if recipes.include? 'haml'
55
- # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
56
- # We have to use single-quote-style-heredoc to avoid interpolation.
57
- create_file "app/views/shared/_navigation.html.haml" do <<-'HAML'
58
- - if user_signed_in?
59
- %li
60
- Logged in as #{current_user.name}
61
- %li
62
- = link_to('Logout', signout_path)
63
- - else
64
- %li
65
- = link_to('Login', signin_path)
66
- HAML
67
- end
68
- else
69
- create_file "app/views/shared/_navigation.html.erb" do <<-ERB
70
- <% if user_signed_in? %>
71
- <li>
72
- Logged in as <%= current_user.name %>
73
- </li>
74
- <li>
75
- <%= link_to('Logout', signout_path) %>
76
- </li>
77
- <% else %>
78
- <li>
79
- <%= link_to('Login', signin_path) %>
80
- </li>
81
- <% end %>
82
- ERB
83
- end
84
- end
85
- end
86
-
87
- # Add navigation links to the default application layout
88
- if recipes.include? 'html5'
89
- if recipes.include? 'haml'
90
- # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
91
- inject_into_file 'app/views/layouts/application.html.haml', :after => "%header\n" do <<-HAML
92
- %nav
93
- %ul.hmenu
94
- = render 'shared/navigation'
95
- HAML
96
- end
97
- else
98
- inject_into_file 'app/views/layouts/application.html.erb', :after => "<header>\n" do <<-ERB
99
- <nav>
100
- <ul class="hmenu">
101
- <%= render 'shared/navigation' %>
102
- </ul>
103
- </nav>
104
- ERB
105
- end
106
- end
107
- else
108
- if recipes.include? 'haml'
109
- # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
110
- inject_into_file 'app/views/layouts/application.html.haml', :after => "%body\n" do <<-HAML
111
- %ul.hmenu
112
- = render 'shared/navigation'
113
- HAML
114
- end
115
- else
116
- inject_into_file 'app/views/layouts/application.html.erb', :after => "<body>\n" do
117
- <<-ERB
118
- <ul class="hmenu">
119
- <%= render 'shared/navigation' %>
120
- </ul>
121
- ERB
122
- end
123
- end
124
- end
125
-
126
- # Throw it all away and create new navigation if we're enabling subdomains
127
- if recipes.include? 'subdomains'
128
- remove_file 'app/views/shared/_navigation.html.haml'
129
- # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
130
- # We have to use single-quote-style-heredoc to avoid interpolation.
131
- create_file 'app/views/shared/_navigation.html.haml' do <<-'HAML'
132
- %li
133
- = link_to 'Main', root_url(:host => request.domain)
134
- - if request.subdomain.present? && request.subdomain != "www"
135
- - if user_signed_in?
136
- %li
137
- = link_to('Edit account', edit_user_registration_url)
138
- %li
139
- = link_to('Logout', destroy_user_session_url, :method=>'delete')
140
- - else
141
- %li
142
- = link_to('Login', new_user_session_url)
143
- - else
144
- %li
145
- = link_to('Sign up', new_user_registration_url(:host => request.domain))
146
- - if user_signed_in?
147
- %li
148
- = link_to('Logout', destroy_user_session_url, :method=>'delete')
149
- HAML
150
- end
151
- end
152
-
153
- end
154
-
155
- __END__
156
-
157
- name: Navigation
158
- description: "Add navigation links."
159
- author: RailsApps
160
-
161
- category: other
162
- tags: [utilities, configuration]