envrobots 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 83ceb3e5c909c3651428bfce8d47a48e27844a29
4
+ data.tar.gz: 5e748cf3a6ddee740d8a9e8884488628b5d4293a
5
+ SHA512:
6
+ metadata.gz: 9e175683b19108f99b93fa02b3f258bfeb8ff58f53b2d4161813467c8b66686341fef7f43a155970d540e863f6ebc269ef23e7a4170ee35b45456e3b6dd90b74
7
+ data.tar.gz: 04805619311d3bbbf382510755698ae1a1b65539599276e366e622fe12908150fd209519fb021c12d3fcc876f220d55c1280be79e810e8f39f1d267fadee3d16
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2013 YOURNAME
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.
data/Rakefile ADDED
@@ -0,0 +1,32 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Envrobots'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+ Bundler::GemHelper.install_tasks
21
+
22
+ require 'rake/testtask'
23
+
24
+ Rake::TestTask.new(:test) do |t|
25
+ t.libs << 'lib'
26
+ t.libs << 'test'
27
+ t.pattern = 'test/**/*_test.rb'
28
+ t.verbose = false
29
+ end
30
+
31
+
32
+ task default: :test
@@ -0,0 +1,9 @@
1
+ class Envrobots::RobotsController < ApplicationController
2
+ def index
3
+ if Rails.env.production?
4
+ render file: 'config/robots/robots.production.txt', content_type: 'text/plain'
5
+ else
6
+ render file: 'config/robots/robots.other.txt', content_type: 'text/plain'
7
+ end
8
+ end
9
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ get 'robots.txt', to: 'envrobots/robots#index'
3
+ end
@@ -0,0 +1,5 @@
1
+ module Envrobots
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace Envrobots
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module Envrobots
2
+ VERSION = "0.1.0"
3
+ end
data/lib/envrobots.rb ADDED
@@ -0,0 +1,4 @@
1
+ require 'envrobots/engine'
2
+
3
+ module Envrobots
4
+ end
@@ -0,0 +1,18 @@
1
+ module Envrobots
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ source_root File.expand_path('../../templates', __FILE__)
5
+
6
+ def copy_robots
7
+ path = Rails.root.join('public', 'robots.txt')
8
+ if File.file? path
9
+ copy_file path, 'config/robots/robots.production.txt'
10
+ remove_file path
11
+ else
12
+ copy_file 'robots.production.txt', 'config/robots/robots.production.txt'
13
+ end
14
+ copy_file 'robots.other.txt', 'config/robots/robots.other.txt'
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ User-agent: *
5
+ Disallow: /
@@ -0,0 +1,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: /
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: envrobots
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Martinez
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-10-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 4.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 4.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec-rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Flexible robots.txt solution for Rails to use different robots.txt files
42
+ depending on the environment.
43
+ email:
44
+ - jamescmartinez@gmail.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - app/controllers/envrobots/robots_controller.rb
50
+ - config/routes.rb
51
+ - lib/envrobots/engine.rb
52
+ - lib/envrobots/version.rb
53
+ - lib/envrobots.rb
54
+ - lib/generators/envrobots/install_generator.rb
55
+ - lib/generators/templates/robots.other.txt
56
+ - lib/generators/templates/robots.production.txt
57
+ - MIT-LICENSE
58
+ - Rakefile
59
+ homepage: http://github.com/jamescmartinez/envrobots
60
+ licenses: []
61
+ metadata: {}
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.0.3
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Flexible robots.txt solution for Rails.
82
+ test_files: []