├── .gitignore ├── .gitmodules ├── Gemfile ├── Gemfile.lock ├── MIT-LICENSE ├── README.md ├── README.rdoc ├── Rakefile ├── app ├── assets │ ├── images │ │ └── outdatedbrowser_rails │ │ │ ├── .gitkeep │ │ │ └── .keep │ ├── javascripts │ │ ├── outdatedbrowser │ │ │ ├── outdatedBrowser.js │ │ │ └── require_outdatedbrowser.js.erb │ │ └── outdatedbrowser_rails │ │ │ └── application.js │ └── stylesheets │ │ ├── outdatedbrowser │ │ └── outdatedBrowser.css │ │ └── outdatedbrowser_rails │ │ └── application.css ├── controllers │ └── outdatedbrowser_rails │ │ └── application_controller.rb ├── helpers │ └── outdatedbrowser_rails │ │ └── application_helper.rb └── views │ ├── layouts │ └── outdatedbrowser_rails │ │ └── application.html.erb │ └── outdatedbrowser │ ├── _outdatedbrowser.html.erb │ └── lang │ ├── cs.html │ ├── da.html │ ├── de.html │ ├── el.html │ ├── en.html │ ├── es-pe.html │ ├── es.html │ ├── et.html │ ├── fa.html │ ├── fi.html │ ├── fr.html │ ├── hu.html │ ├── id.html │ ├── it.html │ ├── ja.html │ ├── ko.html │ ├── lt.html │ ├── nb.html │ ├── nl.html │ ├── pl.html │ ├── pt-br.html │ ├── pt.html │ ├── ro.html │ ├── ru.html │ ├── sl.html │ ├── sv.html │ ├── tr.html │ ├── uk.html │ ├── zh-cn.html │ └── zh-tw.html ├── bin └── rails ├── config └── routes.rb ├── lib ├── outdatedbrowser_rails.rb ├── outdatedbrowser_rails │ ├── engine.rb │ └── version.rb └── tasks │ └── outdatedbrowser_rails_tasks.rake ├── outdatedbrowser_rails.gemspec ├── script └── rails └── spec ├── dummy ├── README.rdoc ├── Rakefile ├── app │ ├── assets │ │ ├── images │ │ │ └── .keep │ │ ├── javascripts │ │ │ └── application.js │ │ └── stylesheets │ │ │ └── application.css │ ├── controllers │ │ ├── application_controller.rb │ │ ├── concerns │ │ │ └── .keep │ │ └── dummy_controller.rb │ ├── helpers │ │ └── application_helper.rb │ ├── mailers │ │ ├── .gitkeep │ │ └── .keep │ ├── models │ │ ├── .gitkeep │ │ ├── .keep │ │ └── concerns │ │ │ └── .keep │ └── views │ │ ├── dummy │ │ └── index.html.erb │ │ └── layouts │ │ └── application.html.erb ├── bin │ ├── bundle │ ├── rails │ ├── rake │ └── setup ├── config.ru ├── config │ ├── application.rb │ ├── boot.rb │ ├── database.yml │ ├── environment.rb │ ├── environments │ │ ├── development.rb │ │ ├── production.rb │ │ └── test.rb │ ├── initializers │ │ ├── assets.rb │ │ ├── backtrace_silencers.rb │ │ ├── cookies_serializer.rb │ │ ├── filter_parameter_logging.rb │ │ ├── inflections.rb │ │ ├── mime_types.rb │ │ ├── secret_token.rb │ │ ├── session_store.rb │ │ └── wrap_parameters.rb │ ├── locales │ │ ├── de.yml │ │ └── en.yml │ ├── routes.rb │ └── secrets.yml ├── lib │ └── assets │ │ ├── .gitkeep │ │ └── .keep ├── log │ ├── .gitkeep │ └── .keep ├── public │ ├── 404.html │ ├── 422.html │ ├── 500.html │ └── favicon.ico └── script │ └── rails ├── features └── asset_integration_spec.rb └── spec_helper.rb /.gitignore: -------------------------------------------------------------------------------- 1 | .bundle/ 2 | log/*.log 3 | pkg/ 4 | spec/dummy/db/*.sqlite3 5 | spec/dummy/log/*.log 6 | spec/dummy/tmp/ 7 | spec/dummy/.sass-cache 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vendor/outdated-browser"] 2 | path = vendor/outdated-browser 3 | url = https://github.com/burocratik/outdated-browser 4 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Declare your gem's dependencies in outdatedbrowser_rails.gemspec. 4 | # Bundler will treat runtime dependencies like base dependencies, and 5 | # development dependencies will be added by default to the :development group. 6 | gemspec 7 | 8 | # jquery-rails and sqlite3 are used by the dummy application 9 | gem "jquery-rails" 10 | gem "sqlite3" 11 | 12 | # Declare any dependencies that are still in development here instead of in 13 | # your gemspec. These might include edge Rails or gems from your path or 14 | # Git. Remember to move these dependencies to your gemspec before releasing 15 | # your gem to rubygems.org. 16 | 17 | # To use a debugger 18 | # gem 'byebug', group: [:development, :test] 19 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | outdatedbrowser_rails (1.1.5) 5 | rails (~> 6) 6 | 7 | GEM 8 | remote: https://rubygems.org/ 9 | specs: 10 | actioncable (6.1.7.2) 11 | actionpack (= 6.1.7.2) 12 | activesupport (= 6.1.7.2) 13 | nio4r (~> 2.0) 14 | websocket-driver (>= 0.6.1) 15 | actionmailbox (6.1.7.2) 16 | actionpack (= 6.1.7.2) 17 | activejob (= 6.1.7.2) 18 | activerecord (= 6.1.7.2) 19 | activestorage (= 6.1.7.2) 20 | activesupport (= 6.1.7.2) 21 | mail (>= 2.7.1) 22 | actionmailer (6.1.7.2) 23 | actionpack (= 6.1.7.2) 24 | actionview (= 6.1.7.2) 25 | activejob (= 6.1.7.2) 26 | activesupport (= 6.1.7.2) 27 | mail (~> 2.5, >= 2.5.4) 28 | rails-dom-testing (~> 2.0) 29 | actionpack (6.1.7.2) 30 | actionview (= 6.1.7.2) 31 | activesupport (= 6.1.7.2) 32 | rack (~> 2.0, >= 2.0.9) 33 | rack-test (>= 0.6.3) 34 | rails-dom-testing (~> 2.0) 35 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 36 | actiontext (6.1.7.2) 37 | actionpack (= 6.1.7.2) 38 | activerecord (= 6.1.7.2) 39 | activestorage (= 6.1.7.2) 40 | activesupport (= 6.1.7.2) 41 | nokogiri (>= 1.8.5) 42 | actionview (6.1.7.2) 43 | activesupport (= 6.1.7.2) 44 | builder (~> 3.1) 45 | erubi (~> 1.4) 46 | rails-dom-testing (~> 2.0) 47 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 48 | activejob (6.1.7.2) 49 | activesupport (= 6.1.7.2) 50 | globalid (>= 0.3.6) 51 | activemodel (6.1.7.2) 52 | activesupport (= 6.1.7.2) 53 | activerecord (6.1.7.2) 54 | activemodel (= 6.1.7.2) 55 | activesupport (= 6.1.7.2) 56 | activestorage (6.1.7.2) 57 | actionpack (= 6.1.7.2) 58 | activejob (= 6.1.7.2) 59 | activerecord (= 6.1.7.2) 60 | activesupport (= 6.1.7.2) 61 | marcel (~> 1.0) 62 | mini_mime (>= 1.1.0) 63 | activesupport (6.1.7.2) 64 | concurrent-ruby (~> 1.0, >= 1.0.2) 65 | i18n (>= 1.6, < 2) 66 | minitest (>= 5.1) 67 | tzinfo (~> 2.0) 68 | zeitwerk (~> 2.3) 69 | addressable (2.8.0) 70 | public_suffix (>= 2.0.2, < 5.0) 71 | builder (3.2.4) 72 | capybara (2.18.0) 73 | addressable 74 | mini_mime (>= 0.1.3) 75 | nokogiri (>= 1.3.3) 76 | rack (>= 1.0.0) 77 | rack-test (>= 0.5.4) 78 | xpath (>= 2.0, < 4.0) 79 | concurrent-ruby (1.2.0) 80 | crass (1.0.6) 81 | date (3.3.3) 82 | diff-lcs (1.4.4) 83 | erubi (1.12.0) 84 | globalid (1.1.0) 85 | activesupport (>= 5.0) 86 | i18n (1.12.0) 87 | concurrent-ruby (~> 1.0) 88 | jquery-rails (4.4.0) 89 | rails-dom-testing (>= 1, < 3) 90 | railties (>= 4.2.0) 91 | thor (>= 0.14, < 2.0) 92 | loofah (2.19.1) 93 | crass (~> 1.0.2) 94 | nokogiri (>= 1.5.9) 95 | mail (2.8.1) 96 | mini_mime (>= 0.1.1) 97 | net-imap 98 | net-pop 99 | net-smtp 100 | marcel (1.0.2) 101 | method_source (1.0.0) 102 | mini_mime (1.1.2) 103 | mini_portile2 (2.8.1) 104 | minitest (5.17.0) 105 | net-imap (0.3.4) 106 | date 107 | net-protocol 108 | net-pop (0.1.2) 109 | net-protocol 110 | net-protocol (0.2.1) 111 | timeout 112 | net-smtp (0.3.3) 113 | net-protocol 114 | nio4r (2.5.8) 115 | nokogiri (1.14.1) 116 | mini_portile2 (~> 2.8.0) 117 | racc (~> 1.4) 118 | public_suffix (4.0.6) 119 | racc (1.6.2) 120 | rack (2.2.6.2) 121 | rack-test (2.0.2) 122 | rack (>= 1.3) 123 | rails (6.1.7.2) 124 | actioncable (= 6.1.7.2) 125 | actionmailbox (= 6.1.7.2) 126 | actionmailer (= 6.1.7.2) 127 | actionpack (= 6.1.7.2) 128 | actiontext (= 6.1.7.2) 129 | actionview (= 6.1.7.2) 130 | activejob (= 6.1.7.2) 131 | activemodel (= 6.1.7.2) 132 | activerecord (= 6.1.7.2) 133 | activestorage (= 6.1.7.2) 134 | activesupport (= 6.1.7.2) 135 | bundler (>= 1.15.0) 136 | railties (= 6.1.7.2) 137 | sprockets-rails (>= 2.0.0) 138 | rails-dom-testing (2.0.3) 139 | activesupport (>= 4.2.0) 140 | nokogiri (>= 1.6) 141 | rails-html-sanitizer (1.5.0) 142 | loofah (~> 2.19, >= 2.19.1) 143 | railties (6.1.7.2) 144 | actionpack (= 6.1.7.2) 145 | activesupport (= 6.1.7.2) 146 | method_source 147 | rake (>= 12.2) 148 | thor (~> 1.0) 149 | rake (13.0.6) 150 | rspec-core (3.9.3) 151 | rspec-support (~> 3.9.3) 152 | rspec-expectations (3.9.4) 153 | diff-lcs (>= 1.2.0, < 2.0) 154 | rspec-support (~> 3.9.0) 155 | rspec-mocks (3.9.1) 156 | diff-lcs (>= 1.2.0, < 2.0) 157 | rspec-support (~> 3.9.0) 158 | rspec-rails (3.9.1) 159 | actionpack (>= 3.0) 160 | activesupport (>= 3.0) 161 | railties (>= 3.0) 162 | rspec-core (~> 3.9.0) 163 | rspec-expectations (~> 3.9.0) 164 | rspec-mocks (~> 3.9.0) 165 | rspec-support (~> 3.9.0) 166 | rspec-support (3.9.4) 167 | sprockets (4.2.0) 168 | concurrent-ruby (~> 1.0) 169 | rack (>= 2.2.4, < 4) 170 | sprockets-rails (3.4.2) 171 | actionpack (>= 5.2) 172 | activesupport (>= 5.2) 173 | sprockets (>= 3.0.0) 174 | sqlite3 (1.4.2) 175 | thor (1.2.1) 176 | timeout (0.3.1) 177 | tzinfo (2.0.6) 178 | concurrent-ruby (~> 1.0) 179 | websocket-driver (0.7.5) 180 | websocket-extensions (>= 0.1.0) 181 | websocket-extensions (0.1.5) 182 | xpath (3.2.0) 183 | nokogiri (~> 1.8) 184 | zeitwerk (2.6.6) 185 | 186 | PLATFORMS 187 | ruby 188 | 189 | DEPENDENCIES 190 | capybara (~> 2.14) 191 | jquery-rails 192 | outdatedbrowser_rails! 193 | rspec-rails (~> 3) 194 | sqlite3 195 | 196 | BUNDLED WITH 197 | 1.13.6 198 | -------------------------------------------------------------------------------- /MIT-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2016 Luisa Lima 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OutdatedbrowserRails 2 | 3 | This project bundles the excellent Burocratik's 4 | [Outdated Browser](https://github.com/burocratik/outdated-browser) 5 | detector for use with the rails 4+ asset pipeline. 6 | 7 | [![Gem Version](https://badge.fury.io/rb/outdatedbrowser_rails.svg)](http://badge.fury.io/rb/outdatedbrowser_rails) 8 | 9 | ## About 10 | 11 | The version numbers of this gem follow the versioning of 12 | [Outdated Browser](https://github.com/burocratik/outdated-browser), 13 | and the gem follows the `feature/languages` gem, which includes 14 | translations for several languages. The gem uses `I18n.locale` to select the correct locale, and falls back to `en` if the selected locale does not exist. 15 | 16 | ## Installation 17 | 18 | Add this line to your application's Gemfile: 19 | 20 | ```ruby 21 | gem 'outdatedbrowser_rails' 22 | ``` 23 | 24 | ## Usage 25 | 26 | ### 1. Include Outdated Browser assets 27 | 28 | Add this line to your `application.js`: 29 | 30 | ```js 31 | //= require outdatedbrowser/outdatedBrowser 32 | ``` 33 | 34 | Add this line to your `application.css` || `application.scss`: 35 | 36 | ```css 37 | //= require outdatedbrowser/outdatedBrowser 38 | ``` 39 | ### 2. Require Outdated Browser 40 | 41 | In the view where you want to use this, add: 42 | 43 | ```erb 44 | <%= render 'outdatedbrowser/outdatedbrowser' %> 45 | ``` 46 | 47 | At the **bottom** of the body (make sure it's included **after** 48 | _application.js_), add: 49 | 50 | ```erb 51 | <%= javascript_include_tag 'outdatedbrowser/require_outdatedbrowser' %> 52 | ``` 53 | 54 | ### Testing the integration in your app 55 | 56 | * Of course, ideally use an outdated browser to test. 57 | * With an up-to-date browser: 58 | * In the view where you included the partial, check that `#outdated` 59 | is present. 60 | * See how it looks: `$('#outdated').show()` 61 | 62 | ## Contributing 63 | 64 | Feel free to open an issue if you find something that could be improved. 65 | 66 | Here are a couple of things worth noting: 67 | 68 | * This is a mountable rails engine tested with `rspec` and `capybara`. 69 | For more info or a good reference to make your own, see 70 | [this good tutorial](http://viget.com/extend/rails-engine-testing-with-rspec-capybara-and-factorygirl). 71 | * The reference to `outdatedbrowser` is a git submodule. For a good 72 | reference on how to update git submodules, see [this](https://chrisjean.com/git-submodules-adding-using-removing-and-updating/). 73 | * The rake task `rake generate:assets` copies the assets from the 74 | `vendor/outdated-browser` folder (which is a git submodule) to the 75 | engine `app` folder. 76 | * The rake task `clean` cleans the copied assets. 77 | * To run tests, use `rspec spec`. 78 | 79 | Finally, to contribute: 80 | 81 | 1. Fork it 82 | 2. Create your feature branch (`git checkout -b my-new-feature`) 83 | 3. Run tests using `rspec spec`, and make sure they are green! 84 | 4. Add tests to `spec/features`, if necessary. 85 | 5. Commit your changes (`git commit -am 'Add some feature'`) 86 | 6. Push to the branch (`git push origin my-new-feature`) 87 | 7. Create new Pull Request 88 | -------------------------------------------------------------------------------- /README.rdoc: -------------------------------------------------------------------------------- 1 | # OutdatedbrowserRails 2 | 3 | This project bundles the excellent Burocratik's 4 | [Outdated Browser](https://github.com/burocratik/outdated-browser) 5 | detector for use with the rails 3.1+ asset pipeline. 6 | 7 | {Gem Version}[http://badge.fury.io/rb/outdatedbrowser_rails] 8 | 9 | ## Installation 10 | 11 | Add this line to your application's Gemfile: 12 | 13 | ```ruby 14 | gem 'outdatedbrowser_rails' 15 | ``` 16 | 17 | ## Usage 18 | 19 | ### Including Outdated Browser assets 20 | 21 | Add this line to your `application.js`: 22 | 23 | ```js 24 | //= require outdatedbrowser/outdatedBrowser 25 | ``` 26 | 27 | Add this line to your `application.css` || `application.scss`: 28 | 29 | ```css 30 | //= require outdatedbrowser/outdatedBrowser 31 | ``` 32 | ### Using the gem's strategy to require Outdated Browser 33 | 34 | In the view where you want to use this, add: 35 | 36 | ```erb 37 | <%= render 'outdatedbrowser/outdatedbrowser' %> 38 | ``` 39 | 40 | At the **bottom** of the body (make sure it's included **after** 41 | _application.js_), add: 42 | 43 | ```erb 44 | <%= javascript_include_tag 'outdatedbrowser/require_outdatedbrowser' %> 45 | ``` 46 | 47 | The gem uses `i18n` for the message strings, you can use other strings 48 | in your application by 49 | [looking at the keys](https://github.com/luisalima/outdatedbrowser_rails/blob/master/config/locales/en.yml) 50 | and overriding them. 51 | 52 | ### Manual approach to require Outdated Browser 53 | 54 | See the [Outdated Browser usage guide](https://github.com/burocratik/outdated-browser#how-to-use-it). 55 | 56 | #### Testing the integration in your app 57 | 58 | * Of course, ideally use an outdated browser to test. 59 | * With an up-to-date browser: 60 | * In the view where you included the partial, check that `#outdated` 61 | is present. 62 | * See how it looks: `$('#outdated').show() 63 | 64 | ## Contributing 65 | 66 | Feel free to open an issue if you find something that could be improved. 67 | 68 | Here are a couple of things worth noting: 69 | 70 | * This is a mountable rails engine tested with `rspec` and `capybara`. 71 | For more info or a good reference to make your own, see 72 | [this good tutorial](http://viget.com/extend/rails-engine-testing-with-rspec-capybara-and-factorygirl). 73 | * The rake task `rake generate:assets` copies the assets from the 74 | `vendor/outdated-browser` folder (which is a git submodule) to the 75 | engine `app` folder. 76 | * The rake task `clean` cleans the copied assets. 77 | * To run tests, use `rspec spec`. 78 | 79 | Finally, to contribute: 80 | 81 | 1. Fork it 82 | 2. Create your feature branch (`git checkout -b my-new-feature`) 83 | 3. Run tests using `rspec spec`, and make sure they are green! 84 | 4. Add tests to `spec/features`, if necessary. 85 | 5. Commit your changes (`git commit -am 'Add some feature'`) 86 | 6. Push to the branch (`git push origin my-new-feature`) 87 | 7. Create new Pull Request 88 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | begin 3 | require 'bundler/setup' 4 | rescue LoadError 5 | puts 'You must `gem install bundler` and `bundle install` to run rake tasks' 6 | end 7 | begin 8 | require 'rdoc/task' 9 | rescue LoadError 10 | require 'rdoc/rdoc' 11 | require 'rake/rdoctask' 12 | RDoc::Task = Rake::RDocTask 13 | end 14 | 15 | RDoc::Task.new(:rdoc) do |rdoc| 16 | rdoc.rdoc_dir = 'rdoc' 17 | rdoc.title = 'OutdatedbrowserRails' 18 | rdoc.options << '--line-numbers' 19 | rdoc.rdoc_files.include('README.rdoc') 20 | rdoc.rdoc_files.include('lib/**/*.rb') 21 | end 22 | 23 | APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__) 24 | load 'rails/tasks/engine.rake' 25 | 26 | Bundler::GemHelper.install_tasks 27 | 28 | require 'rspec/core' 29 | require 'rspec/core/rake_task' 30 | desc "Run all specs in spec directory (excluding plugin specs)" 31 | RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare') 32 | task :default => :spec 33 | 34 | dependencies = { 35 | javascripts: ['outdatedBrowser.js'], 36 | stylesheets: ['outdatedBrowser.css'] 37 | } 38 | 39 | origin = 'vendor/outdated-browser/outdatedbrowser' 40 | 41 | desc "Clean assets" 42 | task :clean do 43 | dependencies.each do |filetype, filenames| 44 | filenames.each do |filename| 45 | rm_rf "app/assets/#{filetype}/outdatedbrowser/#{filename}" 46 | end 47 | end 48 | rm_rf 'app/views/outdatedbrowser/lang' 49 | end 50 | 51 | namespace :generate do 52 | desc "Generate assets" 53 | task :assets do 54 | Rake.rake_output_message "Copying javascripts" 55 | target_dir = "app/assets/javascripts/outdatedbrowser" 56 | mkdir_p target_dir 57 | puts FileUtils.cp(Dir.glob("#{origin}/outdatedBrowser.js"), target_dir) 58 | 59 | Rake.rake_output_message "Copying css files" 60 | target_dir = "app/assets/stylesheets/outdatedbrowser" 61 | mkdir_p target_dir 62 | puts FileUtils.cp(Dir.glob("#{origin}/outdatedBrowser.css"), target_dir) 63 | 64 | Rake.rake_output_message "Copying html files" 65 | target_dir = "app/views/outdatedbrowser" 66 | puts FileUtils.cp_r(Dir.glob("#{origin}/lang"), target_dir) 67 | end 68 | end 69 | -------------------------------------------------------------------------------- /app/assets/images/outdatedbrowser_rails/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/app/assets/images/outdatedbrowser_rails/.gitkeep -------------------------------------------------------------------------------- /app/assets/images/outdatedbrowser_rails/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/app/assets/images/outdatedbrowser_rails/.keep -------------------------------------------------------------------------------- /app/assets/javascripts/outdatedbrowser/outdatedBrowser.js: -------------------------------------------------------------------------------- 1 | /*!-------------------------------------------------------------------- 2 | JAVASCRIPT "Outdated Browser" 3 | Version: 1.1.2 - 2015 4 | author: Burocratik 5 | website: http://www.burocratik.com 6 | * @preserve 7 | -----------------------------------------------------------------------*/ 8 | var outdatedBrowser = function(options) { 9 | 10 | //Variable definition (before ajax) 11 | var outdated = document.getElementById("outdated"); 12 | 13 | // Default settings 14 | this.defaultOpts = { 15 | bgColor: '#f25648', 16 | color: '#ffffff', 17 | lowerThan: 'transform', 18 | languagePath: '../outdatedbrowser/lang/en.html' 19 | } 20 | 21 | if (options) { 22 | //assign css3 property to IE browser version 23 | if (options.lowerThan == 'IE8' || options.lowerThan == 'borderSpacing') { 24 | options.lowerThan = 'borderSpacing'; 25 | } else if (options.lowerThan == 'IE9' || options.lowerThan == 'boxShadow') { 26 | options.lowerThan = 'boxShadow'; 27 | } else if (options.lowerThan == 'IE10' || options.lowerThan == 'transform' || options.lowerThan == '' || typeof options.lowerThan === "undefined") { 28 | options.lowerThan = 'transform'; 29 | } else if (options.lowerThan == 'IE11' || options.lowerThan == 'borderImage') { 30 | options.lowerThan = 'borderImage'; 31 | } 32 | //all properties 33 | this.defaultOpts.bgColor = options.bgColor; 34 | this.defaultOpts.color = options.color; 35 | this.defaultOpts.lowerThan = options.lowerThan; 36 | this.defaultOpts.languagePath = options.languagePath; 37 | 38 | bkgColor = this.defaultOpts.bgColor; 39 | txtColor = this.defaultOpts.color; 40 | cssProp = this.defaultOpts.lowerThan; 41 | languagePath = this.defaultOpts.languagePath; 42 | } else { 43 | bkgColor = this.defaultOpts.bgColor; 44 | txtColor = this.defaultOpts.color; 45 | cssProp = this.defaultOpts.lowerThan; 46 | languagePath = this.defaultOpts.languagePath; 47 | } //end if options 48 | 49 | 50 | //Define opacity and fadeIn/fadeOut functions 51 | var done = true; 52 | 53 | function function_opacity(opacity_value) { 54 | outdated.style.opacity = opacity_value / 100; 55 | outdated.style.filter = 'alpha(opacity=' + opacity_value + ')'; 56 | } 57 | 58 | // function function_fade_out(opacity_value) { 59 | // function_opacity(opacity_value); 60 | // if (opacity_value == 1) { 61 | // outdated.style.display = 'none'; 62 | // done = true; 63 | // } 64 | // } 65 | 66 | function function_fade_in(opacity_value) { 67 | function_opacity(opacity_value); 68 | if (opacity_value == 1) { 69 | outdated.style.display = 'block'; 70 | } 71 | if (opacity_value == 100) { 72 | done = true; 73 | } 74 | } 75 | 76 | //check if element has a particular class 77 | // function hasClass(element, cls) { 78 | // return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1; 79 | // } 80 | 81 | var supports = ( function() { 82 | var div = document.createElement('div'); 83 | var vendors = 'Khtml Ms O Moz Webkit'.split(' '); 84 | var len = vendors.length; 85 | 86 | return function(prop) { 87 | if (prop in div.style) return true; 88 | 89 | prop = prop.replace(/^[a-z]/, function(val) { 90 | return val.toUpperCase(); 91 | }); 92 | 93 | while (len--) { 94 | if (vendors[len] + prop in div.style) { 95 | return true; 96 | } 97 | } 98 | return false; 99 | }; 100 | } )(); 101 | 102 | //if browser does not supports css3 property (transform=default), if does > exit all this 103 | if (!supports('' + cssProp + '')) { 104 | if (done && outdated.style.opacity !== '1') { 105 | done = false; 106 | for (var i = 1; i <= 100; i++) { 107 | setTimeout(( function(x) { 108 | return function() { 109 | function_fade_in(x); 110 | }; 111 | } )(i), i * 8); 112 | } 113 | } 114 | } else { 115 | return; 116 | } //end if 117 | 118 | //Check AJAX Options: if languagePath == '' > use no Ajax way, html is needed inside
119 | if (languagePath === ' ' || languagePath.length == 0) { 120 | startStylesAndEvents(); 121 | } else { 122 | grabFile(languagePath); 123 | } 124 | 125 | //events and colors 126 | function startStylesAndEvents() { 127 | var btnClose = document.getElementById("btnCloseUpdateBrowser"); 128 | var btnUpdate = document.getElementById("btnUpdateBrowser"); 129 | 130 | //check settings attributes 131 | outdated.style.backgroundColor = bkgColor; 132 | //way too hard to put !important on IE6 133 | outdated.style.color = txtColor; 134 | outdated.children[0].style.color = txtColor; 135 | outdated.children[1].style.color = txtColor; 136 | 137 | //check settings attributes 138 | btnUpdate.style.color = txtColor; 139 | // btnUpdate.style.borderColor = txtColor; 140 | if (btnUpdate.style.borderColor) { 141 | btnUpdate.style.borderColor = txtColor; 142 | } 143 | btnClose.style.color = txtColor; 144 | 145 | //close button 146 | btnClose.onmousedown = function() { 147 | outdated.style.display = 'none'; 148 | return false; 149 | }; 150 | 151 | //Override the update button color to match the background color 152 | btnUpdate.onmouseover = function() { 153 | this.style.color = bkgColor; 154 | this.style.backgroundColor = txtColor; 155 | }; 156 | btnUpdate.onmouseout = function() { 157 | this.style.color = txtColor; 158 | this.style.backgroundColor = bkgColor; 159 | }; 160 | } //end styles and events 161 | 162 | 163 | // IF AJAX with request ERROR > insert english default 164 | var ajaxEnglishDefault = '
Your browser is out-of-date!
' 165 | + '

Update your browser to view this website correctly. Update my browser now

' 166 | + '

×

'; 167 | 168 | 169 | //** AJAX FUNCTIONS - Bulletproof Ajax by Jeremy Keith ** 170 | function getHTTPObject() { 171 | var xhr = false; 172 | if (window.XMLHttpRequest) { 173 | xhr = new XMLHttpRequest(); 174 | } else if (window.ActiveXObject) { 175 | try { 176 | xhr = new ActiveXObject("Msxml2.XMLHTTP"); 177 | } catch ( e ) { 178 | try { 179 | xhr = new ActiveXObject("Microsoft.XMLHTTP"); 180 | } catch ( e ) { 181 | xhr = false; 182 | } 183 | } 184 | } 185 | return xhr; 186 | }//end function 187 | 188 | function grabFile(file) { 189 | var request = getHTTPObject(); 190 | if (request) { 191 | request.onreadystatechange = function() { 192 | displayResponse(request); 193 | }; 194 | request.open("GET", file, true); 195 | request.send(null); 196 | } 197 | return false; 198 | } //end grabFile 199 | 200 | function displayResponse(request) { 201 | var insertContentHere = document.getElementById("outdated"); 202 | if (request.readyState == 4) { 203 | if (request.status == 200 || request.status == 304) { 204 | insertContentHere.innerHTML = request.responseText; 205 | } else { 206 | insertContentHere.innerHTML = ajaxEnglishDefault; 207 | } 208 | startStylesAndEvents(); 209 | } 210 | return false; 211 | }//end displayResponse 212 | 213 | ////////END of outdatedBrowser function 214 | }; 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | -------------------------------------------------------------------------------- /app/assets/javascripts/outdatedbrowser/require_outdatedbrowser.js.erb: -------------------------------------------------------------------------------- 1 | <%# encoding: utf-8 %> 2 | 3 | //event listener: DOM ready 4 | function addLoadEvent(func) { 5 | var oldonload = window.onload; 6 | if (typeof window.onload != 'function') { 7 | window.onload = func; 8 | } else { 9 | window.onload = function() { 10 | oldonload(); 11 | func(); 12 | } 13 | } 14 | } 15 | 16 | //call plugin function after DOM ready 17 | addLoadEvent( 18 | outdatedBrowser({ 19 | bgColor: '#f25648', 20 | color: '#ffffff', 21 | lowerThan: 'transform', 22 | languagePath: '' 23 | }) 24 | ); 25 | -------------------------------------------------------------------------------- /app/assets/javascripts/outdatedbrowser_rails/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require_tree . 14 | -------------------------------------------------------------------------------- /app/assets/stylesheets/outdatedbrowser/outdatedBrowser.css: -------------------------------------------------------------------------------- 1 | /*!-------------------------------------------------------------------- 2 | STYLES "Outdated Browser" 3 | Version: 1.1.2 - 2015 4 | author: Burocratik 5 | website: http://www.burocratik.com 6 | * @preserve 7 | -----------------------------------------------------------------------*/ 8 | #outdated{ 9 | display: none; position: fixed; top: 0; left: 0; width: 100%; height: 170px; 10 | text-align: center; text-transform: uppercase; z-index:1500; 11 | background-color: #f25648; color: #ffffff; 12 | } 13 | * html #outdated{position: absolute;} 14 | #outdated h6{font-size: 25px; line-height: 25px; margin: 30px 0 10px;} 15 | #outdated p{font-size: 12px; line-height: 12px; margin: 0;} 16 | #outdated #btnUpdateBrowser{ 17 | display: block; position: relative; padding: 10px 20px; margin: 30px auto 0; width: 230px; /*need for IE*/ 18 | color: #ffffff; text-decoration: none; border: 2px solid #ffffff; cursor: pointer; 19 | } 20 | #outdated #btnUpdateBrowser:hover{color: #f25648; background-color:#ffffff;} 21 | #outdated .last{position: absolute; top: 10px; right: 25px; width: 20px; height: 20px;} 22 | #outdated .last[dir='rtl']{right: auto !important; left: 25px !important;} 23 | #outdated #btnCloseUpdateBrowser{ 24 | display: block; position: relative; width: 100%; height: 100%; 25 | text-decoration: none; color: #ffffff; font-size: 36px; line-height: 36px; 26 | } 27 | -------------------------------------------------------------------------------- /app/assets/stylesheets/outdatedbrowser_rails/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any styles 10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 | * file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /app/controllers/outdatedbrowser_rails/application_controller.rb: -------------------------------------------------------------------------------- 1 | module OutdatedbrowserRails 2 | class ApplicationController < ActionController::Base 3 | protect_from_forgery with: :exception 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/helpers/outdatedbrowser_rails/application_helper.rb: -------------------------------------------------------------------------------- 1 | module OutdatedbrowserRails 2 | module ApplicationHelper 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/views/layouts/outdatedbrowser_rails/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | OutdatedbrowserRails 5 | <%= stylesheet_link_tag "outdatedbrowser_rails/application", media: "all" %> 6 | <%= javascript_include_tag "outdatedbrowser_rails/application" %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/_outdatedbrowser.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= render file: "outdatedbrowser/lang/#{I18n.locale}" rescue render file: "outdatedbrowser/lang/en" %> 3 |
4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/cs.html: -------------------------------------------------------------------------------- 1 |
Váš prohlížeč je zastaralý!
2 |

Pro správné zobrazení těchto stránek aktualizujte svůj prohlížeč. Aktualizovat prohlížeč nyní

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/da.html: -------------------------------------------------------------------------------- 1 |
Din browser er forældet!
2 |

Opdatér din browser for at få vist denne hjemmeside ordentligt. Opdater min browser nu

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/de.html: -------------------------------------------------------------------------------- 1 |
Ihr Browser ist veraltet!
2 |

Bitte aktualisieren Sie Ihren Browser, um diese Website korrekt darzustellen. Den Browser jetzt aktualisieren

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/el.html: -------------------------------------------------------------------------------- 1 |
Το προγραμμα περιηγησης (φυλλομετρητης/browser) που χρησιμοποιεις για το internet δεν ειναι ενημερωμενο!
2 |

Ενημερωσε το προγραμμα περιηγησης για να δεις αυτη την ιστοσελιδα σωστα. Ενημερωση του προγραμματος περιηγησης τωρα

3 |

×

-------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/en.html: -------------------------------------------------------------------------------- 1 |
Your browser is out of date!
2 |

Update your browser to view this website correctly. Update my browser now

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/es-pe.html: -------------------------------------------------------------------------------- 1 |
¡Tu navegador no está actualizado!
2 |

Actualiza tu navegador para visualizar esta página correctamente. Actualizar mi navegador ahora!

3 |

×

-------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/es.html: -------------------------------------------------------------------------------- 1 |
¡Tu navegador está anticuado!
2 |

Actualiza tu navegador para ver esta página correctamente. Actualizar mi navegador ahora

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/et.html: -------------------------------------------------------------------------------- 1 |
Sinu veebilehitseja on vananenud!
2 |

Palun uuenda oma veebilehitsejat, et näha lehekülge korrektselt. Uuenda oma veebilehitsejat kohe

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/fa.html: -------------------------------------------------------------------------------- 1 |
مرورگر شما منسوخ شده است!
2 |

جهت مشاهده صحیح این وبسایت، مرورگرتان را بروز رسانی نمایید. همین حالا مرورگرم را بروز کن

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/fi.html: -------------------------------------------------------------------------------- 1 |
Selaimesi on vanhentunut!
2 |

Lataa ajantasainen selain nähdäksesi tämän sivun oikein. Päivitä selaimeni nyt

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/fr.html: -------------------------------------------------------------------------------- 1 |
Votre navigateur est désuet!
2 |

Mettez à jour votre navigateur pour afficher correctement ce site Web. Mettre à jour maintenant

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/hu.html: -------------------------------------------------------------------------------- 1 |
A böngészője elavult!
2 |

Frissítse vagy cserélje le a böngészőjét. A böngészőm frissítése

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/id.html: -------------------------------------------------------------------------------- 1 |
Browser yang Anda gunakan sudah ketinggalan zaman!
2 |

Perbaharuilah browser Anda agar bisa menjelajahi website ini dengan nyaman. Perbaharui browser sekarang

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/it.html: -------------------------------------------------------------------------------- 1 |
Il tuo browser non è aggiornato!
2 |

Aggiornalo per vedere questo sito correttamente. Aggiorna ora

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/ja.html: -------------------------------------------------------------------------------- 1 |
あなたのブラウザはもう古いです
2 |

こちらのサイトを閲覧するためには、ブラウザをアップグレードしてください。 ブラウザをアップグレードする

3 |

×

-------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/ko.html: -------------------------------------------------------------------------------- 1 |
브라우저가 오래되었습니다!
2 |

이 웹 페이지가 현재 브라우저에서는 정상적으로 보이지 않을 수 있습니다. 지금 브라우저를 업그레이드하세요!

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/lt.html: -------------------------------------------------------------------------------- 1 |
Jūsų naršyklės versija yra pasenusi!
2 |

Atnaujinkite savo naršyklę, kad galėtumėte peržiūrėti šią svetainę tinkamai. Atnaujinti naršyklę

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/nb.html: -------------------------------------------------------------------------------- 1 |
Nettleseren din er utdatert!
2 |

Du burde oppdatere din nettleser for å oppleve både denne og flere andre nettsteder best mulig. Les mer om hvordan du kan oppdatere din nettleser.

3 |

×

4 | 5 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/nl.html: -------------------------------------------------------------------------------- 1 |
Je gebruikt een verouderde browser!
2 |

Update je browser om deze website correct te bekijken. Update mijn browser nu

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/pl.html: -------------------------------------------------------------------------------- 1 |
Twoja przeglądarka jest przestarzała!
2 |

Zaktualizuj swoją przeglądarkę, aby poprawnie wyświetlić tę stronę. Zaktualizuj przeglądarkę już teraz

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/pt-br.html: -------------------------------------------------------------------------------- 1 |
O seu navegador está desatualizado!
2 |

Atualize o seu navegador para ter uma melhor experiência e visualização deste site. Atualize o seu navegador agora

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/pt.html: -------------------------------------------------------------------------------- 1 |
O seu browser está desatualizado!
2 |

Atualize o seu browser para ter uma melhor experiência e visualização deste site. Atualize o seu browser agora

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/ro.html: -------------------------------------------------------------------------------- 1 |
Browserul este învechit!
2 |

Actualizați browserul pentru a vizualiza corect acest site. Actualizați browserul acum!

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/ru.html: -------------------------------------------------------------------------------- 1 |
Ваш браузер устарел!
2 |

Обновите ваш браузер для правильного отображения этого сайта. Обновить мой браузер

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/sl.html: -------------------------------------------------------------------------------- 1 |
Vaš brskalnik je zastarel!
2 |

Za pravilen prikaz spletne strani posodobite vaš brskalnik. Posodobi brskalnik

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/sv.html: -------------------------------------------------------------------------------- 1 |
Din webbläsare stödjs ej längre!
2 |

Uppdatera din webbläsare för att webbplatsen ska visas korrekt. Uppdatera min webbläsare nu

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/tr.html: -------------------------------------------------------------------------------- 1 |
Tarayıcınız güncel değil!
2 |

Web sitemizi düzgün görüntülemek için tarayıcınızı güncelleyin.Şimdi güncelle

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/uk.html: -------------------------------------------------------------------------------- 1 |
Ваш браузер застарів!
2 |

Оновіть ваш браузер для правильного відображення цього сайта. Оновити мій браузер

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/zh-cn.html: -------------------------------------------------------------------------------- 1 |
您的浏览器已过时
2 |

要正常浏览本网站请升级您的浏览器。现在升级

3 |

×

4 | -------------------------------------------------------------------------------- /app/views/outdatedbrowser/lang/zh-tw.html: -------------------------------------------------------------------------------- 1 |
您的瀏覽器已過時
2 |

要正常瀏覽本網站請升級您的瀏覽器。 現在升級​​

3 |

×

-------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. 3 | 4 | ENGINE_ROOT = File.expand_path('../..', __FILE__) 5 | ENGINE_PATH = File.expand_path('../../lib/outdatedbrowser_rails/engine', __FILE__) 6 | 7 | # Set up gems listed in the Gemfile. 8 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 9 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 10 | 11 | require 'rails/all' 12 | require 'rails/engine/commands' 13 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | OutdatedbrowserRails::Engine.routes.draw do 2 | end 3 | -------------------------------------------------------------------------------- /lib/outdatedbrowser_rails.rb: -------------------------------------------------------------------------------- 1 | require "outdatedbrowser_rails/engine" 2 | 3 | module OutdatedbrowserRails 4 | end 5 | -------------------------------------------------------------------------------- /lib/outdatedbrowser_rails/engine.rb: -------------------------------------------------------------------------------- 1 | module OutdatedbrowserRails 2 | class Engine < ::Rails::Engine 3 | isolate_namespace OutdatedbrowserRails 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /lib/outdatedbrowser_rails/version.rb: -------------------------------------------------------------------------------- 1 | module OutdatedbrowserRails 2 | VERSION = "1.1.5" 3 | end 4 | -------------------------------------------------------------------------------- /lib/tasks/outdatedbrowser_rails_tasks.rake: -------------------------------------------------------------------------------- 1 | # desc "Explaining what the task does" 2 | # task :outdatedbrowser_rails do 3 | # # Task goes here 4 | # end 5 | -------------------------------------------------------------------------------- /outdatedbrowser_rails.gemspec: -------------------------------------------------------------------------------- 1 | $:.push File.expand_path("../lib", __FILE__) 2 | 3 | # Maintain your gem's version: 4 | require "outdatedbrowser_rails/version" 5 | 6 | # Describe your gem and declare its dependencies: 7 | Gem::Specification.new do |s| 8 | s.name = "outdatedbrowser_rails" 9 | s.version = OutdatedbrowserRails::VERSION 10 | s.authors = ["Luisa Lima"] 11 | s.email = ["luisamoyalima@gmail.com"] 12 | s.homepage = "https://github.com/luisalima/outdatedbrowser_rails" 13 | s.summary = "Adds outdatedbrowser assets to the rails asset pipeline." 14 | s.description = "A gem to automate using outdated-browser with Rails >= 4." 15 | s.license = "MIT" 16 | 17 | s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"] 18 | 19 | s.add_dependency "rails", "~> 6" 20 | 21 | s.test_files = Dir["spec/**/*"] 22 | s.add_development_dependency "capybara", "~> 2.14" 23 | s.add_development_dependency "rspec-rails", "~> 3" 24 | end 25 | -------------------------------------------------------------------------------- /script/rails: -------------------------------------------------------------------------------- 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 | ENGINE_ROOT = File.expand_path('../..', __FILE__) 5 | ENGINE_PATH = File.expand_path('../../lib/outdatedbrowser_rails/engine', __FILE__) 6 | 7 | require 'rails/all' 8 | require 'rails/engine/commands' 9 | -------------------------------------------------------------------------------- /spec/dummy/README.rdoc: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | 26 | 27 | Please feel free to use a different markup language if you do not plan to run 28 | rake doc:app. 29 | -------------------------------------------------------------------------------- /spec/dummy/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /spec/dummy/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/spec/dummy/app/assets/images/.keep -------------------------------------------------------------------------------- /spec/dummy/app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require_tree . 14 | //= require outdatedbrowser/outdatedBrowser 15 | -------------------------------------------------------------------------------- /spec/dummy/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any styles 10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 | * file per style scope. 12 | * 13 | *= require_tree . 14 | *= require outdatedbrowser/outdatedBrowser 15 | *= require_self 16 | */ 17 | -------------------------------------------------------------------------------- /spec/dummy/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /spec/dummy/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/spec/dummy/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /spec/dummy/app/controllers/dummy_controller.rb: -------------------------------------------------------------------------------- 1 | class DummyController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /spec/dummy/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /spec/dummy/app/mailers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/spec/dummy/app/mailers/.gitkeep -------------------------------------------------------------------------------- /spec/dummy/app/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/spec/dummy/app/mailers/.keep -------------------------------------------------------------------------------- /spec/dummy/app/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/spec/dummy/app/models/.gitkeep -------------------------------------------------------------------------------- /spec/dummy/app/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/spec/dummy/app/models/.keep -------------------------------------------------------------------------------- /spec/dummy/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/spec/dummy/app/models/concerns/.keep -------------------------------------------------------------------------------- /spec/dummy/app/views/dummy/index.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'outdatedbrowser/outdatedbrowser' %> 2 | 3 | <%= javascript_include_tag 'outdatedbrowser/require_outdatedbrowser' %> 4 | -------------------------------------------------------------------------------- /spec/dummy/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dummy 5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spec/dummy/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /spec/dummy/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /spec/dummy/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /spec/dummy/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | 4 | # path to your application root. 5 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 6 | 7 | Dir.chdir APP_ROOT do 8 | # This script is a starting point to setup your application. 9 | # Add necessary setup steps to this file: 10 | 11 | puts "== Installing dependencies ==" 12 | system "gem install bundler --conservative" 13 | system "bundle check || bundle install" 14 | 15 | # puts "\n== Copying sample files ==" 16 | # unless File.exist?("config/database.yml") 17 | # system "cp config/database.yml.sample config/database.yml" 18 | # end 19 | 20 | puts "\n== Preparing database ==" 21 | system "bin/rake db:setup" 22 | 23 | puts "\n== Removing old logs and tempfiles ==" 24 | system "rm -f log/*" 25 | system "rm -rf tmp/cache" 26 | 27 | puts "\n== Restarting application server ==" 28 | system "touch tmp/restart.txt" 29 | end 30 | -------------------------------------------------------------------------------- /spec/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /spec/dummy/config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | Bundler.require(*Rails.groups) 6 | require "outdatedbrowser_rails" 7 | 8 | module Dummy 9 | class Application < Rails::Application 10 | # Settings in config/environments/* take precedence over those specified here. 11 | # Application configuration should go into files in config/initializers 12 | # -- all .rb files in that directory are automatically loaded. 13 | 14 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 15 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 16 | # config.time_zone = 'Central Time (US & Canada)' 17 | 18 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 19 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 20 | # config.i18n.default_locale = :de 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /spec/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 5 | $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) 6 | -------------------------------------------------------------------------------- /spec/dummy/config/database.yml: -------------------------------------------------------------------------------- 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 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /spec/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /spec/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.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 | # Do not eager load code on boot. 10 | config.eager_load = false 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 | # Raise an error on page load if there are pending migrations. 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | 30 | # Asset digests allow you to set far-future HTTP expiration dates on all assets, 31 | # yet still be able to expire them through the digest params. 32 | config.assets.digest = true 33 | 34 | # Adds additional error checking when serving assets at runtime. 35 | # Checks for improperly declared sprockets dependencies. 36 | # Raises helpful error messages. 37 | config.assets.raise_runtime_errors = true 38 | 39 | # Raises error for missing translations 40 | # config.action_view.raise_on_missing_translations = true 41 | end 42 | -------------------------------------------------------------------------------- /spec/dummy/config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Rails.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 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both threaded web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application 18 | # Add `rack-cache` to your Gemfile before enabling this. 19 | # For large-scale production use, consider using a caching reverse proxy like 20 | # NGINX, varnish or squid. 21 | # config.action_dispatch.rack_cache = true 22 | 23 | # Disable serving static files from the `/public` folder by default since 24 | # Apache or NGINX already handles this. 25 | config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? 26 | 27 | # Compress JavaScripts and CSS. 28 | config.assets.js_compressor = :uglifier 29 | # config.assets.css_compressor = :sass 30 | 31 | # Do not fallback to assets pipeline if a precompiled asset is missed. 32 | config.assets.compile = false 33 | 34 | # Asset digests allow you to set far-future HTTP expiration dates on all assets, 35 | # yet still be able to expire them through the digest params. 36 | config.assets.digest = true 37 | 38 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb 39 | 40 | # Specifies the header that your server uses for sending files. 41 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 42 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 43 | 44 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 45 | # config.force_ssl = true 46 | 47 | # Use the lowest log level to ensure availability of diagnostic information 48 | # when problems arise. 49 | config.log_level = :debug 50 | 51 | # Prepend all log lines with the following tags. 52 | # config.log_tags = [ :subdomain, :uuid ] 53 | 54 | # Use a different logger for distributed setups. 55 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 56 | 57 | # Use a different cache store in production. 58 | # config.cache_store = :mem_cache_store 59 | 60 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 61 | # config.action_controller.asset_host = 'http://assets.example.com' 62 | 63 | # Ignore bad email addresses and do not raise email delivery errors. 64 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 65 | # config.action_mailer.raise_delivery_errors = false 66 | 67 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 68 | # the I18n.default_locale when a translation cannot be found). 69 | config.i18n.fallbacks = true 70 | 71 | # Send deprecation notices to registered listeners. 72 | config.active_support.deprecation = :notify 73 | 74 | # Use default logging formatter so that PID and timestamp are not suppressed. 75 | config.log_formatter = ::Logger::Formatter.new 76 | 77 | # Do not dump schema after migrations. 78 | config.active_record.dump_schema_after_migration = false 79 | end 80 | -------------------------------------------------------------------------------- /spec/dummy/config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Rails.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 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static file server for tests with Cache-Control for performance. 16 | config.serve_static_files = true 17 | config.static_cache_control = 'public, max-age=3600' 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Randomize the order test cases are executed. 35 | config.active_support.test_order = :random 36 | 37 | # Print deprecation notices to the stderr. 38 | config.active_support.deprecation = :stderr 39 | 40 | # Raises error for missing translations 41 | # config.action_view.raise_on_missing_translations = true 42 | end 43 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 11 | # Rails.application.config.assets.precompile += %w( search.js ) 12 | Rails.application.config.assets.precompile += %w( outdatedbrowser/require_outdatedbrowser.js ) 13 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 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! 8 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json 4 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 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 = '6fce1f15c07183bc847edfb6531f8213d86860676766bcb189c06293e8ff88801bb418cb677400eaacea4f29990ae2d9659c8da4567129307cc425f25dfdebfc' 8 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_dummy_session' 4 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 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 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /spec/dummy/config/locales/de.yml: -------------------------------------------------------------------------------- 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 | de: 5 | hello: "Hallo" 6 | -------------------------------------------------------------------------------- /spec/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /spec/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | root to: 'dummy#index' 3 | # The priority is based upon order of creation: first created -> highest priority. 4 | # See how all your routes lay out with "rake routes". 5 | 6 | # You can have the root of your site routed with "root" 7 | # root 'welcome#index' 8 | 9 | # Example of regular route: 10 | # get 'products/:id' => 'catalog#view' 11 | 12 | # Example of named route that can be invoked with purchase_url(id: product.id) 13 | # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase 14 | 15 | # Example resource route (maps HTTP verbs to controller actions automatically): 16 | # resources :products 17 | 18 | # Example resource route with options: 19 | # resources :products do 20 | # member do 21 | # get 'short' 22 | # post 'toggle' 23 | # end 24 | # 25 | # collection do 26 | # get 'sold' 27 | # end 28 | # end 29 | 30 | # Example resource route with sub-resources: 31 | # resources :products do 32 | # resources :comments, :sales 33 | # resource :seller 34 | # end 35 | 36 | # Example resource route with more complex sub-resources: 37 | # resources :products do 38 | # resources :comments 39 | # resources :sales do 40 | # get 'recent', on: :collection 41 | # end 42 | # end 43 | 44 | # Example resource route with concerns: 45 | # concern :toggleable do 46 | # post 'toggle' 47 | # end 48 | # resources :posts, concerns: :toggleable 49 | # resources :photos, concerns: :toggleable 50 | 51 | # Example resource route within a namespace: 52 | # namespace :admin do 53 | # # Directs /admin/products/* to Admin::ProductsController 54 | # # (app/controllers/admin/products_controller.rb) 55 | # resources :products 56 | # end 57 | end 58 | -------------------------------------------------------------------------------- /spec/dummy/config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: 90933819fb6dbd10aec182cee01dab04a3a5c815ab82060c6bdce097171ed4759666bf18838f65e95dafbb5214e93c475b8fcf500b43bc69d94257d2352a8157 15 | 16 | test: 17 | secret_key_base: c0d849af9fe283e19dd24ce3ed1e88b009be42eeab51dacda7cfe7b09a553f6c24a006b35281e0951218d8ae19263c3d51c7ff937e0ade73d747a01e7c9008c7 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /spec/dummy/lib/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/spec/dummy/lib/assets/.gitkeep -------------------------------------------------------------------------------- /spec/dummy/lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/spec/dummy/lib/assets/.keep -------------------------------------------------------------------------------- /spec/dummy/log/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/spec/dummy/log/.gitkeep -------------------------------------------------------------------------------- /spec/dummy/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/spec/dummy/log/.keep -------------------------------------------------------------------------------- /spec/dummy/public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /spec/dummy/public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /spec/dummy/public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /spec/dummy/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisalima/outdatedbrowser_rails/b9d4151127d70c795323d431272845b3747f72a7/spec/dummy/public/favicon.ico -------------------------------------------------------------------------------- /spec/dummy/script/rails: -------------------------------------------------------------------------------- 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' 7 | -------------------------------------------------------------------------------- /spec/features/asset_integration_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'static assets integration' do 4 | it 'provides outdatedBrowser.js on the asset pipeline' do 5 | visit '/assets/outdatedbrowser/outdatedBrowser.js' 6 | expect(page.text).to match(/outdatedBrowser/) 7 | end 8 | 9 | it 'provides require_outdatedbrowser.js on the asset pipeline' do 10 | visit '/assets/outdatedbrowser/require_outdatedbrowser.js' 11 | expect(page.text).to match(/outdatedBrowser/) 12 | end 13 | 14 | it 'provides outdatedBrowser.css on the asset pipeline' do 15 | visit '/assets/outdatedbrowser/outdatedBrowser.css' 16 | expect(page.text).to match(/Outdated Browser/) 17 | end 18 | 19 | it 'provides a partial with the div on the asset pipeline' do 20 | visit '/' 21 | expect(page).to have_selector('#outdated') 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path("../dummy/config/environment.rb", __FILE__) 3 | require 'rspec/rails' 4 | # require 'rspec/autorun' 5 | require 'capybara/rspec' 6 | 7 | Rails.backtrace_cleaner.remove_silencers! 8 | # Load support files 9 | Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } 10 | 11 | RSpec.configure do |config| 12 | include Capybara::DSL 13 | config.mock_with :rspec 14 | config.use_transactional_fixtures = true 15 | config.infer_base_class_for_anonymous_controllers = false 16 | config.order = "random" 17 | config.color = true 18 | config.tty = true 19 | config.formatter = :documentation 20 | end 21 | --------------------------------------------------------------------------------