html5-rails 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. data/Gemfile +13 -12
  2. data/LICENSE +20 -0
  3. data/README.md +58 -3
  4. data/app/assets/javascripts/application.js +9 -1
  5. data/app/assets/javascripts/polyfills.js +9 -1
  6. data/app/views/application/_flashes.html.erb +9 -0
  7. data/app/views/application/_footer.html.erb +5 -0
  8. data/app/views/application/_head.html.erb +25 -0
  9. data/app/views/application/_header.html.erb +3 -0
  10. data/app/views/application/_javascripts.html.erb +24 -0
  11. data/app/views/application/_stylesheets.html.erb +4 -0
  12. data/app/views/layouts/application.html.erb +25 -0
  13. data/html5-rails.gemspec +4 -2
  14. data/lib/generators/html5/assets/USAGE +11 -0
  15. data/lib/generators/html5/assets/assets_generator.rb +63 -0
  16. data/lib/generators/html5/assets/templates/javascripts/application.js +9 -0
  17. data/lib/generators/html5/assets/templates/javascripts/polyfills.js +10 -0
  18. data/lib/generators/html5/assets/templates/stylesheets/_defaults.css.scss +18 -0
  19. data/lib/generators/html5/assets/templates/stylesheets/application.css.scss +42 -0
  20. data/lib/generators/html5/assets/templates/stylesheets/application/_defaults.css.scss +7 -0
  21. data/lib/generators/html5/assets/templates/stylesheets/application/document.css.scss +9 -0
  22. data/lib/generators/html5/assets/templates/stylesheets/application/media_queries.css.scss +17 -0
  23. data/lib/generators/html5/generator_helpers.rb +37 -0
  24. data/lib/generators/html5/install/USAGE +1 -0
  25. data/lib/generators/html5/install/install_generator.rb +18 -3
  26. data/lib/generators/html5/install/templates/README +10 -2
  27. data/lib/generators/html5/install/templates/{compass.rb → config/compass.rb} +1 -1
  28. data/lib/generators/html5/install/templates/config/html5_rails.yml +26 -0
  29. data/lib/generators/html5/layout/USAGE +8 -0
  30. data/lib/generators/html5/layout/layout_generator.rb +44 -0
  31. data/lib/generators/html5/layout/templates/application.html.erb +25 -0
  32. data/lib/generators/html5/layout/templates/application.html.haml +16 -0
  33. data/lib/generators/html5/partial/USAGE +8 -0
  34. data/lib/generators/html5/partial/partial_generator.rb +77 -0
  35. data/lib/generators/html5/partial/templates/_flashes.html.erb +9 -0
  36. data/lib/generators/html5/partial/templates/_flashes.html.haml +5 -0
  37. data/lib/generators/html5/partial/templates/_footer.html.erb +5 -0
  38. data/lib/generators/html5/partial/templates/_footer.html.haml +3 -0
  39. data/lib/generators/html5/partial/templates/_head.html.erb +25 -0
  40. data/lib/generators/html5/partial/templates/_head.html.haml +28 -0
  41. data/lib/generators/html5/partial/templates/_header.html.erb +3 -0
  42. data/lib/generators/html5/partial/templates/_header.html.haml +2 -0
  43. data/lib/generators/html5/partial/templates/_javascripts.html.erb +24 -0
  44. data/lib/generators/html5/partial/templates/_javascripts.html.haml +19 -0
  45. data/lib/generators/html5/partial/templates/_stylesheets.html.erb +4 -0
  46. data/lib/generators/html5/partial/templates/_stylesheets.html.haml +4 -0
  47. data/lib/html5/rails.rb +1 -1
  48. data/lib/html5/rails/engine.rb +1 -1
  49. data/lib/html5/rails/{boilerplate_helper.rb → helpers.rb} +12 -10
  50. data/lib/html5/rails/version.rb +3 -5
  51. data/test/dummy/.gitignore +15 -5
  52. data/test/dummy/app/assets/javascripts/application.js +9 -2
  53. data/test/dummy/app/assets/stylesheets/application.css +7 -0
  54. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  55. data/test/dummy/app/views/pages/home.html.erb +1 -0
  56. data/test/dummy/config/application.rb +9 -4
  57. data/test/dummy/config/environments/development.rb +3 -0
  58. data/test/dummy/config/environments/production.rb +11 -2
  59. data/test/dummy/config/initializers/wrap_parameters.rb +5 -3
  60. data/test/dummy/config/routes.rb +1 -1
  61. data/test/dummy/db/seeds.rb +7 -0
  62. data/test/dummy/doc/README_FOR_APP +2 -0
  63. data/test/dummy/lib/assets/.gitkeep +0 -0
  64. data/test/generators/assets_generator_test.rb +60 -0
  65. data/test/generators/install_generator_test.rb +44 -3
  66. data/test/generators/layout_generator_test.rb +71 -0
  67. data/test/generators/partial_generator_test.rb +75 -0
  68. data/test/support/generator_test_helper.rb +18 -0
  69. data/test/test_helper.rb +4 -8
  70. data/{app/assets/javascripts/html5/boilerplate → vendor/assets/javascripts/h5bp}/index.js +0 -0
  71. data/vendor/assets/javascripts/h5bp/plugins.js +15 -0
  72. data/vendor/assets/javascripts/modernizr.min.js +3 -3
  73. metadata +115 -72
  74. data/LICENSE.rb +0 -3
  75. data/app/assets/javascripts/html5/boilerplate/plugins.js +0 -16
  76. data/app/assets/javascripts/html5/boilerplate/polyfills.js +0 -2
  77. data/app/views/application/_flashes.html.haml +0 -4
  78. data/app/views/application/_footer.html.haml +0 -2
  79. data/app/views/application/_head.html.haml +0 -24
  80. data/app/views/application/_header.html.haml +0 -1
  81. data/app/views/application/_javascripts.html.haml +0 -27
  82. data/app/views/application/_stylesheets.html.haml +0 -5
  83. data/app/views/layouts/application.html.haml +0 -20
  84. data/test/dummy/app/assets/stylesheets/application.css.scss +0 -19
  85. data/test/dummy/app/assets/stylesheets/partials/_media.css.scss +0 -22
  86. data/test/dummy/app/views/pages/home.html.haml +0 -2
  87. data/test/dummy/config/initializers/sass.rb +0 -3
  88. data/vendor/assets/javascripts/respond.min.js +0 -2
data/LICENSE.rb DELETED
@@ -1,3 +0,0 @@
1
- Copyright (c) 2010-2011 Peter Gumeson
2
-
3
- http://creativecommons.org/licenses/by/3.0/
@@ -1,16 +0,0 @@
1
-
2
- // usage: log('inside coolFunc', this, arguments);
3
- // paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
4
- window.log = function(){
5
- log.history = log.history || []; // store logs to an array for reference
6
- log.history.push(arguments);
7
- if(this.console) {
8
- arguments.callee = arguments.callee.caller;
9
- console.log( Array.prototype.slice.call(arguments) );
10
- }
11
- };
12
- // make it safe to use console.log always
13
- (function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});
14
-
15
-
16
- // place any jQuery/helper plugins in here, instead of separate, slower script files.
@@ -1,2 +0,0 @@
1
- //= require modernizr.min
2
- //= require respond.min
@@ -1,4 +0,0 @@
1
- #flash
2
- - flash.each do |key, value|
3
- .message{ :class => key }
4
- %p= value
@@ -1,2 +0,0 @@
1
- %small.copyright
2
- Copyright © #{Date.today.year}
@@ -1,24 +0,0 @@
1
- %meta{ :charset => "utf-8" }/
2
-
3
- -# Always force latest IE rendering engine (even in intranet) & Chrome Frame
4
- -# Remove this if you use the .htaccess
5
- %meta{ "http-equiv" => "X-UA-Compatible", :content => "IE=edge,chrome=1" }/
6
-
7
- %meta{ :name => "description", :content => "" }/
8
- %meta{ :name => "author", :content => "" }/
9
-
10
- -# Mobile viewport optimized: j.mp/bplateviewport
11
- %meta{ :name => "viewport", :content => "width=device-width, initial-scale=1.0" }/
12
-
13
- %title
14
- == #{ controller.controller_name.titleize } - #{ controller.action_name.titleize }
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
- -# All JavaScript at the bottom, except for Modernizr and Respond.
21
- -# Modernizr enables HTML5 elements & feature detects; Respond is a polyfill for min/max-width CSS3 Media Queries
22
- = javascript_include_tag "polyfills"
23
-
24
- = csrf_meta_tag
@@ -1 +0,0 @@
1
- %h1 Header
@@ -1,27 +0,0 @@
1
- -# Grab Google CDN's jQuery, with a protocol relative URL
2
- -# Looks for google_api_key first in ENV['GOOGLE_API_KEY'] then in config/google.yml
3
- -# remote_jquery and local_jquery helpers use minified jquery unless Rails.env is development
4
- -# - if !google_api_key.blank?
5
- -# = javascript_include_tag "//www.google.com/jsapi?key=#{google_api_key}"
6
- -# :javascript
7
- -# google.load(#{ remote_jquery("1.6") });
8
- -# - else
9
- -# = javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/#{ local_jquery("1.6") }"
10
-
11
- -# fall back to local jQuery if necessary
12
- -# :javascript
13
- -# window.jQuery || document.write("<script src='/javascripts/jquery.min.js'>\x3C/script>")
14
-
15
- = javascript_include_tag "application"
16
-
17
- -# Append your own using content_for :javascripts
18
- = yield :javascripts
19
-
20
- -# asynchronous google analytics: mathiasbynens.be/notes/async-analytics-snippet
21
- -# Looks for google_account_id first in ENV['GOOGLE_ACCOUNT_ID'] then in config/google.yml
22
- - if !google_account_id.blank?
23
- :javascript
24
- var _gaq=[["_setAccount","#{google_account_id}"],["_trackPageview"],["_trackPageLoadTime"]];
25
- (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
26
- g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
27
- s.parentNode.insertBefore(g,s)}(document,"script"));
@@ -1,5 +0,0 @@
1
- -# CSS: implied media="all"
2
- = stylesheet_link_tag 'application', :media => 'all'
3
-
4
- -# Append your own using content_for :stylesheets
5
- = yield :stylesheets
@@ -1,20 +0,0 @@
1
- !!! 5
2
- -# http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
3
- -ie_html :class => 'no-js', :lang => 'en' do
4
- %head
5
- = render "head"
6
-
7
- %body{ :class => "#{controller.controller_name}" }
8
- #container
9
- %header#header
10
- = render "header"
11
-
12
- #main{ :role => 'main' }
13
- = render "flashes"
14
- = yield
15
-
16
- %footer#footer
17
- = render "footer"
18
-
19
- -# Javascript at the bottom for fast page loading
20
- = render "javascripts"
@@ -1,19 +0,0 @@
1
- // Here's where we define some default constants
2
- //@import "partials/base";
3
-
4
- // Then we'll import the compass extension
5
- @import "html5/boilerplate";
6
-
7
- // Now, you can simply include everything
8
- // (except media) by uncommeting this line
9
- @include html5-boilerplate;
10
-
11
- // Or, you can pick and choose only the sections
12
- // you want by using the these includes
13
- //@include html5-boilerplate-reset;
14
- //@include html5-boilerplate-fonts;
15
- //@include html5-boilerplate-styles;
16
- //@include html5-boilerplate-helpers;
17
-
18
- // Media should come last
19
- @import "partials/media";
@@ -1,22 +0,0 @@
1
- //
2
- // Placeholder media queries for responsive design. Modify as design requires.
3
- // These follow after, and will override, the primary ('mobile first') styles
4
- // The closing /mediaquery comment is required by respond.js min/max-width Media Query polyfill
5
- //
6
-
7
- @media only screen and (min-width: 480px) {
8
- // Style adjustments for viewports 480px and over go here
9
-
10
- }/*/mediaquery*/
11
-
12
- @media only screen and (min-width: 768px) {
13
- // Style adjustments for viewports 768px and over go here
14
-
15
- }/*/mediaquery*/
16
-
17
-
18
- // Print styles
19
- // Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/
20
- @media print {
21
- @include media-print;
22
- }
@@ -1,2 +0,0 @@
1
- %h1
2
- Ohai
@@ -1,3 +0,0 @@
1
- Rails.configuration.sass.tap do |config|
2
- config.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
3
- end
@@ -1,2 +0,0 @@
1
- /*! Respond.js: min/max-width media query polyfill. (c) Scott Jehl. MIT Lic. j.mp/respondjs */
2
- (function(e,h){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=h;if(h){return}var u=e.document,r=u.documentElement,i=[],k=[],p=[],o={},g=30,f=u.getElementsByTagName("head")[0]||r,b=f.getElementsByTagName("link"),d=[],a=function(){var B=b,w=B.length,z=0,y,x,A,v;for(;z<w;z++){y=B[z],x=y.href,A=y.media,v=y.rel&&y.rel.toLowerCase()==="stylesheet";if(!!x&&v&&!o[x]){if(!/^([a-zA-Z]+?:(\/\/)?(www\.)?)/.test(x)||x.replace(RegExp.$1,"").split("/")[0]===e.location.host){d.push({href:x,media:A})}else{o[x]=true}}}t()},t=function(){if(d.length){var v=d.shift();n(v.href,function(w){m(w,v.href,v.media);o[v.href]=true;t()})}},m=function(G,v,x){var E=G.match(/@media[^\{]+\{([^\{\}]+\{[^\}\{]+\})+/gi),H=E&&E.length||0,v=v.substring(0,v.lastIndexOf("/")),w=function(I){return I.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+v+"$2$3")},y=!H&&x,B=0,A,C,D,z,F;if(v.length){v+="/"}if(y){H=1}for(;B<H;B++){A=0;if(y){C=x;k.push(w(G))}else{C=E[B].match(/@media ([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1;k.push(RegExp.$2&&w(RegExp.$2))}z=C.split(",");F=z.length;for(;A<F;A++){D=z[A];i.push({media:D.match(/(only\s+)?([a-zA-Z]+)(\sand)?/)&&RegExp.$2,rules:k.length-1,minw:D.match(/\(min\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1),maxw:D.match(/\(max\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1)})}}j()},l,q,j=function(E){var v="clientWidth",x=r[v],D=u.compatMode==="CSS1Compat"&&x||u.body[v]||x,z={},C=u.createDocumentFragment(),B=b[b.length-1],w=(new Date()).getTime();if(E&&l&&w-l<g){clearTimeout(q);q=setTimeout(j,g);return}else{l=w}for(var y in i){var F=i[y];if(!F.minw&&!F.maxw||(!F.minw||F.minw&&D>=F.minw)&&(!F.maxw||F.maxw&&D<=F.maxw)){if(!z[F.media]){z[F.media]=[]}z[F.media].push(k[F.rules])}}for(var y in p){if(p[y]&&p[y].parentNode===f){f.removeChild(p[y])}}for(var y in z){var G=u.createElement("style"),A=z[y].join("\n");G.type="text/css";G.media=y;if(G.styleSheet){G.styleSheet.cssText=A}else{G.appendChild(u.createTextNode(A))}C.appendChild(G);p.push(G)}f.insertBefore(C,B.nextSibling)},n=function(v,x){var w=c();if(!w){return}w.open("GET",v,true);w.onreadystatechange=function(){if(w.readyState!=4||w.status!=200&&w.status!=304){return}x(w.responseText)};if(w.readyState==4){return}w.send()},c=(function(){var v=false,w=[function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new XMLHttpRequest()}],y=w.length;while(y--){try{v=w[y]()}catch(x){continue}break}return function(){return v}})();a();respond.update=a;function s(){j(true)}if(e.addEventListener){e.addEventListener("resize",s,false)}else{if(e.attachEvent){e.attachEvent("onresize",s)}}})(this,(function(f){if(f.matchMedia){return true}var e,i=document,c=i.documentElement,g=c.firstElementChild||c.firstChild,h=!i.body,d=i.body||i.createElement("body"),b=i.createElement("div"),a="only all";b.id="mq-test-1";b.style.cssText="position:absolute;top:-99em";d.appendChild(b);b.innerHTML='_<style media="'+a+'"> #mq-test-1 { width: 9px; }</style>';if(h){c.insertBefore(d,g)}b.removeChild(b.firstChild);e=b.offsetWidth==9;if(h){c.removeChild(d)}else{d.removeChild(b)}return e})(this));