html5-rails 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -2,13 +2,14 @@ source 'http://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'rails', '3.2.9'
5
+ gem 'rails', '3.2.13'
6
6
 
7
7
  # Bundle edge Rails instead:
8
8
  # gem 'rails', :git => 'git://github.com/rails/rails.git'
9
9
 
10
10
  gem 'sqlite3'
11
11
 
12
+
12
13
  # Gems used only for assets and not required
13
14
  # in production environments by default.
14
15
  group :assets do
@@ -21,6 +22,7 @@ end
21
22
 
22
23
  gem 'jquery-rails'
23
24
  gem 'haml-rails'
25
+ gem 'slim-rails'
24
26
 
25
27
  # To use debugger
26
28
  # gem 'ruby-debug19', :require => 'ruby-debug'
data/README.md CHANGED
@@ -20,7 +20,10 @@ group :assets do
20
20
  gem 'compass-h5bp'
21
21
  end
22
22
 
23
- gem 'haml-rails' # Optional - to generate haml
23
+ # Optional - to generate haml
24
+ #gem 'haml-rails'
25
+ # Optional - to generate slim
26
+ #gem 'slim-rails'
24
27
 
25
28
  gem 'jquery-rails'
26
29
  gem 'html5-rails'
@@ -98,5 +101,5 @@ config/production.rb so that polyfills are precompiled on deploy:
98
101
  License
99
102
  ========
100
103
 
101
- Copyright (c) 2010-2012 Peter Gumeson.
104
+ Copyright (c) 2010-2013 Peter Gumeson.
102
105
  See [LICENSE](https://github.com/sporkd/html5-rails/blob/master/LICENSE) for full license.
@@ -0,0 +1,17 @@
1
+ doctype 5
2
+ / http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
3
+ - html_tag :class => "no-js" do
4
+ = render "head"
5
+
6
+ body class=controller.controller_name
7
+ = render "chromeframe"
8
+ = render "header"
9
+
10
+ #main role="main"
11
+ = render "flashes"
12
+ = yield
13
+
14
+ = render "footer"
15
+
16
+ / Javascript at the bottom for fast page loading
17
+ = render "javascripts"
@@ -0,0 +1,4 @@
1
+ /[if lt IE 7 ]
2
+ p.chromeframe
3
+ | You are using an <strong>outdated</strong> browser.
4
+ | Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
@@ -0,0 +1,5 @@
1
+ #flash
2
+ - flash.each do |key, value|
3
+ .wrapper
4
+ div title=key.to_s.humanize class=key
5
+ p= value
@@ -0,0 +1,3 @@
1
+ footer#footer
2
+ small.copyright
3
+ | <%=application_title%>, Copyright &copy; #{Date.today.year}
@@ -0,0 +1,25 @@
1
+ head
2
+ meta charset="utf-8"
3
+
4
+ / Use the .htaccess and remove these lines to avoid edge case issues.
5
+ / More info: h5bp.com/b/378
6
+ meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'
7
+
8
+ title
9
+ | #{ controller.controller_name.titleize } - #{ controller.action_name.titleize }
10
+
11
+ meta name="description" content=""
12
+
13
+ / Mobile viewport optimized: h5bp.com/viewport
14
+ meta name="viewport" content="width=device-width"
15
+
16
+ / Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons
17
+
18
+ = render "stylesheets"
19
+
20
+ / More ideas for your <head> here: h5bp.com/d/head-Tips
21
+
22
+ / All JavaScript at the bottom, except polyfills
23
+ = javascript_include_tag "polyfills"
24
+
25
+ = csrf_meta_tag
@@ -0,0 +1,2 @@
1
+ header#header
2
+ h1 <%= application_title %>
@@ -0,0 +1,13 @@
1
+ = javascript_include_tag "application"
2
+
3
+ / Append your own using content_for :javascripts
4
+ = yield :javascripts
5
+
6
+ / asynchronous google analytics: mathiasbynens.be/notes/async-analytics-snippet
7
+ / Looks for google_account_id first in ENV['GOOGLE_ACCOUNT_ID'] then in config/html5_rails.yml
8
+ - if !google_account_id.blank?
9
+ :javascript
10
+ var _gaq=[['_setAccount','\#{ google_account_id }'],['_trackPageview']];
11
+ (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
12
+ g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
13
+ s.parentNode.insertBefore(g,s)}(document,'script'));
@@ -0,0 +1,4 @@
1
+ = stylesheet_link_tag 'application', :media => nil
2
+
3
+ / Append your own using content_for :stylesheets
4
+ = yield :stylesheets
@@ -18,6 +18,12 @@ module Html5
18
18
  haml_concat("<!--<![endif]-->".html_safe)
19
19
  yield
20
20
  end
21
+ elsif block_given? && defined? Slim
22
+ html = html.html_safe
23
+ html << tag(:html, attrs, true)
24
+ html << " <!--<![endif]-->\n".html_safe
25
+ html << "#{yield}"
26
+ html
21
27
  else
22
28
  html = html.html_safe
23
29
  html << tag(:html, attrs, true)
@@ -1,6 +1,6 @@
1
1
  module Html5
2
2
  module Rails
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  COMPASS_H5BP_VERSION = "0.1.0"
5
5
  end
6
6
  end
@@ -26,6 +26,12 @@ class InstallGeneratorTest < Rails::Generators::TestCase
26
26
  assert_file "app/views/layouts/application.html.haml"
27
27
  end
28
28
 
29
+ test "with flag --template-engine=slim" do
30
+ run_generator ["--template-engine=slim"]
31
+ assert_no_file "app/views/layouts/application.html.erb"
32
+ assert_file "app/views/layouts/application.html.slim"
33
+ end
34
+
29
35
  test "minimal application partials should be generated" do
30
36
  run_generator
31
37
  %w(_footer _head _header _chromeframe).each do |file|
@@ -5,7 +5,7 @@ class LayoutGeneratorTest < Rails::Generators::TestCase
5
5
  include GeneratorTestHelper
6
6
  tests Html5::Generators::LayoutGenerator
7
7
 
8
- %w(erb haml).each do |engine|
8
+ %w(erb haml slim).each do |engine|
9
9
  defaults = ["--template-engine=#{ engine }"]
10
10
 
11
11
  test "html5:layout --template-engine=#{ engine }" do
@@ -5,7 +5,7 @@ class PartialGeneratorTest < Rails::Generators::TestCase
5
5
  include GeneratorTestHelper
6
6
  tests Html5::Generators::PartialGenerator
7
7
 
8
- %w(erb haml).each do |engine|
8
+ %w(erb haml slim).each do |engine|
9
9
  defaults = ["--template-engine=#{ engine }"]
10
10
 
11
11
  test "html5:partial --template-engine=#{ engine }" do
@@ -1,5 +1,5 @@
1
1
  # Define a bare test case to use with Capybara
2
2
  class ActiveSupport::IntegrationCase < ActiveSupport::TestCase
3
- include Capybara
3
+ include Capybara::DSL
4
4
  include Rails.application.routes.url_helpers
5
- end
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html5-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
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-11-29 00:00:00.000000000 Z
12
+ date: 2013-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jquery-rails
@@ -117,22 +117,30 @@ files:
117
117
  - lib/generators/html5/layout/layout_generator.rb
118
118
  - lib/generators/html5/layout/templates/application.html.erb
119
119
  - lib/generators/html5/layout/templates/application.html.haml
120
+ - lib/generators/html5/layout/templates/application.html.slim
120
121
  - lib/generators/html5/partial/USAGE
121
122
  - lib/generators/html5/partial/partial_generator.rb
122
123
  - lib/generators/html5/partial/templates/_chromeframe.html.erb
123
124
  - lib/generators/html5/partial/templates/_chromeframe.html.haml
125
+ - lib/generators/html5/partial/templates/_chromeframe.html.slim
124
126
  - lib/generators/html5/partial/templates/_flashes.html.erb
125
127
  - lib/generators/html5/partial/templates/_flashes.html.haml
128
+ - lib/generators/html5/partial/templates/_flashes.html.slim
126
129
  - lib/generators/html5/partial/templates/_footer.html.erb
127
130
  - lib/generators/html5/partial/templates/_footer.html.haml
131
+ - lib/generators/html5/partial/templates/_footer.html.slim
128
132
  - lib/generators/html5/partial/templates/_head.html.erb
129
133
  - lib/generators/html5/partial/templates/_head.html.haml
134
+ - lib/generators/html5/partial/templates/_head.html.slim
130
135
  - lib/generators/html5/partial/templates/_header.html.erb
131
136
  - lib/generators/html5/partial/templates/_header.html.haml
137
+ - lib/generators/html5/partial/templates/_header.html.slim
132
138
  - lib/generators/html5/partial/templates/_javascripts.html.erb
133
139
  - lib/generators/html5/partial/templates/_javascripts.html.haml
140
+ - lib/generators/html5/partial/templates/_javascripts.html.slim
134
141
  - lib/generators/html5/partial/templates/_stylesheets.html.erb
135
142
  - lib/generators/html5/partial/templates/_stylesheets.html.haml
143
+ - lib/generators/html5/partial/templates/_stylesheets.html.slim
136
144
  - lib/html5-rails.rb
137
145
  - lib/html5/rails.rb
138
146
  - lib/html5/rails/engine.rb
@@ -206,18 +214,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
206
214
  - - ! '>='
207
215
  - !ruby/object:Gem::Version
208
216
  version: '0'
209
- segments:
210
- - 0
211
- hash: -3740377307747398142
212
217
  required_rubygems_version: !ruby/object:Gem::Requirement
213
218
  none: false
214
219
  requirements:
215
220
  - - ! '>='
216
221
  - !ruby/object:Gem::Version
217
222
  version: '0'
218
- segments:
219
- - 0
220
- hash: -3740377307747398142
221
223
  requirements: []
222
224
  rubyforge_project: html5-rails
223
225
  rubygems_version: 1.8.23