html5-rails 0.0.1 → 0.0.2

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.
Files changed (61) hide show
  1. data/.gitignore +1 -0
  2. data/Gemfile +38 -2
  3. data/Rakefile +8 -0
  4. data/app/assets/javascripts/html5/boilerplate/index.js +0 -2
  5. data/html5-rails.gemspec +3 -2
  6. data/lib/generators/html5/install/USAGE +8 -0
  7. data/lib/generators/html5/install/install_generator.rb +22 -0
  8. data/lib/generators/html5/install/templates/README +3 -0
  9. data/lib/generators/html5/install/templates/compass.rb +25 -0
  10. data/lib/html5/rails.rb +2 -2
  11. data/lib/html5/rails/{boilerplate_helpers.rb → boilerplate_helper.rb} +4 -4
  12. data/lib/html5/rails/engine.rb +4 -9
  13. data/lib/html5/rails/version.rb +2 -2
  14. data/test/dummy/.gitignore +5 -0
  15. data/test/dummy/Rakefile +7 -0
  16. data/test/dummy/app/assets/images/rails.png +0 -0
  17. data/test/dummy/app/assets/javascripts/application.js +2 -0
  18. data/test/dummy/app/assets/javascripts/pages.js.coffee +6 -0
  19. data/test/dummy/app/assets/stylesheets/application.css.scss +19 -0
  20. data/test/dummy/app/assets/stylesheets/partials/_media.css.scss +22 -0
  21. data/test/dummy/app/controllers/application_controller.rb +3 -0
  22. data/test/dummy/app/controllers/pages_controller.rb +4 -0
  23. data/test/dummy/app/helpers/application_helper.rb +2 -0
  24. data/test/dummy/app/helpers/pages_helper.rb +2 -0
  25. data/test/dummy/app/mailers/.gitkeep +0 -0
  26. data/test/dummy/app/models/.gitkeep +0 -0
  27. data/test/dummy/app/views/pages/home.html.haml +2 -0
  28. data/test/dummy/config.ru +4 -0
  29. data/test/dummy/config/application.rb +45 -0
  30. data/test/dummy/config/boot.rb +8 -0
  31. data/test/dummy/config/database.yml +25 -0
  32. data/test/dummy/config/environment.rb +5 -0
  33. data/test/dummy/config/environments/development.rb +27 -0
  34. data/test/dummy/config/environments/production.rb +51 -0
  35. data/test/dummy/config/environments/test.rb +39 -0
  36. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  37. data/test/dummy/config/initializers/inflections.rb +10 -0
  38. data/test/dummy/config/initializers/mime_types.rb +5 -0
  39. data/test/dummy/config/initializers/sass.rb +3 -0
  40. data/test/dummy/config/initializers/secret_token.rb +7 -0
  41. data/test/dummy/config/initializers/session_store.rb +8 -0
  42. data/test/dummy/config/initializers/wrap_parameters.rb +12 -0
  43. data/test/dummy/config/locales/en.yml +5 -0
  44. data/test/dummy/config/routes.rb +58 -0
  45. data/test/dummy/lib/tasks/.gitkeep +0 -0
  46. data/test/dummy/log/.gitkeep +0 -0
  47. data/test/dummy/public/404.html +26 -0
  48. data/test/dummy/public/422.html +26 -0
  49. data/test/dummy/public/500.html +26 -0
  50. data/test/dummy/public/favicon.ico +0 -0
  51. data/test/dummy/public/robots.txt +5 -0
  52. data/test/dummy/script/rails +6 -0
  53. data/test/dummy/vendor/assets/stylesheets/.gitkeep +0 -0
  54. data/test/dummy/vendor/plugins/.gitkeep +0 -0
  55. data/test/generators/install_generator_test.rb +12 -0
  56. data/test/html5_rails_test.rb +7 -0
  57. data/test/integration/navigation_test.rb +7 -0
  58. data/test/support/integration_case.rb +5 -0
  59. data/test/test_helper.rb +26 -0
  60. metadata +102 -8
  61. data/app/helpers/boilerplate_helpers.rb +0 -64
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ test/tmp
data/Gemfile CHANGED
@@ -1,4 +1,40 @@
1
- source "http://rubygems.org"
1
+ source 'http://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in html5-rails.gemspec
4
3
  gemspec
4
+
5
+ gem 'rails', '3.1.0.rc5'
6
+
7
+ # Bundle edge Rails instead:
8
+ # gem 'rails', :git => 'git://github.com/rails/rails.git'
9
+
10
+ gem 'sqlite3'
11
+
12
+
13
+ # Gems used only for assets and not required
14
+ # in production environments by default.
15
+ group :assets do
16
+ gem 'sass-rails', '~> 3.1.0.rc'
17
+ gem 'coffee-rails', '~> 3.1.0.rc'
18
+ gem 'uglifier'
19
+ gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31'
20
+ gem 'compass-html5', :git => 'git://github.com/sporkd/compass-html5.git'
21
+ end
22
+
23
+ gem 'jquery-rails'
24
+
25
+ # Use unicorn as the web server
26
+ # gem 'unicorn'
27
+
28
+ # Deploy with Capistrano
29
+ # gem 'capistrano'
30
+
31
+ # To use debugger
32
+ # gem 'ruby-debug19', :require => 'ruby-debug'
33
+
34
+ gem 'capybara'
35
+ gem 'haml', :git => 'git://github.com/nex3/haml.git'
36
+
37
+ group :test do
38
+ # Pretty printed test output
39
+ gem 'turn', :require => false
40
+ end
data/Rakefile CHANGED
@@ -1 +1,9 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << 'lib'
6
+ t.libs << 'test'
7
+ t.pattern = 'test/**/*_test.rb'
8
+ t.verbose = true
9
+ end
@@ -1,3 +1 @@
1
- //= require jquery
2
- //= require jquery_ujs
3
1
  //= require ./plugins
data/html5-rails.gemspec CHANGED
@@ -5,16 +5,17 @@ require "html5/rails/version"
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "html5-rails"
7
7
  s.version = Html5::Rails::VERSION
8
+ s.platform = Gem::Platform::RUBY
8
9
  s.authors = ["Peter Gumeson"]
9
10
  s.email = ["gumeson@gmail.com"]
10
11
  s.homepage = "http://rubygems.org/gems/html5-rails"
11
- s.summary = %q{Rails support for the new compass-html5 gem.}
12
+ s.summary = %q{Rails support for the compass-html5 gem.}
12
13
  s.description = %q{}
13
14
 
14
15
  s.rubyforge_project = "html5-rails"
15
16
 
16
17
  s.add_dependency "compass-html5", "~> 0.0.1"
17
- s.add_dependency "railties", "~> 3.1.0.rc4"
18
+ s.add_dependency "railties", "~> 3.1.0"
18
19
  s.add_dependency "thor", "~> 0.14"
19
20
 
20
21
  s.files = `git ls-files`.split("\n")
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Installs Html5Rails and copies compass config file to your application.
3
+
4
+ Example:
5
+ rails generate html5:install
6
+
7
+ This will create:
8
+ config/compass.rb
@@ -0,0 +1,22 @@
1
+ module Html5
2
+ module Generators
3
+ class InstallGenerator < ::Rails::Generators::Base
4
+ source_root File.expand_path('../templates', __FILE__)
5
+
6
+ # def run_config
7
+ # inside do
8
+ # # Needs more work
9
+ # run("bundle exec compass config --app rails -r compass-html5 -q")
10
+ # end
11
+ # end
12
+
13
+ def copy_config
14
+ copy_file "compass.rb", "config/compass.rb"
15
+ end
16
+
17
+ def show_readme
18
+ readme "README" if behavior == :invoke
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,3 @@
1
+ README
2
+ ==================
3
+
@@ -0,0 +1,25 @@
1
+ # This configuration file works with both the Compass command line tool and within Rails.
2
+ require 'compass/html5'
3
+
4
+ # Require any additional compass plugins here.
5
+
6
+ project_type = :rails
7
+
8
+ # Set this to the root of your project when deployed:
9
+ http_path = "/"
10
+
11
+ # You can select your preferred output style here (can be overridden via the command line):
12
+ # output_style = :expanded or :nested or :compact or :compressed
13
+
14
+ # To enable relative paths to assets via compass helper functions. Uncomment:
15
+ # relative_assets = true
16
+
17
+ # To disable debugging comments that display the original location of your selectors. Uncomment:
18
+ # line_comments = false
19
+
20
+
21
+ # If you prefer the indented syntax, you might want to regenerate this
22
+ # project again passing --syntax sass, or you can uncomment this:
23
+ # preferred_syntax = :sass
24
+ # and then run:
25
+ # sass-convert -R --from scss --to sass app/stylesheets scss && rm -rf sass && mv scss sass
data/lib/html5/rails.rb CHANGED
@@ -3,6 +3,6 @@ require "html5/rails/engine"
3
3
 
4
4
  module Html5
5
5
  module Rails
6
- autoload :BoilerplateHelpers, 'html5/rails/boilerplate_helpers'
6
+ autoload :BoilerplateHelper, 'html5/rails/boilerplate_helper'
7
7
  end
8
- end
8
+ end
@@ -1,6 +1,6 @@
1
1
  module Html5
2
2
  module Rails
3
- module BoilerplateHelpers
3
+ module BoilerplateHelper
4
4
 
5
5
  # Create a named haml tag to wrap IE conditional around a block
6
6
  # http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
@@ -33,7 +33,7 @@ module Html5
33
33
  end
34
34
 
35
35
  def remote_jquery(version)
36
- if Rails.env == 'development'
36
+ if ::Rails.env == 'development'
37
37
  "'jquery', '#{version}', {uncompressed:true}"
38
38
  else
39
39
  "'jquery', '#{version}'"
@@ -41,7 +41,7 @@ module Html5
41
41
  end
42
42
 
43
43
  def local_jquery(version)
44
- if Rails.env == 'development'
44
+ if ::Rails.env == 'development'
45
45
  "#{version}/jquery.js"
46
46
  else
47
47
  "#{version}/jquery.min.js"
@@ -59,7 +59,7 @@ module Html5
59
59
  end
60
60
 
61
61
  def google_config(key)
62
- configs = YAML.load_file(File.join(Rails.root, 'config', 'google.yml'))[Rails.env.to_sym] rescue {}
62
+ configs = YAML.load_file(File.join(::Rails.root, 'config', 'google.yml'))[::Rails.env.to_sym] rescue {}
63
63
  configs[key]
64
64
  end
65
65
 
@@ -1,21 +1,16 @@
1
1
  module Html5
2
2
  module Rails
3
3
  class Engine < ::Rails::Engine
4
-
5
- # initializer "html5_rails_engine.helper" do |app|
6
- # ActiveSupport.on_load(:action_controller) do
7
- # include Html5::Rails::BoilerplateHelpers
8
- # end
9
- # end
10
4
 
5
+ # Extend application_helper
11
6
  initializer 'html5_rails_engine.helper' do |app|
12
- #ActionView::Base.send :include, Html5::Rails::BoilerplateHelpers
13
- ActionController::Base.helper(Html5::Rails::BoilerplateHelpers)
7
+ ActionController::Base.helper(Html5::Rails::BoilerplateHelper)
14
8
  end
15
9
 
10
+ # Extend application_controller
16
11
  # initializer 'html5_rails_engine.controller' do |app|
17
12
  # ActiveSupport.on_load(:action_controller) do
18
- # include Html5RailsEngineActionControllerExtension
13
+ # include Html5::Rails::BoilerplateController
19
14
  # end
20
15
  # end
21
16
 
@@ -1,7 +1,7 @@
1
1
  module Html5
2
2
  module Rails
3
- VERSION = "0.0.1"
4
- COMPASS_HTML5_VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
+ COMPASS_HTML5_VERSION = "0.0.2"
5
5
  JQUERY_VERSION = "1.6.1"
6
6
  MODERNIZER_VERSION = "2.0"
7
7
  RESPOND_VERSION = "625d77dc1aed97baf0ae"
@@ -0,0 +1,5 @@
1
+ .bundle
2
+ db/*.sqlite3
3
+ log/*.log
4
+ tmp/
5
+ .sass-cache/
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,2 @@
1
+ //= require html5/boilerplate
2
+ //= require_tree .
@@ -0,0 +1,6 @@
1
+ # Place all the behaviors and hooks related to the matching controller here.
2
+ # All this logic will automatically be available in application.js.
3
+ # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
4
+
5
+ pages = ->
6
+ alert("I'm just a page");
@@ -0,0 +1,19 @@
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";
@@ -0,0 +1,22 @@
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
+ }
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,4 @@
1
+ class PagesController < ApplicationController
2
+ def home
3
+ end
4
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module PagesHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ %h1
2
+ Ohai
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,45 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ # If you have a Gemfile, require the default gems, the ones in the
6
+ # current environment and also include :assets gems if in development
7
+ # or test environments.
8
+ Bundler.require *Rails.groups(:assets) if defined?(Bundler)
9
+
10
+ require "html5-rails"
11
+
12
+ module Dummy
13
+ class Application < Rails::Application
14
+ # Settings in config/environments/* take precedence over those specified here.
15
+ # Application configuration should go into files in config/initializers
16
+ # -- all .rb files in that directory are automatically loaded.
17
+
18
+ # Custom directories with classes and modules you want to be autoloadable.
19
+ # config.autoload_paths += %W(#{config.root}/extras)
20
+
21
+ # Only load the plugins named here, in the order given (default is alphabetical).
22
+ # :all can be used as a placeholder for all plugins not explicitly named.
23
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
24
+
25
+ # Activate observers that should always be running.
26
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
27
+
28
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30
+ # config.time_zone = 'Central Time (US & Canada)'
31
+
32
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34
+ # config.i18n.default_locale = :de
35
+
36
+ # Configure the default encoding used in templates for Ruby 1.9.
37
+ config.encoding = "utf-8"
38
+
39
+ # Configure sensitive parameters which will be filtered from the log file.
40
+ config.filter_parameters += [:password]
41
+
42
+ # Enable the asset pipeline
43
+ config.assets.enabled = true
44
+ end
45
+ end
@@ -0,0 +1,8 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
5
+
6
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
7
+
8
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,27 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Do not compress assets
26
+ config.assets.compress = false
27
+ end
@@ -0,0 +1,51 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Specifies the header that your server uses for sending files
18
+ # (comment out if your front-end server doesn't support this)
19
+ config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx
20
+
21
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
22
+ # config.force_ssl = true
23
+
24
+ # See everything in the log (default is :info)
25
+ # config.log_level = :debug
26
+
27
+ # Use a different logger for distributed setups
28
+ # config.logger = SyslogLogger.new
29
+
30
+ # Use a different cache store in production
31
+ # config.cache_store = :mem_cache_store
32
+
33
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
34
+ # config.action_controller.asset_host = "http://assets.example.com"
35
+
36
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
37
+ # config.assets.precompile += %w( search.js )
38
+
39
+ # Disable delivery errors, bad email addresses will be ignored
40
+ # config.action_mailer.raise_delivery_errors = false
41
+
42
+ # Enable threaded mode
43
+ # config.threadsafe!
44
+
45
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
46
+ # the I18n.default_locale when a translation can not be found)
47
+ config.i18n.fallbacks = true
48
+
49
+ # Send deprecation notices to registered listeners
50
+ config.active_support.deprecation = :notify
51
+ end
@@ -0,0 +1,39 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
33
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
34
+ # like if you have constraints or database-specific column types
35
+ # config.active_record.schema_format = :sql
36
+
37
+ # Print deprecation notices to the stderr
38
+ config.active_support.deprecation = :stderr
39
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,3 @@
1
+ Rails.configuration.sass.tap do |config|
2
+ config.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
3
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = '0eecea4e8fdb11b1bad9dfde1137c1bfc19d06045539b215ab30af3661199625dac8865e9bfdca9f4237b934c14a76cb0c6154630f9f957271e3383692a882c0'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActionController::Base.wrap_parameters format: [:json]
8
+
9
+ # Disable root element in JSON by default.
10
+ if defined?(ActiveRecord)
11
+ ActiveRecord::Base.include_root_in_json = false
12
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,58 @@
1
+ Dummy::Application.routes.draw do
2
+ # The priority is based upon order of creation:
3
+ # first created -> highest priority.
4
+
5
+ # Sample of regular route:
6
+ # match 'products/:id' => 'catalog#view'
7
+ # Keep in mind you can assign values other than :controller and :action
8
+
9
+ # Sample of named route:
10
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
+ # This route can be invoked with purchase_url(:id => product.id)
12
+
13
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
14
+ # resources :products
15
+
16
+ # Sample resource route with options:
17
+ # resources :products do
18
+ # member do
19
+ # get 'short'
20
+ # post 'toggle'
21
+ # end
22
+ #
23
+ # collection do
24
+ # get 'sold'
25
+ # end
26
+ # end
27
+
28
+ # Sample resource route with sub-resources:
29
+ # resources :products do
30
+ # resources :comments, :sales
31
+ # resource :seller
32
+ # end
33
+
34
+ # Sample resource route with more complex sub-resources
35
+ # resources :products do
36
+ # resources :comments
37
+ # resources :sales do
38
+ # get 'recent', :on => :collection
39
+ # end
40
+ # end
41
+
42
+ # Sample resource route within a namespace:
43
+ # namespace :admin do
44
+ # # Directs /admin/products/* to Admin::ProductsController
45
+ # # (app/controllers/admin/products_controller.rb)
46
+ # resources :products
47
+ # end
48
+
49
+ # You can have the root of your site routed with "root"
50
+ # just remember to delete public/index.html.
51
+ root :to => 'pages#home'
52
+
53
+ # See how all your routes lay out with "rake routes"
54
+
55
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
56
+ # Note: This route will make all actions in every controller accessible via GET requests.
57
+ # match ':controller(/:action(/:id))(.:format)'
58
+ end
File without changes
File without changes
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
File without changes
File without changes
@@ -0,0 +1,12 @@
1
+ require "test_helper"
2
+
3
+ class InstallGeneratorTest < Rails::Generators::TestCase
4
+ tests Html5::Generators::InstallGenerator
5
+ destination File.expand_path("../../tmp", __FILE__)
6
+ setup :prepare_destination
7
+
8
+ test "Assert config file is generated" do
9
+ run_generator
10
+ assert_file "config/compass.rb"
11
+ end
12
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class Html5RailsTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, Html5::Rails
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActiveSupport::IntegrationCase
4
+ test "truth" do
5
+ assert_kind_of Dummy::Application, Rails.application
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ # Define a bare test case to use with Capybara
2
+ class ActiveSupport::IntegrationCase < ActiveSupport::TestCase
3
+ include Capybara
4
+ include Rails.application.routes.url_helpers
5
+ end
@@ -0,0 +1,26 @@
1
+ # Configure Rails Envinronment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ ActionMailer::Base.delivery_method = :test
8
+ ActionMailer::Base.perform_deliveries = true
9
+ ActionMailer::Base.default_url_options[:host] = "test.com"
10
+
11
+ Rails.backtrace_cleaner.remove_silencers!
12
+
13
+ # Configure capybara for integration testing
14
+ require "capybara/rails"
15
+ Capybara.default_driver = :rack_test
16
+ Capybara.default_selector = :css
17
+
18
+ # Run any available migration
19
+ ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
20
+
21
+ # Load support files
22
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
23
+
24
+ # For generators
25
+ require "rails/generators/test_case"
26
+ require "generators/html5/install/install_generator"
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: html5-rails
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Peter Gumeson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-06-20 00:00:00 -07:00
13
+ date: 2011-09-21 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  requirements:
33
33
  - - ~>
34
34
  - !ruby/object:Gem::Version
35
- version: 3.1.0.rc4
35
+ version: 3.1.0
36
36
  type: :runtime
37
37
  version_requirements: *id002
38
38
  - !ruby/object:Gem::Dependency
@@ -66,7 +66,6 @@ files:
66
66
  - app/assets/javascripts/html5/boilerplate/plugins.js
67
67
  - app/assets/javascripts/html5/boilerplate/polyfills.js
68
68
  - app/assets/javascripts/polyfills.js
69
- - app/helpers/boilerplate_helpers.rb
70
69
  - app/views/application/_flashes.html.haml
71
70
  - app/views/application/_footer.html.haml
72
71
  - app/views/application/_head.html.haml
@@ -75,11 +74,61 @@ files:
75
74
  - app/views/application/_stylesheets.html.haml
76
75
  - app/views/layouts/application.html.haml
77
76
  - html5-rails.gemspec
77
+ - lib/generators/html5/install/USAGE
78
+ - lib/generators/html5/install/install_generator.rb
79
+ - lib/generators/html5/install/templates/README
80
+ - lib/generators/html5/install/templates/compass.rb
78
81
  - lib/html5-rails.rb
79
82
  - lib/html5/rails.rb
80
- - lib/html5/rails/boilerplate_helpers.rb
83
+ - lib/html5/rails/boilerplate_helper.rb
81
84
  - lib/html5/rails/engine.rb
82
85
  - lib/html5/rails/version.rb
86
+ - test/dummy/.gitignore
87
+ - test/dummy/Rakefile
88
+ - test/dummy/app/assets/images/rails.png
89
+ - test/dummy/app/assets/javascripts/application.js
90
+ - test/dummy/app/assets/javascripts/pages.js.coffee
91
+ - test/dummy/app/assets/stylesheets/application.css.scss
92
+ - test/dummy/app/assets/stylesheets/partials/_media.css.scss
93
+ - test/dummy/app/controllers/application_controller.rb
94
+ - test/dummy/app/controllers/pages_controller.rb
95
+ - test/dummy/app/helpers/application_helper.rb
96
+ - test/dummy/app/helpers/pages_helper.rb
97
+ - test/dummy/app/mailers/.gitkeep
98
+ - test/dummy/app/models/.gitkeep
99
+ - test/dummy/app/views/pages/home.html.haml
100
+ - test/dummy/config.ru
101
+ - test/dummy/config/application.rb
102
+ - test/dummy/config/boot.rb
103
+ - test/dummy/config/database.yml
104
+ - test/dummy/config/environment.rb
105
+ - test/dummy/config/environments/development.rb
106
+ - test/dummy/config/environments/production.rb
107
+ - test/dummy/config/environments/test.rb
108
+ - test/dummy/config/initializers/backtrace_silencers.rb
109
+ - test/dummy/config/initializers/inflections.rb
110
+ - test/dummy/config/initializers/mime_types.rb
111
+ - test/dummy/config/initializers/sass.rb
112
+ - test/dummy/config/initializers/secret_token.rb
113
+ - test/dummy/config/initializers/session_store.rb
114
+ - test/dummy/config/initializers/wrap_parameters.rb
115
+ - test/dummy/config/locales/en.yml
116
+ - test/dummy/config/routes.rb
117
+ - test/dummy/lib/tasks/.gitkeep
118
+ - test/dummy/log/.gitkeep
119
+ - test/dummy/public/404.html
120
+ - test/dummy/public/422.html
121
+ - test/dummy/public/500.html
122
+ - test/dummy/public/favicon.ico
123
+ - test/dummy/public/robots.txt
124
+ - test/dummy/script/rails
125
+ - test/dummy/vendor/assets/stylesheets/.gitkeep
126
+ - test/dummy/vendor/plugins/.gitkeep
127
+ - test/generators/install_generator_test.rb
128
+ - test/html5_rails_test.rb
129
+ - test/integration/navigation_test.rb
130
+ - test/support/integration_case.rb
131
+ - test/test_helper.rb
83
132
  - vendor/assets/javascripts/modernizr.min.js
84
133
  - vendor/assets/javascripts/respond.min.js
85
134
  has_rdoc: true
@@ -109,6 +158,51 @@ rubyforge_project: html5-rails
109
158
  rubygems_version: 1.6.2
110
159
  signing_key:
111
160
  specification_version: 3
112
- summary: Rails support for the new compass-html5 gem.
113
- test_files: []
114
-
161
+ summary: Rails support for the compass-html5 gem.
162
+ test_files:
163
+ - test/dummy/.gitignore
164
+ - test/dummy/Rakefile
165
+ - test/dummy/app/assets/images/rails.png
166
+ - test/dummy/app/assets/javascripts/application.js
167
+ - test/dummy/app/assets/javascripts/pages.js.coffee
168
+ - test/dummy/app/assets/stylesheets/application.css.scss
169
+ - test/dummy/app/assets/stylesheets/partials/_media.css.scss
170
+ - test/dummy/app/controllers/application_controller.rb
171
+ - test/dummy/app/controllers/pages_controller.rb
172
+ - test/dummy/app/helpers/application_helper.rb
173
+ - test/dummy/app/helpers/pages_helper.rb
174
+ - test/dummy/app/mailers/.gitkeep
175
+ - test/dummy/app/models/.gitkeep
176
+ - test/dummy/app/views/pages/home.html.haml
177
+ - test/dummy/config.ru
178
+ - test/dummy/config/application.rb
179
+ - test/dummy/config/boot.rb
180
+ - test/dummy/config/database.yml
181
+ - test/dummy/config/environment.rb
182
+ - test/dummy/config/environments/development.rb
183
+ - test/dummy/config/environments/production.rb
184
+ - test/dummy/config/environments/test.rb
185
+ - test/dummy/config/initializers/backtrace_silencers.rb
186
+ - test/dummy/config/initializers/inflections.rb
187
+ - test/dummy/config/initializers/mime_types.rb
188
+ - test/dummy/config/initializers/sass.rb
189
+ - test/dummy/config/initializers/secret_token.rb
190
+ - test/dummy/config/initializers/session_store.rb
191
+ - test/dummy/config/initializers/wrap_parameters.rb
192
+ - test/dummy/config/locales/en.yml
193
+ - test/dummy/config/routes.rb
194
+ - test/dummy/lib/tasks/.gitkeep
195
+ - test/dummy/log/.gitkeep
196
+ - test/dummy/public/404.html
197
+ - test/dummy/public/422.html
198
+ - test/dummy/public/500.html
199
+ - test/dummy/public/favicon.ico
200
+ - test/dummy/public/robots.txt
201
+ - test/dummy/script/rails
202
+ - test/dummy/vendor/assets/stylesheets/.gitkeep
203
+ - test/dummy/vendor/plugins/.gitkeep
204
+ - test/generators/install_generator_test.rb
205
+ - test/html5_rails_test.rb
206
+ - test/integration/navigation_test.rb
207
+ - test/support/integration_case.rb
208
+ - test/test_helper.rb
@@ -1,64 +0,0 @@
1
- module BoilerplateHelpers
2
-
3
- # Create a named haml tag to wrap IE conditional around a block
4
- # http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
5
- def ie_tag(name=:body, attrs={}, &block)
6
- attrs.symbolize_keys!
7
- haml_concat("<!--[if lt IE 7]> #{ tag(name, add_class('ie6', attrs), true) } <![endif]-->".html_safe)
8
- haml_concat("<!--[if IE 7]> #{ tag(name, add_class('ie7', attrs), true) } <![endif]-->".html_safe)
9
- haml_concat("<!--[if IE 8]> #{ tag(name, add_class('ie8', attrs), true) } <![endif]-->".html_safe)
10
- haml_concat("<!--[if gt IE 8]><!-->".html_safe)
11
- haml_tag name, attrs do
12
- haml_concat("<!--<![endif]-->".html_safe)
13
- block.call
14
- end
15
- end
16
-
17
- def ie_html(attrs={}, &block)
18
- ie_tag(:html, attrs, &block)
19
- end
20
-
21
- def ie_body(attrs={}, &block)
22
- ie_tag(:body, attrs, &block)
23
- end
24
-
25
- def google_account_id
26
- ENV['GOOGLE_ACCOUNT_ID'] || google_config(:google_account_id)
27
- end
28
-
29
- def google_api_key
30
- ENV['GOOGLE_API_KEY'] || google_config(:google_api_key)
31
- end
32
-
33
- def remote_jquery(version)
34
- if Rails.env == 'development'
35
- "'jquery', '#{version}', {uncompressed:true}"
36
- else
37
- "'jquery', '#{version}'"
38
- end
39
- end
40
-
41
- def local_jquery(version)
42
- if Rails.env == 'development'
43
- "#{version}/jquery.js"
44
- else
45
- "#{version}/jquery.min.js"
46
- end
47
- end
48
-
49
- private
50
-
51
- def add_class(name, attrs)
52
- classes = attrs[:class] || ''
53
- classes.strip!
54
- classes = ' ' + classes if !classes.blank?
55
- classes = name + classes
56
- attrs.merge(:class => classes)
57
- end
58
-
59
- def google_config(key)
60
- configs = YAML.load_file(File.join(Rails.root, 'config', 'google.yml'))[Rails.env.to_sym] rescue {}
61
- configs[key]
62
- end
63
-
64
- end