rails_apps_composer 1.0.7 → 1.0.10

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.
@@ -8,6 +8,7 @@ after_bundler do
8
8
  # Set up the default application layout
9
9
  if recipes.include? 'haml'
10
10
  remove_file 'app/views/layouts/application.html.erb'
11
+ remove_file 'app/views/layouts/application.html.haml'
11
12
  # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
12
13
  create_file 'app/views/layouts/application.html.haml' do <<-HAML
13
14
  !!! 5
@@ -29,12 +30,14 @@ HAML
29
30
  gsub_file 'app/views/layouts/application.html.haml', /csrf_meta_tags/, 'csrf_meta_tag'
30
31
  end
31
32
  else
32
- inject_into_file 'app/views/layouts/application.html.erb', :after => "<body>\n" do
33
- <<-ERB
33
+ unless recipes.include? 'boilerplate'
34
+ inject_into_file 'app/views/layouts/application.html.erb', :after => "<body>\n" do
35
+ <<-ERB
34
36
  <%- flash.each do |name, msg| -%>
35
37
  <%= content_tag :div, msg, :id => "flash_\#{name}" if msg.is_a?(String) %>
36
38
  <%- end -%>
37
39
  ERB
40
+ end
38
41
  end
39
42
  end
40
43
 
data/recipes/css_setup.rb CHANGED
@@ -30,10 +30,41 @@ ul.hmenu li {
30
30
  }
31
31
 
32
32
  CSS
33
+
34
+ # Add a stylesheet for use with HTML5 Boilerplate
35
+ css_boilerplate = <<-CSS
36
+
37
+ header nav ul {
38
+ list-style: none;
39
+ margin: 0 0 2em;
40
+ padding: 0;
41
+ }
42
+ header nav ul li {
43
+ display: inline;
44
+ }
45
+ #flash_notice, #flash_alert {
46
+ padding: 5px 8px;
47
+ margin: 10px 0;
48
+ }
49
+ #flash_notice {
50
+ background-color: #CFC;
51
+ border: solid 1px #6C6;
52
+ }
53
+ #flash_alert {
54
+ background-color: #FCC;
55
+ border: solid 1px #C66;
56
+ }
57
+
58
+ CSS
59
+
33
60
  if recipes.include? 'rails 3.0'
34
61
  create_file 'public/stylesheets/application.css', css
35
62
  else
36
- append_file 'app/assets/stylesheets/application.css', css
63
+ if recipes.include? 'boilerplate'
64
+ append_file 'app/assets/stylesheets/application.css', css_boilerplate
65
+ else
66
+ append_file 'app/assets/stylesheets/application.css', css
67
+ end
37
68
  end
38
69
 
39
70
  end
data/recipes/cucumber.rb CHANGED
@@ -10,7 +10,7 @@ if config['cucumber']
10
10
  gem 'launchy', '0.4.0', :group => :test
11
11
  else
12
12
  # for Rails 3.1+, use optimistic versioning for gems
13
- gem 'cucumber-rails', '>= 0.5.2', :group => :test
13
+ gem 'cucumber-rails', '>= 1.0.0', :group => :test
14
14
  gem 'capybara', '>= 1.0.0', :group => :test
15
15
  gem 'database_cleaner', '>= 0.6.7', :group => :test
16
16
  gem 'launchy', '>= 0.4.0', :group => :test
@@ -64,33 +64,36 @@ ERB
64
64
  if recipes.include? 'boilerplate'
65
65
  if recipes.include? 'haml'
66
66
  # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
67
- inject_into_file 'app/views/layouts/application.html.haml', :after => "%body\n" do <<-HAML
68
- %ul.hmenu
69
- = render 'devise/menu/registration_items'
70
- = render 'devise/menu/login_items'
67
+ inject_into_file 'app/views/layouts/application.html.haml', :after => "%header\n" do <<-HAML
68
+ %nav
69
+ %ul
70
+ = render 'devise/menu/registration_items'
71
+ = render 'devise/menu/login_items'
71
72
  HAML
72
73
  end
73
74
  else
74
- inject_into_file 'app/views/layouts/application.html.erb', :after => "<body>\n" do
75
+ inject_into_file 'app/views/layouts/application.html.erb', :after => "<header>\n" do
75
76
  <<-ERB
76
- <ul class="hmenu">
77
- <%= render 'devise/menu/registration_items' %>
78
- <%= render 'devise/menu/login_items' %>
79
- </ul>
77
+ <nav>
78
+ <ul>
79
+ <%= render 'devise/menu/registration_items' %>
80
+ <%= render 'devise/menu/login_items' %>
81
+ </ul>
82
+ </nav>
80
83
  ERB
81
84
  end
82
85
  end
83
86
  else
84
87
  if recipes.include? 'haml'
85
88
  # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
86
- inject_into_file 'app/views/layouts/application.html.haml', :after => "%header\n" do <<-HAML
89
+ inject_into_file 'app/views/layouts/application.html.haml', :after => "%body\n" do <<-HAML
87
90
  %ul.hmenu
88
91
  = render 'devise/menu/registration_items'
89
92
  = render 'devise/menu/login_items'
90
93
  HAML
91
94
  end
92
95
  else
93
- inject_into_file 'app/views/layouts/application.html.erb', :after => "<header>\n" do
96
+ inject_into_file 'app/views/layouts/application.html.erb', :after => "<body>\n" do
94
97
  <<-ERB
95
98
  <ul class="hmenu">
96
99
  <%= render 'devise/menu/registration_items' %>
data/recipes/extras.rb ADDED
@@ -0,0 +1,23 @@
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/extras.rb
3
+
4
+ if config['footnotes']
5
+ say_wizard "Extras recipe running 'after bundler'"
6
+ gem 'rails-footnotes', '>= 3.7', :group => :development
7
+ else
8
+ recipes.delete('footnotes')
9
+ end
10
+
11
+ __END__
12
+
13
+ name: Extras
14
+ description: "Various extras including 'rails-footnotes' for development."
15
+ author: RailsApps
16
+
17
+ category: other
18
+ tags: [utilities, configuration]
19
+
20
+ config:
21
+ - footnotes:
22
+ type: boolean
23
+ prompt: Would you like to use 'rails-footnotes' during development?
@@ -1,29 +1,33 @@
1
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/boilerplate.rb
2
+ # https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/html5.rb
3
3
 
4
- if config['boilerplate']
4
+ if config['html5']
5
5
  if recipes.include? 'rails 3.1'
6
6
  after_bundler do
7
- say_wizard "Boilerplate recipe running 'after bundler'"
7
+ say_wizard "HTML5 Boilerplate recipe running 'after bundler'"
8
8
  # Download HTML5 Boilerplate JavaScripts
9
9
  get "https://raw.github.com/paulirish/html5-boilerplate/master/js/libs/modernizr-2.0.min.js", "app/assets/javascripts/modernizr.js"
10
10
  get "https://raw.github.com/paulirish/html5-boilerplate/master/js/libs/respond.min.js", "app/assets/javascripts/respond.js"
11
- get "https://raw.github.com/paulirish/html5-boilerplate/master/js/plugins.js", "app/assets/javascripts/plugins.js"
12
- # Download HTML5 Boilerplate Stylesheet
13
- get "https://raw.github.com/paulirish/html5-boilerplate/master/css/style.css", "app/assets/stylesheets/boilerplate.scss"
11
+ # Download stylesheet to normalize or reset CSS
12
+ case config['css_option']
13
+ when 'normalize'
14
+ get "https://raw.github.com/necolas/normalize.css/master/normalize.css", "app/assets/stylesheets/normalize.scss"
15
+ when 'reset'
16
+ get "https://raw.github.com/paulirish/html5-boilerplate/master/css/style.css", "app/assets/stylesheets/reset.scss"
17
+ end
14
18
  # Download HTML5 Boilerplate Site Root Assets
15
- get "https://raw.github.com/paulirish/html5-boilerplate/master/apple-touch-icon-114x114-precomposed.png", "app/assets/images/apple-touch-icon-114x114-precomposed.png"
16
- get "https://raw.github.com/paulirish/html5-boilerplate/master/apple-touch-icon-57x57-precomposed.png", "app/assets/images/apple-touch-icon-57x57-precomposed.png"
17
- get "https://raw.github.com/paulirish/html5-boilerplate/master/apple-touch-icon-72x72-precomposed.png", "app/assets/images/apple-touch-icon-72x72-precomposed.png"
18
- get "https://raw.github.com/paulirish/html5-boilerplate/master/apple-touch-icon-precomposed.png", "app/assets/images/apple-touch-icon-precomposed.png"
19
- get "https://raw.github.com/paulirish/html5-boilerplate/master/apple-touch-icon.png", "app/assets/images/apple-touch-icon.png"
19
+ get "https://raw.github.com/paulirish/html5-boilerplate/master/apple-touch-icon-114x114-precomposed.png", "public/apple-touch-icon-114x114-precomposed.png"
20
+ get "https://raw.github.com/paulirish/html5-boilerplate/master/apple-touch-icon-57x57-precomposed.png", "public/apple-touch-icon-57x57-precomposed.png"
21
+ get "https://raw.github.com/paulirish/html5-boilerplate/master/apple-touch-icon-72x72-precomposed.png", "public/apple-touch-icon-72x72-precomposed.png"
22
+ get "https://raw.github.com/paulirish/html5-boilerplate/master/apple-touch-icon-precomposed.png", "public/apple-touch-icon-precomposed.png"
23
+ get "https://raw.github.com/paulirish/html5-boilerplate/master/apple-touch-icon.png", "public/apple-touch-icon.png"
20
24
  get "https://raw.github.com/paulirish/html5-boilerplate/master/crossdomain.xml", "public/crossdomain.xml"
21
25
  get "https://raw.github.com/paulirish/html5-boilerplate/master/humans.txt", "public/humans.txt"
22
26
  # Set up the default application layout
23
27
  if recipes.include? 'haml'
24
- # Haml version of default application layout
25
28
  # create some Haml helpers
26
- inject_into_class 'app/helpers/application_helper.rb', ApplicationHelper do <<-RUBY
29
+ # We have to use single-quote-style-heredoc to avoid interpolation.
30
+ inject_into_file 'app/helpers/application_helper.rb', :after => "ApplicationHelper\n" do <<-'RUBY'
27
31
  # Create a named haml tag to wrap IE conditional around a block
28
32
  # http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
29
33
  def ie_tag(name=:body, attrs={}, &block)
@@ -57,6 +61,7 @@ private
57
61
  end
58
62
  RUBY
59
63
  end
64
+ # Haml version of default application layout
60
65
  remove_file 'app/views/layouts/application.html.erb'
61
66
  remove_file 'app/views/layouts/application.html.haml'
62
67
  # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
@@ -94,12 +99,16 @@ HAML
94
99
  <title>#{app_name}</title>
95
100
  <meta name="description" content="">
96
101
  <meta name="author" content="">
102
+ <%= stylesheet_link_tag "application" %>
103
+ <%= javascript_include_tag "application" %>
104
+ <%= csrf_meta_tags %>
97
105
  </head>
98
106
  <body>
99
107
  <div id="container">
100
108
  <header>
101
109
  </header>
102
110
  <div id="main" role="main">
111
+ <%= yield %>
103
112
  </div>
104
113
  <footer>
105
114
  </footer>
@@ -107,27 +116,28 @@ HAML
107
116
  </body>
108
117
  </html>
109
118
  ERB
119
+ end
110
120
  inject_into_file 'app/views/layouts/application.html.erb', :after => "<header>\n" do
111
121
  <<-ERB
112
- <%- flash.each do |name, msg| -%>
113
- <%= content_tag :div, msg, :id => "flash_\#{name}" if msg.is_a?(String) %>
114
- <%- end -%>
122
+ <%- flash.each do |name, msg| -%>
123
+ <%= content_tag :div, msg, :id => "flash_\#{name}" if msg.is_a?(String) %>
124
+ <%- end -%>
115
125
  ERB
116
126
  end
117
127
  end
118
128
  end
119
129
  elsif recipes.include? 'rails 3.0'
120
- say_wizard "Not supported for Rails version #{Rails::VERSION::STRING}. Boilerplate recipe skipped."
130
+ say_wizard "Not supported for Rails version #{Rails::VERSION::STRING}. HTML5 Boilerplate recipe skipped."
121
131
  else
122
- say_wizard "Don't know what to do for Rails version #{Rails::VERSION::STRING}. Boilerplate recipe skipped."
132
+ say_wizard "Don't know what to do for Rails version #{Rails::VERSION::STRING}. HTML5 Boilerplate recipe skipped."
123
133
  end
124
134
  else
125
- recipes.delete('boilerplate')
135
+ recipes.delete('html5')
126
136
  end
127
137
 
128
138
  __END__
129
139
 
130
- name: boilerplate
140
+ name: html5
131
141
  description: "Install HTML5 Boilerplate."
132
142
  author: RailsApps
133
143
 
@@ -135,7 +145,11 @@ category: other
135
145
  tags: [utilities, configuration]
136
146
 
137
147
  config:
138
- - boilerplate:
148
+ - html5:
139
149
  type: boolean
140
150
  prompt: Would you like to install HTML5 Boilerplate?
151
+ - css_option:
152
+ type: multiple_choice
153
+ prompt: "How do you like your CSS?"
154
+ choices: [["Normalize CSS for consistent styling across browsers", normalize], ["Completely reset all CSS to eliminate styling", reset]]
141
155
 
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RailsWizard
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.10"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rails_apps_composer
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.7
5
+ version: 1.0.10
6
6
  platform: ruby
7
7
  authors:
8
8
  - Daniel Kehoe
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-06-18 00:00:00 Z
13
+ date: 2011-06-21 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: i18n
@@ -111,7 +111,6 @@ files:
111
111
  - recipes/add_user_name.rb
112
112
  - recipes/application_layout.rb
113
113
  - recipes/ban_spiders.rb
114
- - recipes/boilerplate.rb
115
114
  - recipes/capybara.rb
116
115
  - recipes/cleanup.rb
117
116
  - recipes/css_setup.rb
@@ -119,12 +118,14 @@ files:
119
118
  - recipes/devise.rb
120
119
  - recipes/devise_navigation.rb
121
120
  - recipes/env_yaml.rb
121
+ - recipes/extras.rb
122
122
  - recipes/git.rb
123
123
  - recipes/haml.rb
124
124
  - recipes/heroku.rb
125
125
  - recipes/home_page.rb
126
126
  - recipes/home_page_users.rb
127
127
  - recipes/hoptoad.rb
128
+ - recipes/html5.rb
128
129
  - recipes/jammit.rb
129
130
  - recipes/jquery.rb
130
131
  - recipes/less.rb
@@ -176,7 +177,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
177
  requirements:
177
178
  - - ">="
178
179
  - !ruby/object:Gem::Version
179
- hash: 3173488338098663201
180
+ hash: 1920492739263753196
180
181
  segments:
181
182
  - 0
182
183
  version: "0"
@@ -185,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
186
  requirements:
186
187
  - - ">="
187
188
  - !ruby/object:Gem::Version
188
- hash: 3173488338098663201
189
+ hash: 1920492739263753196
189
190
  segments:
190
191
  - 0
191
192
  version: "0"