noindex 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +6 -0
  3. data/lib/noindex/version.rb +1 -1
  4. data/noindex.gemspec +1 -0
  5. data/spec/controllers/default_controller_spec.rb +20 -0
  6. data/spec/controllers/noindex_controller_spec.rb +20 -0
  7. data/spec/controllers/skip_noindex_controller_spec.rb +20 -0
  8. data/spec/dummy/Gemfile +26 -0
  9. data/spec/dummy/README.rdoc +28 -0
  10. data/spec/dummy/Rakefile +6 -0
  11. data/spec/dummy/app/assets/images/.keep +0 -0
  12. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  13. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  14. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  15. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  16. data/spec/dummy/app/controllers/default_controller.rb +10 -0
  17. data/spec/dummy/app/controllers/noindex_controller.rb +12 -0
  18. data/spec/dummy/app/controllers/skip_noindex_controller.rb +12 -0
  19. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  20. data/spec/dummy/app/helpers/default_helper.rb +2 -0
  21. data/spec/dummy/app/helpers/noindex_helper.rb +2 -0
  22. data/spec/dummy/app/helpers/skip_noindex_helper.rb +2 -0
  23. data/spec/dummy/app/mailers/.keep +0 -0
  24. data/spec/dummy/app/models/.keep +0 -0
  25. data/spec/dummy/app/models/concerns/.keep +0 -0
  26. data/spec/dummy/app/views/default/edit.html.erb +2 -0
  27. data/spec/dummy/app/views/default/index.html.erb +2 -0
  28. data/spec/dummy/app/views/default/new.html.erb +2 -0
  29. data/spec/dummy/app/views/layouts/application.html.erb +15 -0
  30. data/spec/dummy/app/views/noindex/edit.html.erb +2 -0
  31. data/spec/dummy/app/views/noindex/index.html.erb +2 -0
  32. data/spec/dummy/app/views/noindex/new.html.erb +2 -0
  33. data/spec/dummy/app/views/skip_noindex/edit.html.erb +2 -0
  34. data/spec/dummy/app/views/skip_noindex/index.html.erb +2 -0
  35. data/spec/dummy/app/views/skip_noindex/new.html.erb +2 -0
  36. data/spec/dummy/bin/bundle +3 -0
  37. data/spec/dummy/bin/rails +4 -0
  38. data/spec/dummy/bin/rake +4 -0
  39. data/spec/dummy/config.ru +4 -0
  40. data/spec/dummy/config/application.rb +31 -0
  41. data/spec/dummy/config/boot.rb +4 -0
  42. data/spec/dummy/config/environment.rb +5 -0
  43. data/spec/dummy/config/environments/development.rb +23 -0
  44. data/spec/dummy/config/environments/production.rb +65 -0
  45. data/spec/dummy/config/environments/test.rb +36 -0
  46. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  47. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  48. data/spec/dummy/config/initializers/inflections.rb +16 -0
  49. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  50. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  51. data/spec/dummy/config/initializers/session_store.rb +3 -0
  52. data/spec/dummy/config/initializers/wrap_parameters.rb +9 -0
  53. data/spec/dummy/config/locales/en.yml +23 -0
  54. data/spec/dummy/config/routes.rb +13 -0
  55. data/spec/dummy/db/seeds.rb +7 -0
  56. data/spec/dummy/lib/assets/.keep +0 -0
  57. data/spec/dummy/lib/tasks/.keep +0 -0
  58. data/spec/dummy/public/404.html +58 -0
  59. data/spec/dummy/public/422.html +58 -0
  60. data/spec/dummy/public/500.html +57 -0
  61. data/spec/dummy/public/favicon.ico +0 -0
  62. data/spec/dummy/public/robots.txt +5 -0
  63. data/spec/dummy/vendor/assets/javascripts/.keep +0 -0
  64. data/spec/dummy/vendor/assets/stylesheets/.keep +0 -0
  65. data/spec/requests/noindex_metatag_spec.rb +13 -0
  66. data/spec/spec_helper.rb +13 -0
  67. metadata +154 -34
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: da1e4b87a1647ded92dd5fb6ef40717d22db92e5
4
+ data.tar.gz: d7fd5e5921da64039df9107537c9976e535d4cc8
5
+ SHA512:
6
+ metadata.gz: af44f6c4c2d9c4bb6f16c372662b1ab7042d67ef671a06548207785010d0520ea97a8484dd53654dc2bd27ac08a2219b88f657cf184221a8b5b015ba59b6be49
7
+ data.tar.gz: dd2451b7cb915881f6ab816d1612833d6de414c505a5cd6f1267e6fbf2ff80528b8e6352632a432d940ef26387fe0f0ba00b06d6d5f45556a8788ed9b7c8a070
data/Rakefile CHANGED
@@ -1 +1,7 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new
5
+
6
+ task default: :spec
7
+ task test: :spec
@@ -1,3 +1,3 @@
1
1
  module Noindex
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/noindex.gemspec CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "redcarpet"
24
24
  spec.add_development_dependency "yard"
25
+ spec.add_development_dependency "rspec-rails"
25
26
 
26
27
  spec.add_dependency "rails", ">= 3.0.0"
27
28
  end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe DefaultController do
4
+
5
+ it 'assigns @noindex for new action' do
6
+ get 'new'
7
+ assigns(:noindex).should be_true
8
+ end
9
+
10
+ it 'assigns @noindex for edit action' do
11
+ get 'edit'
12
+ assigns(:noindex).should be_true
13
+ end
14
+
15
+ it 'does not assign @noindex for index action' do
16
+ get 'index'
17
+ assigns(:noindex).should_not be
18
+ end
19
+
20
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe NoindexController do
4
+
5
+ it 'assigns @noindex for new action' do
6
+ get 'new'
7
+ assigns(:noindex).should be_true
8
+ end
9
+
10
+ it 'does not assign @noindex for edit action' do
11
+ get 'edit'
12
+ assigns(:noindex).should_not be
13
+ end
14
+
15
+ it 'assigns @noindex for index action' do
16
+ get 'index'
17
+ assigns(:noindex).should be_true
18
+ end
19
+
20
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe SkipNoindexController do
4
+
5
+ it 'does not assign @noindex for new action' do
6
+ get 'new'
7
+ assigns(:noindex).should_not be
8
+ end
9
+
10
+ it 'assigns @noindex for edit action' do
11
+ get 'edit'
12
+ assigns(:noindex).should be_true
13
+ end
14
+
15
+ it 'does not assign @noindex for index action' do
16
+ get 'index'
17
+ assigns(:noindex).should_not be
18
+ end
19
+
20
+ end
@@ -0,0 +1,26 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
4
+ gem 'rails', '4.0.0'
5
+ gem 'noindex', path: '../../'
6
+
7
+
8
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
9
+ gem 'jbuilder', '~> 1.2'
10
+
11
+ group :doc do
12
+ # bundle exec rake doc:rails generates the API under doc/api.
13
+ gem 'sdoc', require: false
14
+ end
15
+
16
+ # Use ActiveModel has_secure_password
17
+ # gem 'bcrypt-ruby', '~> 3.0.0'
18
+
19
+ # Use unicorn as the app server
20
+ # gem 'unicorn'
21
+
22
+ # Use Capistrano for deployment
23
+ # gem 'capistrano', group: :development
24
+
25
+ # Use debugger
26
+ # gem 'debugger', group: [:development, :test]
@@ -0,0 +1,28 @@
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
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
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
+ Dummy::Application.load_tasks
File without changes
@@ -0,0 +1,13 @@
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 vendor/assets/javascripts of plugins, if any, 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/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,13 @@
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 vendor/assets/stylesheets of plugins, if any, 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 top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,5 @@
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
File without changes
@@ -0,0 +1,10 @@
1
+ class DefaultController < ApplicationController
2
+ def new
3
+ end
4
+
5
+ def edit
6
+ end
7
+
8
+ def index
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ class NoindexController < ApplicationController
2
+ noindex only: [ :new, :index ]
3
+
4
+ def new
5
+ end
6
+
7
+ def edit
8
+ end
9
+
10
+ def index
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class SkipNoindexController < ApplicationController
2
+ skip_noindex only: [ :new ]
3
+
4
+ def new
5
+ end
6
+
7
+ def edit
8
+ end
9
+
10
+ def index
11
+ end
12
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module DefaultHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module NoindexHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module SkipNoindexHelper
2
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ <h1>Default#edit</h1>
2
+ <p>Find me in app/views/default/edit.html.erb</p>
@@ -0,0 +1,2 @@
1
+ <h1>Default#index</h1>
2
+ <p>Find me in app/views/default/index.html.erb</p>
@@ -0,0 +1,2 @@
1
+ <h1>Default#new</h1>
2
+ <p>Find me in app/views/default/new.html.erb</p>
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
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
+ <%= noindex_meta_tag %>
9
+ </head>
10
+ <body>
11
+
12
+ <%= yield %>
13
+
14
+ </body>
15
+ </html>
@@ -0,0 +1,2 @@
1
+ <h1>Noindex#edit</h1>
2
+ <p>Find me in app/views/noindex/edit.html.erb</p>
@@ -0,0 +1,2 @@
1
+ <h1>Noindex#index</h1>
2
+ <p>Find me in app/views/noindex/index.html.erb</p>
@@ -0,0 +1,2 @@
1
+ <h1>Noindex#new</h1>
2
+ <p>Find me in app/views/noindex/new.html.erb</p>
@@ -0,0 +1,2 @@
1
+ <h1>SkipNoindex#edit</h1>
2
+ <p>Find me in app/views/skip_noindex/edit.html.erb</p>
@@ -0,0 +1,2 @@
1
+ <h1>SkipNoindex#index</h1>
2
+ <p>Find me in app/views/skip_noindex/index.html.erb</p>
@@ -0,0 +1,2 @@
1
+ <h1>SkipNoindex#new</h1>
2
+ <p>Find me in app/views/skip_noindex/new.html.erb</p>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,31 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ # require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ # require "sprockets/railtie"
8
+ # require "rails/test_unit/railtie"
9
+
10
+ # Require the gems listed in Gemfile, including any gems
11
+ # you've limited to :test, :development, or :production.
12
+ Bundler.require(:default, Rails.env)
13
+
14
+ module Dummy
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- all .rb files in that directory are automatically loaded.
19
+
20
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
21
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
22
+ # config.time_zone = 'Central Time (US & Canada)'
23
+
24
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
25
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
26
+ # config.i18n.default_locale = :de
27
+
28
+ # Disable the asset pipeline.
29
+ config.assets.enabled = false
30
+ end
31
+ end
@@ -0,0 +1,4 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Dummy::Application.initialize!
@@ -0,0 +1,23 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # 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
+
23
+ end
@@ -0,0 +1,65 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both thread 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 nginx, varnish or squid.
20
+ # config.action_dispatch.rack_cache = true
21
+
22
+ # Disable Rails's static asset server (Apache or nginx will already do this).
23
+ config.serve_static_assets = false
24
+
25
+
26
+ # Specifies the header that your server uses for sending files.
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # Set to :debug to see everything in the log.
34
+ config.log_level = :info
35
+
36
+ # Prepend all log lines with the following tags.
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups.
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production.
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+
49
+ # Ignore bad email addresses and do not raise email delivery errors.
50
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
51
+ # config.action_mailer.raise_delivery_errors = false
52
+
53
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
54
+ # the I18n.default_locale when a translation can not be found).
55
+ config.i18n.fallbacks = true
56
+
57
+ # Send deprecation notices to registered listeners.
58
+ config.active_support.deprecation = :notify
59
+
60
+ # Disable automatic flushing of the log to improve performance.
61
+ # config.autoflush_log = false
62
+
63
+ # Use default logging formatter so that PID and timestamp are not suppressed.
64
+ config.log_formatter = ::Logger::Formatter.new
65
+ end
@@ -0,0 +1,36 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # 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 asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = 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
+ # Print deprecation notices to the stderr.
35
+ config.active_support.deprecation = :stderr
36
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,4 @@
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]
@@ -0,0 +1,16 @@
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
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,12 @@
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 your secret_key_base is kept private
11
+ # if you're sharing your code publicly.
12
+ Dummy::Application.config.secret_key_base = '22d2bc6410aea5170e8a171209040faf8e96bdfcd75dce3ecc8609cdbca1489eedcce98dea0ad196de897b14c12c06ed51784873c93762942a1baf1a1406c780'
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,9 @@
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
@@ -0,0 +1,23 @@
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"
@@ -0,0 +1,13 @@
1
+ Dummy::Application.routes.draw do
2
+ get "skip_noindex/new"
3
+ get "skip_noindex/edit"
4
+ get "skip_noindex/index"
5
+
6
+ get "noindex/new"
7
+ get "noindex/edit"
8
+ get "noindex/index"
9
+
10
+ get "default/new"
11
+ get "default/edit"
12
+ get "default/index"
13
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
File without changes
File without changes
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/404.html -->
52
+ <div class="dialog">
53
+ <h1>The page you were looking for doesn't exist.</h1>
54
+ <p>You may have mistyped the address or the page may have moved.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/422.html -->
52
+ <div class="dialog">
53
+ <h1>The change you wanted was rejected.</h1>
54
+ <p>Maybe you tried to change something you didn't have access to.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/500.html -->
52
+ <div class="dialog">
53
+ <h1>We're sorry, but something went wrong.</h1>
54
+ </div>
55
+ <p>If you are the application owner check the logs for more information.</p>
56
+ </body>
57
+ </html>
File without changes
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-agent: *
5
+ # Disallow: /
File without changes
File without changes
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Noindex meta tag' do
4
+ it 'is located on /default/new' do
5
+ get '/default/new'
6
+ assert_select 'meta[name="robots"][content="noindex"]'
7
+ end
8
+
9
+ it 'is not located on /default/index' do
10
+ get '/default/index'
11
+ assert_select 'meta[name="robots"][content="noindex"]', false
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ ENV["RAILS_ENV"] ||= "test"
2
+
3
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
4
+ require 'rspec/rails'
5
+ require 'noindex'
6
+
7
+ RSpec.configure do |config|
8
+ config.treat_symbols_as_metadata_keys_with_true_values = true
9
+ config.run_all_when_everything_filtered = true
10
+ config.filter_run :focus
11
+
12
+ config.order = 'random'
13
+ end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noindex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Michael Khabarov
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-18 00:00:00.000000000 Z
11
+ date: 2013-10-27 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,65 +27,71 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: redcarpet
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: yard
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec-rails
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
76
81
  - !ruby/object:Gem::Version
77
82
  version: '0'
78
83
  - !ruby/object:Gem::Dependency
79
84
  name: rails
80
85
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
86
  requirements:
83
- - - ! '>='
87
+ - - '>='
84
88
  - !ruby/object:Gem::Version
85
89
  version: 3.0.0
86
90
  type: :runtime
87
91
  prerelease: false
88
92
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
93
  requirements:
91
- - - ! '>='
94
+ - - '>='
92
95
  - !ruby/object:Gem::Version
93
96
  version: 3.0.0
94
97
  description: Hide some pages from search engines in Ruby on Rails applications
@@ -110,37 +113,154 @@ files:
110
113
  - lib/noindex/version.rb
111
114
  - lib/noindex/view_helpers.rb
112
115
  - noindex.gemspec
116
+ - spec/controllers/default_controller_spec.rb
117
+ - spec/controllers/noindex_controller_spec.rb
118
+ - spec/controllers/skip_noindex_controller_spec.rb
119
+ - spec/dummy/Gemfile
120
+ - spec/dummy/README.rdoc
121
+ - spec/dummy/Rakefile
122
+ - spec/dummy/app/assets/images/.keep
123
+ - spec/dummy/app/assets/javascripts/application.js
124
+ - spec/dummy/app/assets/stylesheets/application.css
125
+ - spec/dummy/app/controllers/application_controller.rb
126
+ - spec/dummy/app/controllers/concerns/.keep
127
+ - spec/dummy/app/controllers/default_controller.rb
128
+ - spec/dummy/app/controllers/noindex_controller.rb
129
+ - spec/dummy/app/controllers/skip_noindex_controller.rb
130
+ - spec/dummy/app/helpers/application_helper.rb
131
+ - spec/dummy/app/helpers/default_helper.rb
132
+ - spec/dummy/app/helpers/noindex_helper.rb
133
+ - spec/dummy/app/helpers/skip_noindex_helper.rb
134
+ - spec/dummy/app/mailers/.keep
135
+ - spec/dummy/app/models/.keep
136
+ - spec/dummy/app/models/concerns/.keep
137
+ - spec/dummy/app/views/default/edit.html.erb
138
+ - spec/dummy/app/views/default/index.html.erb
139
+ - spec/dummy/app/views/default/new.html.erb
140
+ - spec/dummy/app/views/layouts/application.html.erb
141
+ - spec/dummy/app/views/noindex/edit.html.erb
142
+ - spec/dummy/app/views/noindex/index.html.erb
143
+ - spec/dummy/app/views/noindex/new.html.erb
144
+ - spec/dummy/app/views/skip_noindex/edit.html.erb
145
+ - spec/dummy/app/views/skip_noindex/index.html.erb
146
+ - spec/dummy/app/views/skip_noindex/new.html.erb
147
+ - spec/dummy/bin/bundle
148
+ - spec/dummy/bin/rails
149
+ - spec/dummy/bin/rake
150
+ - spec/dummy/config.ru
151
+ - spec/dummy/config/application.rb
152
+ - spec/dummy/config/boot.rb
153
+ - spec/dummy/config/environment.rb
154
+ - spec/dummy/config/environments/development.rb
155
+ - spec/dummy/config/environments/production.rb
156
+ - spec/dummy/config/environments/test.rb
157
+ - spec/dummy/config/initializers/backtrace_silencers.rb
158
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
159
+ - spec/dummy/config/initializers/inflections.rb
160
+ - spec/dummy/config/initializers/mime_types.rb
161
+ - spec/dummy/config/initializers/secret_token.rb
162
+ - spec/dummy/config/initializers/session_store.rb
163
+ - spec/dummy/config/initializers/wrap_parameters.rb
164
+ - spec/dummy/config/locales/en.yml
165
+ - spec/dummy/config/routes.rb
166
+ - spec/dummy/db/seeds.rb
167
+ - spec/dummy/lib/assets/.keep
168
+ - spec/dummy/lib/tasks/.keep
169
+ - spec/dummy/public/404.html
170
+ - spec/dummy/public/422.html
171
+ - spec/dummy/public/500.html
172
+ - spec/dummy/public/favicon.ico
173
+ - spec/dummy/public/robots.txt
174
+ - spec/dummy/vendor/assets/javascripts/.keep
175
+ - spec/dummy/vendor/assets/stylesheets/.keep
176
+ - spec/requests/noindex_metatag_spec.rb
177
+ - spec/spec_helper.rb
113
178
  homepage: https://github.com/michaelkhabarov/noindex
114
179
  licenses:
115
180
  - MIT
181
+ metadata: {}
116
182
  post_install_message:
117
183
  rdoc_options: []
118
184
  require_paths:
119
185
  - lib
120
186
  required_ruby_version: !ruby/object:Gem::Requirement
121
- none: false
122
187
  requirements:
123
- - - ! '>='
188
+ - - '>='
124
189
  - !ruby/object:Gem::Version
125
190
  version: '0'
126
- segments:
127
- - 0
128
- hash: -3970455516708246295
129
191
  required_rubygems_version: !ruby/object:Gem::Requirement
130
- none: false
131
192
  requirements:
132
- - - ! '>='
193
+ - - '>='
133
194
  - !ruby/object:Gem::Version
134
195
  version: '0'
135
- segments:
136
- - 0
137
- hash: -3970455516708246295
138
196
  requirements: []
139
197
  rubyforge_project:
140
- rubygems_version: 1.8.24
198
+ rubygems_version: 2.1.9
141
199
  signing_key:
142
- specification_version: 3
200
+ specification_version: 4
143
201
  summary: Noindex provides a simple way for Ruby on Rails applications to tell search
144
202
  engines what to index on your site and what to not
145
- test_files: []
203
+ test_files:
204
+ - spec/controllers/default_controller_spec.rb
205
+ - spec/controllers/noindex_controller_spec.rb
206
+ - spec/controllers/skip_noindex_controller_spec.rb
207
+ - spec/dummy/Gemfile
208
+ - spec/dummy/README.rdoc
209
+ - spec/dummy/Rakefile
210
+ - spec/dummy/app/assets/images/.keep
211
+ - spec/dummy/app/assets/javascripts/application.js
212
+ - spec/dummy/app/assets/stylesheets/application.css
213
+ - spec/dummy/app/controllers/application_controller.rb
214
+ - spec/dummy/app/controllers/concerns/.keep
215
+ - spec/dummy/app/controllers/default_controller.rb
216
+ - spec/dummy/app/controllers/noindex_controller.rb
217
+ - spec/dummy/app/controllers/skip_noindex_controller.rb
218
+ - spec/dummy/app/helpers/application_helper.rb
219
+ - spec/dummy/app/helpers/default_helper.rb
220
+ - spec/dummy/app/helpers/noindex_helper.rb
221
+ - spec/dummy/app/helpers/skip_noindex_helper.rb
222
+ - spec/dummy/app/mailers/.keep
223
+ - spec/dummy/app/models/.keep
224
+ - spec/dummy/app/models/concerns/.keep
225
+ - spec/dummy/app/views/default/edit.html.erb
226
+ - spec/dummy/app/views/default/index.html.erb
227
+ - spec/dummy/app/views/default/new.html.erb
228
+ - spec/dummy/app/views/layouts/application.html.erb
229
+ - spec/dummy/app/views/noindex/edit.html.erb
230
+ - spec/dummy/app/views/noindex/index.html.erb
231
+ - spec/dummy/app/views/noindex/new.html.erb
232
+ - spec/dummy/app/views/skip_noindex/edit.html.erb
233
+ - spec/dummy/app/views/skip_noindex/index.html.erb
234
+ - spec/dummy/app/views/skip_noindex/new.html.erb
235
+ - spec/dummy/bin/bundle
236
+ - spec/dummy/bin/rails
237
+ - spec/dummy/bin/rake
238
+ - spec/dummy/config.ru
239
+ - spec/dummy/config/application.rb
240
+ - spec/dummy/config/boot.rb
241
+ - spec/dummy/config/environment.rb
242
+ - spec/dummy/config/environments/development.rb
243
+ - spec/dummy/config/environments/production.rb
244
+ - spec/dummy/config/environments/test.rb
245
+ - spec/dummy/config/initializers/backtrace_silencers.rb
246
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
247
+ - spec/dummy/config/initializers/inflections.rb
248
+ - spec/dummy/config/initializers/mime_types.rb
249
+ - spec/dummy/config/initializers/secret_token.rb
250
+ - spec/dummy/config/initializers/session_store.rb
251
+ - spec/dummy/config/initializers/wrap_parameters.rb
252
+ - spec/dummy/config/locales/en.yml
253
+ - spec/dummy/config/routes.rb
254
+ - spec/dummy/db/seeds.rb
255
+ - spec/dummy/lib/assets/.keep
256
+ - spec/dummy/lib/tasks/.keep
257
+ - spec/dummy/public/404.html
258
+ - spec/dummy/public/422.html
259
+ - spec/dummy/public/500.html
260
+ - spec/dummy/public/favicon.ico
261
+ - spec/dummy/public/robots.txt
262
+ - spec/dummy/vendor/assets/javascripts/.keep
263
+ - spec/dummy/vendor/assets/stylesheets/.keep
264
+ - spec/requests/noindex_metatag_spec.rb
265
+ - spec/spec_helper.rb
146
266
  has_rdoc: