rails-boilerplate 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. data/.gitignore +9 -0
  2. data/.gitmodules +3 -0
  3. data/Gemfile +11 -0
  4. data/Guardfile +14 -0
  5. data/LICENSE +19 -0
  6. data/README.md +37 -0
  7. data/Rakefile +73 -0
  8. data/html5-boilerplate/.gitattributes +1 -0
  9. data/html5-boilerplate/.gitignore +41 -0
  10. data/html5-boilerplate/.htaccess +506 -0
  11. data/html5-boilerplate/404.html +38 -0
  12. data/html5-boilerplate/README.md +387 -0
  13. data/html5-boilerplate/apple-touch-icon-114x114-precomposed.png +0 -0
  14. data/html5-boilerplate/apple-touch-icon-57x57-precomposed.png +0 -0
  15. data/html5-boilerplate/apple-touch-icon-72x72-precomposed.png +0 -0
  16. data/html5-boilerplate/apple-touch-icon-precomposed.png +0 -0
  17. data/html5-boilerplate/apple-touch-icon.png +0 -0
  18. data/html5-boilerplate/build/build.xml +1051 -0
  19. data/html5-boilerplate/build/config/default.properties +116 -0
  20. data/html5-boilerplate/build/config/manifest.appcache +20 -0
  21. data/html5-boilerplate/build/config/project.properties +96 -0
  22. data/html5-boilerplate/build/createproject.sh +50 -0
  23. data/html5-boilerplate/build/project.xml +7 -0
  24. data/html5-boilerplate/build/runbuildscript.bat +6 -0
  25. data/html5-boilerplate/build/tools/ant-contrib-1.0b3.jar +0 -0
  26. data/html5-boilerplate/build/tools/closure-compiler-v1346.jar +0 -0
  27. data/html5-boilerplate/build/tools/csslint-rhino.js +11138 -0
  28. data/html5-boilerplate/build/tools/fulljshint.js +5904 -0
  29. data/html5-boilerplate/build/tools/fulljslint.js +6651 -0
  30. data/html5-boilerplate/build/tools/htmlcompressor-1.4.3.jar +0 -0
  31. data/html5-boilerplate/build/tools/jpegtran.exe +0 -0
  32. data/html5-boilerplate/build/tools/optipng-0.6.4-exe/LICENSE.txt +21 -0
  33. data/html5-boilerplate/build/tools/optipng-0.6.4-exe/optipng.exe +0 -0
  34. data/html5-boilerplate/build/tools/rhino.jar +0 -0
  35. data/html5-boilerplate/build/tools/yuicompressor-2.4.5.jar +0 -0
  36. data/html5-boilerplate/crossdomain.xml +25 -0
  37. data/html5-boilerplate/css/style.css +293 -0
  38. data/html5-boilerplate/demo/elements.html +493 -0
  39. data/html5-boilerplate/demo/hack.css +84 -0
  40. data/html5-boilerplate/demo/hack2.css +41 -0
  41. data/html5-boilerplate/demo/internet_explorer.png +0 -0
  42. data/html5-boilerplate/demo/test_tubes.png +0 -0
  43. data/html5-boilerplate/demo/tests.html +300 -0
  44. data/html5-boilerplate/favicon.ico +0 -0
  45. data/html5-boilerplate/humans.txt +43 -0
  46. data/html5-boilerplate/img/.gitignore +2 -0
  47. data/html5-boilerplate/index.html +79 -0
  48. data/html5-boilerplate/js/libs/jquery-1.6.3.js +9044 -0
  49. data/html5-boilerplate/js/libs/jquery-1.6.3.min.js +4 -0
  50. data/html5-boilerplate/js/libs/modernizr-2.0.6.min.js +4 -0
  51. data/html5-boilerplate/js/mylibs/.gitignore +2 -0
  52. data/html5-boilerplate/js/plugins.js +20 -0
  53. data/html5-boilerplate/js/script.js +8 -0
  54. data/html5-boilerplate/robots.txt +5 -0
  55. data/html5-boilerplate/test/index.html +31 -0
  56. data/html5-boilerplate/test/qunit/qunit.css +148 -0
  57. data/html5-boilerplate/test/qunit/qunit.js +1265 -0
  58. data/html5-boilerplate/test/tests.js +24 -0
  59. data/index.html.patch +62 -0
  60. data/lib/generators/boilerplate/install/install_generator.rb +33 -0
  61. data/lib/generators/boilerplate/install/templates/apple-touch-icon-114x114-precomposed.png +0 -0
  62. data/lib/generators/boilerplate/install/templates/apple-touch-icon-57x57-precomposed.png +0 -0
  63. data/lib/generators/boilerplate/install/templates/apple-touch-icon-72x72-precomposed.png +0 -0
  64. data/lib/generators/boilerplate/install/templates/apple-touch-icon-precomposed.png +0 -0
  65. data/lib/generators/boilerplate/install/templates/apple-touch-icon.png +0 -0
  66. data/lib/generators/boilerplate/install/templates/crossdomain.xml +25 -0
  67. data/lib/generators/boilerplate/install/templates/favicon.ico +0 -0
  68. data/lib/generators/boilerplate/install/templates/humans.txt +43 -0
  69. data/lib/generators/boilerplate/install/templates/index.html +60 -0
  70. data/lib/generators/boilerplate/install/templates/robots.txt +5 -0
  71. data/lib/generators/boilerplate/resource_helpers.rb +13 -0
  72. data/lib/rails_boilerplate.rb +7 -0
  73. data/lib/rails_boilerplate/version.rb +3 -0
  74. data/rails-boilerplate.gemspec +24 -0
  75. data/test/dummy/Rakefile +7 -0
  76. data/test/dummy/app/controllers/application_controller.rb +3 -0
  77. data/test/dummy/app/controllers/home_controller.rb +5 -0
  78. data/test/dummy/app/helpers/application_helper.rb +2 -0
  79. data/test/dummy/app/views/home/index.html.erb +1 -0
  80. data/test/dummy/app/views/layouts/application.html.erb +68 -0
  81. data/test/dummy/config.ru +4 -0
  82. data/test/dummy/config/application.rb +43 -0
  83. data/test/dummy/config/boot.rb +10 -0
  84. data/test/dummy/config/database.yml +22 -0
  85. data/test/dummy/config/environment.rb +5 -0
  86. data/test/dummy/config/environments/development.rb +25 -0
  87. data/test/dummy/config/environments/production.rb +49 -0
  88. data/test/dummy/config/environments/test.rb +35 -0
  89. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  90. data/test/dummy/config/initializers/inflections.rb +10 -0
  91. data/test/dummy/config/initializers/mime_types.rb +5 -0
  92. data/test/dummy/config/initializers/secret_token.rb +7 -0
  93. data/test/dummy/config/initializers/session_store.rb +8 -0
  94. data/test/dummy/config/locales/en.yml +5 -0
  95. data/test/dummy/config/routes.rb +3 -0
  96. data/test/dummy/public/404.html +26 -0
  97. data/test/dummy/public/422.html +26 -0
  98. data/test/dummy/public/500.html +26 -0
  99. data/test/dummy/public/favicon.ico +0 -0
  100. data/test/dummy/public/javascripts/application.js +2 -0
  101. data/test/dummy/public/javascripts/controls.js +965 -0
  102. data/test/dummy/public/javascripts/dragdrop.js +974 -0
  103. data/test/dummy/public/javascripts/effects.js +1123 -0
  104. data/test/dummy/public/javascripts/prototype.js +6001 -0
  105. data/test/dummy/public/javascripts/rails.js +191 -0
  106. data/test/dummy/public/stylesheets/.gitkeep +0 -0
  107. data/test/dummy/script/rails +6 -0
  108. data/test/generators/fixtures/application.css +7 -0
  109. data/test/generators/fixtures/application.js +9 -0
  110. data/test/generators/generators_test_helper.rb +8 -0
  111. data/test/generators/install_generator_test.rb +51 -0
  112. data/test/rails_boilerplate_test.rb +16 -0
  113. data/test/test_helper.rb +12 -0
  114. data/vendor/assets/javascripts/modernizr.js +4 -0
  115. data/vendor/assets/javascripts/plugins.js +20 -0
  116. data/vendor/assets/stylesheets/reset.css +293 -0
  117. metadata +167 -0
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ *.swp
6
+ test/dummy/tmp/*
7
+ test/tmp
8
+ *.sqlite3
9
+ *.log
data/.gitmodules ADDED
@@ -0,0 +1,3 @@
1
+ [submodule "html5-boilerplate"]
2
+ path = html5-boilerplate
3
+ url = https://github.com/paulirish/html5-boilerplate.git
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in rails_boilerplate.gemspec
4
+ gemspec
5
+ gem 'rdoc'
6
+ gem 'rake'
7
+ gem 'rails', '~> 3.1.0'
8
+ gem 'sqlite3'
9
+ gem 'guard-minitest'
10
+ gem 'awesome_print', :require => "ap"
11
+ gem 'turn'
data/Guardfile ADDED
@@ -0,0 +1,14 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard 'minitest' do
5
+ # with Minitest::Unit
6
+ watch(%r|^test/(.*)_test\.rb|)
7
+ watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}#{m[2]}_test.rb" }
8
+ watch(%r|^test/test_helper\.rb|) { "test" }
9
+
10
+ # with Minitest::Spec
11
+ # watch(%r|^spec/(.*)_spec\.rb|)
12
+ # watch(%r|^lib/(.*)\.rb|) { |m| "spec/#{m[1]}_spec.rb" }
13
+ # watch(%r|^spec/spec_helper\.rb|) { "spec" }
14
+ end
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (C) 2011 by Christiaan Van den Poel
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # Rails Boilerplate
2
+
3
+ [Rails Boilerplate](https//github.com/khelben/rails-boilerplate) is a Rails (>= 3.1.0) gem which helps you to use the [html 5 boilerplate](http://html5boilerplate.com).
4
+
5
+ ## Install & usage
6
+
7
+ You'll need at least Rails 3.1. Then put this in your `Gemfile`:
8
+
9
+ ```ruby
10
+ gem "rails-boilerplate"
11
+ ```
12
+ This gives you a rake task `boilerplate:install` which does the following things:
13
+
14
+ * updates `app/views/layouts/application.html.erb` to include all the elements used in the [H5BP:index.html](https://github.com/paulirish/html5-boilerplate/blob/master/index.html) converted to a Rails compatible ERB file, complete with the necessary rails helper calls.
15
+
16
+ * adds `style.css`(renamed to reset.css), `modernizr.js` and `plugins.js` as assets
17
+
18
+ * copies over some static file (like favicons, touch icons, robots.txt, humans.txt) to the `public/` folder.
19
+
20
+ ## Development
21
+
22
+ If you want to checkout to code, be sure to do:
23
+
24
+ ```bash
25
+ git submodule init
26
+ git submodule update
27
+ bundle
28
+ ```
29
+
30
+ ## Todo
31
+
32
+ * add option to strip comments from the `application.html.erb`
33
+ * check whether prototype instead of jquery is used, if so adapt the generated files
34
+
35
+ ## Changelog
36
+
37
+ * 0.1.0: initial version.
data/Rakefile ADDED
@@ -0,0 +1,73 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require "bundler/gem_tasks"
8
+ require 'rdoc/task'
9
+ require 'fileutils'
10
+ include FileUtils
11
+
12
+ RDoc::Task.new(:rdoc) do |rdoc|
13
+ rdoc.rdoc_dir = 'rdoc'
14
+ rdoc.title = 'BackboneRails'
15
+ rdoc.options << '--line-numbers' << '--inline-source'
16
+ rdoc.rdoc_files.include('README.md')
17
+ rdoc.rdoc_files.include('lib/**/*.rb')
18
+ end
19
+
20
+ task :default => :test
21
+
22
+ require 'rake/testtask'
23
+
24
+ desc "Run all tests"
25
+ Rake::TestTask.new(:test) do |t|
26
+ t.libs << 'lib'
27
+ t.libs << 'test'
28
+ t.pattern = 'test/**/*_test.rb'
29
+ t.verbose = false
30
+ end
31
+
32
+ desc 'copies all necessary files from html5-boilerplate/ to the proper folders'
33
+ task :update_files => :patch_files do |t|
34
+ files = {
35
+ # stylesheets
36
+ 'html5-boilerplate/css/style.css' => 'vendor/assets/stylesheets/reset.css',
37
+ # javascripts
38
+ 'html5-boilerplate/js/libs/modernizr-2.0.6.min.js' => 'vendor/assets/javascripts/modernizr.js',
39
+ 'html5-boilerplate/js/plugins.js' => 'vendor/assets/javascripts/plugins.js',
40
+ # public files
41
+ 'html5-boilerplate/robots.txt' => 'lib/generators/boilerplate/install/templates',
42
+ 'html5-boilerplate/crossdomain.xml' => 'lib/generators/boilerplate/install/templates',
43
+ 'html5-boilerplate/favicon.ico' => 'lib/generators/boilerplate/install/templates',
44
+ 'html5-boilerplate/apple-touch-icon-114x114-precomposed.png' => 'lib/generators/boilerplate/install/templates',
45
+ 'html5-boilerplate/apple-touch-icon-57x57-precomposed.png' => 'lib/generators/boilerplate/install/templates',
46
+ 'html5-boilerplate/apple-touch-icon-72x72-precomposed.png' => 'lib/generators/boilerplate/install/templates',
47
+ 'html5-boilerplate/apple-touch-icon-precomposed.png' => 'lib/generators/boilerplate/install/templates',
48
+ 'html5-boilerplate/apple-touch-icon.png' => 'lib/generators/boilerplate/install/templates',
49
+ 'html5-boilerplate/humans.txt' => 'lib/generators/boilerplate/install/templates'
50
+ }
51
+
52
+ files.each do |src,dest|
53
+ raise "Cannot find src: #{src}" unless File.exists?(src)
54
+ cp src, dest, :verbose => true
55
+ end
56
+ end
57
+
58
+ task :patch_files do |t|
59
+ patches = {
60
+ "index.html.patch" => %w{html5-boilerplate/index.html lib/generators/boilerplate/install/templates/index.html}
61
+ }
62
+
63
+ patches.each do |patch, files|
64
+ src,dest = *files[0..1]
65
+ puts "Patching: #{src} with '#{patch}' (-> #{dest})"
66
+ %x{patch -p3 #{src} -i #{patch} -o #{dest}}
67
+ unless $? == 0
68
+ STDERR.puts "Error with patch '#{patch}' (-> #{dest})"
69
+ exit 1
70
+ end
71
+ end
72
+
73
+ end
@@ -0,0 +1 @@
1
+ * text=auto
@@ -0,0 +1,41 @@
1
+ # Numerous always-ignore extensions
2
+ *.diff
3
+ *.err
4
+ *.orig
5
+ *.log
6
+ *.rej
7
+ *.swo
8
+ *.swp
9
+ *.vi
10
+ *~
11
+ *.sass-cache
12
+
13
+ # OS or Editor folders
14
+ .DS_Store
15
+ Thumbs.db
16
+ .cache
17
+ .project
18
+ .settings
19
+ .tmproj
20
+ *.esproj
21
+ nbproject
22
+
23
+ # Dreamweaver added files
24
+ _notes
25
+ dwsync.xml
26
+
27
+ # Komodo
28
+ *.komodoproject
29
+ .komodotools
30
+
31
+ # Folders to ignore
32
+ .hg
33
+ .svn
34
+ .CVS
35
+ intermediate
36
+ publish
37
+ .idea
38
+
39
+ # build script local files
40
+ build/buildinfo.properties
41
+ build/config/buildinfo.properties
@@ -0,0 +1,506 @@
1
+ # Apache configuration file
2
+ # httpd.apache.org/docs/2.2/mod/quickreference.html
3
+
4
+ # Note .htaccess files are an overhead, this logic should be in your Apache config if possible
5
+ # httpd.apache.org/docs/2.2/howto/htaccess.html
6
+
7
+ # Techniques in here adapted from all over, including:
8
+ # Kroc Camen: camendesign.com/.htaccess
9
+ # perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
10
+ # Sample .htaccess file of CMS MODx: modxcms.com
11
+
12
+
13
+ ###
14
+ ### If you run a webserver other than apache, consider:
15
+ ### github.com/paulirish/html5-boilerplate-server-configs
16
+ ###
17
+
18
+
19
+
20
+ # ----------------------------------------------------------------------
21
+ # Better website experience for IE users
22
+ # ----------------------------------------------------------------------
23
+
24
+ # Force the latest IE version, in various cases when it may fall back to IE7 mode
25
+ # github.com/rails/rails/commit/123eb25#commitcomment-118920
26
+ # Use ChromeFrame if it's installed for a better experience for the poor IE folk
27
+
28
+ <IfModule mod_headers.c>
29
+ Header set X-UA-Compatible "IE=Edge,chrome=1"
30
+ # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
31
+ <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|xpi|safariextz|vcf)$" >
32
+ Header unset X-UA-Compatible
33
+ </FilesMatch>
34
+ </IfModule>
35
+
36
+
37
+ # ----------------------------------------------------------------------
38
+ # Cross-domain AJAX requests
39
+ # ----------------------------------------------------------------------
40
+
41
+ # Serve cross-domain ajax requests, disabled.
42
+ # enable-cors.org
43
+ # code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
44
+
45
+ # <IfModule mod_headers.c>
46
+ # Header set Access-Control-Allow-Origin "*"
47
+ # </IfModule>
48
+
49
+
50
+
51
+ # ----------------------------------------------------------------------
52
+ # Webfont access
53
+ # ----------------------------------------------------------------------
54
+
55
+ # Allow access from all domains for webfonts.
56
+ # Alternatively you could only whitelist your
57
+ # subdomains like "subdomain.example.com".
58
+
59
+ <FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
60
+ <IfModule mod_headers.c>
61
+ Header set Access-Control-Allow-Origin "*"
62
+ </IfModule>
63
+ </FilesMatch>
64
+
65
+
66
+
67
+ # ----------------------------------------------------------------------
68
+ # Proper MIME type for all files
69
+ # ----------------------------------------------------------------------
70
+
71
+
72
+ # JavaScript
73
+ # Normalize to standard type (it's sniffed in IE anyways)
74
+ # tools.ietf.org/html/rfc4329#section-7.2
75
+ AddType application/javascript js
76
+
77
+ # Audio
78
+ AddType audio/ogg oga ogg
79
+ AddType audio/mp4 m4a
80
+
81
+ # Video
82
+ AddType video/ogg ogv
83
+ AddType video/mp4 mp4 m4v
84
+ AddType video/webm webm
85
+
86
+ # SVG.
87
+ # Required for svg webfonts on iPad
88
+ # twitter.com/FontSquirrel/status/14855840545
89
+ AddType image/svg+xml svg svgz
90
+ AddEncoding gzip svgz
91
+
92
+ # Webfonts
93
+ AddType application/vnd.ms-fontobject eot
94
+ AddType application/x-font-ttf ttf ttc
95
+ AddType font/opentype otf
96
+ AddType application/x-font-woff woff
97
+
98
+ # Assorted types
99
+ AddType image/x-icon ico
100
+ AddType image/webp webp
101
+ AddType text/cache-manifest appcache manifest
102
+ AddType text/x-component htc
103
+ AddType application/x-chrome-extension crx
104
+ AddType application/x-xpinstall xpi
105
+ AddType application/octet-stream safariextz
106
+ AddType text/x-vcard vcf
107
+
108
+
109
+
110
+ # ----------------------------------------------------------------------
111
+ # Allow concatenation from within specific js and css files
112
+ # ----------------------------------------------------------------------
113
+
114
+ # e.g. Inside of script.combined.js you could have
115
+ # <!--#include file="libs/jquery-1.5.0.min.js" -->
116
+ # <!--#include file="plugins/jquery.idletimer.js" -->
117
+ # and they would be included into this single file.
118
+
119
+ # This is not in use in the boilerplate as it stands. You may
120
+ # choose to name your files in this way for this advantage or
121
+ # concatenate and minify them manually.
122
+ # Disabled by default.
123
+
124
+ #<FilesMatch "\.combined\.js$">
125
+ # Options +Includes
126
+ # AddOutputFilterByType INCLUDES application/javascript application/json
127
+ # SetOutputFilter INCLUDES
128
+ #</FilesMatch>
129
+ #<FilesMatch "\.combined\.css$">
130
+ # Options +Includes
131
+ # AddOutputFilterByType INCLUDES text/css
132
+ # SetOutputFilter INCLUDES
133
+ #</FilesMatch>
134
+
135
+
136
+ # ----------------------------------------------------------------------
137
+ # Gzip compression
138
+ # ----------------------------------------------------------------------
139
+
140
+ <IfModule mod_deflate.c>
141
+
142
+ # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
143
+ <IfModule mod_setenvif.c>
144
+ <IfModule mod_headers.c>
145
+ SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
146
+ RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
147
+ </IfModule>
148
+ </IfModule>
149
+
150
+ # HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
151
+ <IfModule filter_module>
152
+ FilterDeclare COMPRESS
153
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html
154
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css
155
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain
156
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml
157
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component
158
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript
159
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json
160
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml
161
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml
162
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml
163
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml
164
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject
165
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml
166
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $image/x-icon
167
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf
168
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype
169
+ FilterChain COMPRESS
170
+ FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
171
+ </IfModule>
172
+
173
+ <IfModule !mod_filter.c>
174
+ # Legacy versions of Apache
175
+ AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
176
+ AddOutputFilterByType DEFLATE application/javascript
177
+ AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
178
+ AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
179
+ AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
180
+ </IfModule>
181
+ </IfModule>
182
+
183
+
184
+
185
+ # ----------------------------------------------------------------------
186
+ # Expires headers (for better cache control)
187
+ # ----------------------------------------------------------------------
188
+
189
+ # These are pretty far-future expires headers.
190
+ # They assume you control versioning with cachebusting query params like
191
+ # <script src="application.js?20100608">
192
+ # Additionally, consider that outdated proxies may miscache
193
+ # www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
194
+
195
+ # If you don't use filenames to version, lower the CSS and JS to something like
196
+ # "access plus 1 week" or so.
197
+
198
+ <IfModule mod_expires.c>
199
+ ExpiresActive on
200
+
201
+ # Perhaps better to whitelist expires rules? Perhaps.
202
+ ExpiresDefault "access plus 1 month"
203
+
204
+ # cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
205
+ ExpiresByType text/cache-manifest "access plus 0 seconds"
206
+
207
+ # Your document html
208
+ ExpiresByType text/html "access plus 0 seconds"
209
+
210
+ # Data
211
+ ExpiresByType text/xml "access plus 0 seconds"
212
+ ExpiresByType application/xml "access plus 0 seconds"
213
+ ExpiresByType application/json "access plus 0 seconds"
214
+
215
+ # Feed
216
+ ExpiresByType application/rss+xml "access plus 1 hour"
217
+ ExpiresByType application/atom+xml "access plus 1 hour"
218
+
219
+ # Favicon (cannot be renamed)
220
+ ExpiresByType image/x-icon "access plus 1 week"
221
+
222
+ # Media: images, video, audio
223
+ ExpiresByType image/gif "access plus 1 month"
224
+ ExpiresByType image/png "access plus 1 month"
225
+ ExpiresByType image/jpg "access plus 1 month"
226
+ ExpiresByType image/jpeg "access plus 1 month"
227
+ ExpiresByType video/ogg "access plus 1 month"
228
+ ExpiresByType audio/ogg "access plus 1 month"
229
+ ExpiresByType video/mp4 "access plus 1 month"
230
+ ExpiresByType video/webm "access plus 1 month"
231
+
232
+ # HTC files (css3pie)
233
+ ExpiresByType text/x-component "access plus 1 month"
234
+
235
+ # Webfonts
236
+ ExpiresByType application/x-font-ttf "access plus 1 month"
237
+ ExpiresByType font/opentype "access plus 1 month"
238
+ ExpiresByType application/x-font-woff "access plus 1 month"
239
+ ExpiresByType image/svg+xml "access plus 1 month"
240
+ ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
241
+
242
+ # CSS and JavaScript
243
+ ExpiresByType text/css "access plus 1 year"
244
+ ExpiresByType application/javascript "access plus 1 year"
245
+
246
+ <IfModule mod_headers.c>
247
+ Header append Cache-Control "public"
248
+ </IfModule>
249
+
250
+ </IfModule>
251
+
252
+
253
+
254
+ # ----------------------------------------------------------------------
255
+ # ETag removal
256
+ # ----------------------------------------------------------------------
257
+
258
+ # FileETag None is not enough for every server.
259
+ <IfModule mod_headers.c>
260
+ Header unset ETag
261
+ </IfModule>
262
+
263
+ # Since we're sending far-future expires, we don't need ETags for
264
+ # static content.
265
+ # developer.yahoo.com/performance/rules.html#etags
266
+ FileETag None
267
+
268
+
269
+
270
+ # ----------------------------------------------------------------------
271
+ # Stop screen flicker in IE on CSS rollovers
272
+ # ----------------------------------------------------------------------
273
+
274
+ # The following directives stop screen flicker in IE on CSS rollovers - in
275
+ # combination with the "ExpiresByType" rules for images (see above). If
276
+ # needed, un-comment the following rules.
277
+
278
+ # BrowserMatch "MSIE" brokenvary=1
279
+ # BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
280
+ # BrowserMatch "Opera" !brokenvary
281
+ # SetEnvIf brokenvary 1 force-no-vary
282
+
283
+
284
+
285
+ # ----------------------------------------------------------------------
286
+ # Cookie setting from iframes
287
+ # ----------------------------------------------------------------------
288
+
289
+ # Allow cookies to be set from iframes (for IE only)
290
+ # If needed, uncomment and specify a path or regex in the Location directive
291
+
292
+ # <IfModule mod_headers.c>
293
+ # <Location />
294
+ # Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
295
+ # </Location>
296
+ # </IfModule>
297
+
298
+
299
+
300
+ # ----------------------------------------------------------------------
301
+ # Start rewrite engine
302
+ # ----------------------------------------------------------------------
303
+
304
+ # Turning on the rewrite engine is necessary for the following rules and features.
305
+ # FollowSymLinks must be enabled for this to work.
306
+
307
+ <IfModule mod_rewrite.c>
308
+ Options +FollowSymlinks
309
+ RewriteEngine On
310
+ </IfModule>
311
+
312
+
313
+
314
+ # ----------------------------------------------------------------------
315
+ # Suppress or force the "www." at the beginning of URLs
316
+ # ----------------------------------------------------------------------
317
+
318
+ # The same content should never be available under two different URLs - especially not with and
319
+ # without "www." at the beginning, since this can cause SEO problems (duplicate content).
320
+ # That's why you should choose one of the alternatives and redirect the other one.
321
+
322
+ # By default option 1 (no "www.") is activated. Remember: Shorter URLs are sexier.
323
+ # no-www.org/faq.php?q=class_b
324
+
325
+ # If you rather want to use option 2, just comment out all option 1 lines
326
+ # and uncomment option 2.
327
+ # IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME!
328
+
329
+ # ----------------------------------------------------------------------
330
+
331
+ # Option 1:
332
+ # Rewrite "www.example.com -> example.com"
333
+
334
+ <IfModule mod_rewrite.c>
335
+ RewriteCond %{HTTPS} !=on
336
+ RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
337
+ RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
338
+ </IfModule>
339
+
340
+ # ----------------------------------------------------------------------
341
+
342
+ # Option 2:
343
+ # To rewrite "example.com -> www.example.com" uncomment the following lines.
344
+ # Be aware that the following rule might not be a good idea if you
345
+ # use "real" subdomains for certain parts of your website.
346
+
347
+ # <IfModule mod_rewrite.c>
348
+ # RewriteCond %{HTTPS} !=on
349
+ # RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
350
+ # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
351
+ # </IfModule>
352
+
353
+
354
+
355
+ # ----------------------------------------------------------------------
356
+ # Built-in filename-based cache busting
357
+ # ----------------------------------------------------------------------
358
+
359
+ # If you're not using the build script to manage your filename version revving,
360
+ # you might want to consider enabling this, which will route requests for
361
+ # /css/style.20110203.css to /css/style.css
362
+
363
+ # To understand why this is important and a better idea than all.css?v1231,
364
+ # read: github.com/paulirish/html5-boilerplate/wiki/Version-Control-with-Cachebusting
365
+
366
+ # Uncomment to enable.
367
+ # <IfModule mod_rewrite.c>
368
+ # RewriteCond %{REQUEST_FILENAME} !-f
369
+ # RewriteCond %{REQUEST_FILENAME} !-d
370
+ # RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
371
+ # </IfModule>
372
+
373
+
374
+
375
+ # ----------------------------------------------------------------------
376
+ # Prevent SSL cert warnings
377
+ # ----------------------------------------------------------------------
378
+
379
+ # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
380
+ # https://www.example.com when your cert only allows https://secure.example.com
381
+ # Uncomment the following lines to use this feature.
382
+
383
+ # <IfModule mod_rewrite.c>
384
+ # RewriteCond %{SERVER_PORT} !^443
385
+ # RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L]
386
+ # </IfModule>
387
+
388
+
389
+
390
+ # ----------------------------------------------------------------------
391
+ # Prevent 404 errors for non-existing redirected folders
392
+ # ----------------------------------------------------------------------
393
+
394
+ # without -MultiViews, Apache will give a 404 for a rewrite if a folder of the same name does not exist
395
+ # e.g. /blog/hello : webmasterworld.com/apache/3808792.htm
396
+
397
+ Options -MultiViews
398
+
399
+
400
+
401
+ # ----------------------------------------------------------------------
402
+ # Custom 404 page
403
+ # ----------------------------------------------------------------------
404
+
405
+ # You can add custom pages to handle 500 or 403 pretty easily, if you like.
406
+ ErrorDocument 404 /404.html
407
+
408
+
409
+
410
+ # ----------------------------------------------------------------------
411
+ # UTF-8 encoding
412
+ # ----------------------------------------------------------------------
413
+
414
+ # Use UTF-8 encoding for anything served text/plain or text/html
415
+ AddDefaultCharset utf-8
416
+
417
+ # Force UTF-8 for a number of file formats
418
+ AddCharset utf-8 .html .css .js .xml .json .rss .atom
419
+
420
+
421
+
422
+ # ----------------------------------------------------------------------
423
+ # A little more security
424
+ # ----------------------------------------------------------------------
425
+
426
+
427
+ # Do we want to advertise the exact version number of Apache we're running?
428
+ # Probably not.
429
+ ## This can only be enabled if used in httpd.conf - It will not work in .htaccess
430
+ # ServerTokens Prod
431
+
432
+
433
+ # "-Indexes" will have Apache block users from browsing folders without a default document
434
+ # Usually you should leave this activated, because you shouldn't allow everybody to surf through
435
+ # every folder on your server (which includes rather private places like CMS system folders).
436
+ <IfModule mod_autoindex.c>
437
+ Options -Indexes
438
+ </IfModule>
439
+
440
+
441
+ # Block access to "hidden" directories whose names begin with a period. This
442
+ # includes directories used by version control systems such as Subversion or Git.
443
+ <IfModule mod_rewrite.c>
444
+ RewriteRule "(^|/)\." - [F]
445
+ </IfModule>
446
+
447
+
448
+ # If your server is not already configured as such, the following directive
449
+ # should be uncommented in order to set PHP's register_globals option to OFF.
450
+ # This closes a major security hole that is abused by most XSS (cross-site
451
+ # scripting) attacks. For more information: http://php.net/register_globals
452
+ #
453
+ # IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
454
+ #
455
+ # Your server does not allow PHP directives to be set via .htaccess. In that
456
+ # case you must make this change in your php.ini file instead. If you are
457
+ # using a commercial web host, contact the administrators for assistance in
458
+ # doing this. Not all servers allow local php.ini files, and they should
459
+ # include all PHP configurations (not just this one), or you will effectively
460
+ # reset everything to PHP defaults. Consult www.php.net for more detailed
461
+ # information about setting PHP directives.
462
+
463
+ # php_flag register_globals Off
464
+
465
+ # Rename session cookie to something else, than PHPSESSID
466
+ # php_value session.name sid
467
+
468
+ # Do not show you are using PHP
469
+ # Note: Move this line to php.ini since it won't work in .htaccess
470
+ # php_flag expose_php Off
471
+
472
+ # Level of log detail - log all errors
473
+ # php_value error_reporting -1
474
+
475
+ # Write errors to log file
476
+ # php_flag log_errors On
477
+
478
+ # Do not display errors in browser (production - Off, development - On)
479
+ # php_flag display_errors Off
480
+
481
+ # Do not display startup errors (production - Off, development - On)
482
+ # php_flag display_startup_errors Off
483
+
484
+ # Format errors in plain text
485
+ # Note: Leave this setting 'On' for xdebug's var_dump() output
486
+ # php_flag html_errors Off
487
+
488
+ # Show multiple occurrence of error
489
+ # php_flag ignore_repeated_errors Off
490
+
491
+ # Show same errors from different sources
492
+ # php_flag ignore_repeated_source Off
493
+
494
+ # Size limit for error messages
495
+ # php_value log_errors_max_len 1024
496
+
497
+ # Don't precede error with string (doesn't accept empty string, use whitespace if you need)
498
+ # php_value error_prepend_string " "
499
+
500
+ # Don't prepend to error (doesn't accept empty string, use whitespace if you need)
501
+ # php_value error_append_string " "
502
+
503
+ # Increase cookie security
504
+ <IfModule php5_module>
505
+ php_value session.cookie_httponly true
506
+ </IfModule>