Permalink
Browse files

Initial commit.

  • Loading branch information...
0 parents commit c305af424c07c4c1c95e65c79c9c76aa237abaf9 @danielmorrison danielmorrison committed Apr 4, 2009
Showing with 92 additions and 0 deletions.
  1. +20 −0 MIT-LICENSE
  2. +13 −0 README
  3. +23 −0 Rakefile
  4. +2 −0 init.rb
  5. +19 −0 lib/html5.rb
  6. +4 −0 tasks/html5_tasks.rake
  7. +8 −0 test/html5_test.rb
  8. +3 −0 test/test_helper.rb
@@ -0,0 +1,20 @@
+Copyright (c) 2009 Collective Idea
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 README
@@ -0,0 +1,13 @@
+Html5 on Rails
+=====
+
+This plugin is a bit of a playground to see what html goodies we can do. I'm implementing things as I desire them, and not in any normal order.
+
+Current Features
+=======
+
+Since the type attributes for CSS and javascript tags have sensible defaults, we can omit them unless we need to override them.
+<script src="/javascripts/all.js"></script>
+<link href="/stylesheets/boilerplate.css?1238073247" media="all" rel="stylesheet" />
+
+Copyright (c) 2009 Collective Idea, released under the MIT license
@@ -0,0 +1,23 @@
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+desc 'Default: run unit tests.'
+task :default => :test
+
+desc 'Test the html5 plugin.'
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = true
+end
+
+desc 'Generate documentation for the html5 plugin.'
+Rake::RDocTask.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'Html5'
+ rdoc.options << '--line-numbers' << '--inline-source'
+ rdoc.rdoc_files.include('README')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
@@ -0,0 +1,2 @@
+# Include hook code here
+require 'html5'
@@ -0,0 +1,19 @@
+require 'action_view/helpers/asset_tag_helper'
+
+module ActionView::Helpers::AssetTagHelper
+
+private
+
+ # type attribute defaults to text/javascript so it can be omitted.
+ # http://www.whatwg.org/specs/web-apps/current-work/#the-link-element
+ def javascript_src_tag_with_empty_type(source, options)
+ javascript_src_tag_without_empty_type(source, {'type' => nil}.merge(options))
+ end
+ alias_method_chain :javascript_src_tag, :empty_type
+
+ # type attribute defaults to text/css so it can be omitted.
+ # http://www.whatwg.org/specs/web-apps/current-work/#script
+ def stylesheet_tag(source, options)
+ tag("link", { "rel" => "stylesheet", "media" => "screen", "href" => html_escape(path_to_stylesheet(source)) }.merge(options), false, false)
+ end
+end
@@ -0,0 +1,4 @@
+# desc "Explaining what the task does"
+# task :html5 do
+# # Task goes here
+# end
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class Html5Test < ActiveSupport::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
@@ -0,0 +1,3 @@
+require 'rubygems'
+require 'active_support'
+require 'active_support/test_case'

0 comments on commit c305af4

Please sign in to comment.