noindex 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.yardopts +8 -0
- data/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +39 -2
- data/lib/noindex/version.rb +1 -1
- data/noindex.gemspec +4 -2
- metadata +45 -5
data/.yardopts
ADDED
data/{LICENSE.txt → LICENSE}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Noindex
|
2
2
|
|
3
|
-
|
3
|
+
Noindex provides a simple way for Ruby on Rails applications to tell search engines what to index on your site and what to not.
|
4
|
+
It inserts `<meta name="robots" content="noindex">` at necessary pages.
|
4
5
|
|
5
6
|
## Installation
|
6
7
|
|
@@ -18,7 +19,43 @@ Or install it yourself as:
|
|
18
19
|
|
19
20
|
## Usage
|
20
21
|
|
21
|
-
|
22
|
+
### In your layout
|
23
|
+
|
24
|
+
Add `noindex_meta_tag` helper to the `head` element of your layout. HAML example:
|
25
|
+
|
26
|
+
```haml
|
27
|
+
html
|
28
|
+
head
|
29
|
+
= noindex_meta_tag
|
30
|
+
```
|
31
|
+
|
32
|
+
It will generate following *meta_tag* element (for *new* and *edit* actions by default):
|
33
|
+
|
34
|
+
```html
|
35
|
+
<meta content="noindex" name="robots" />
|
36
|
+
```
|
37
|
+
|
38
|
+
### In your controllers
|
39
|
+
|
40
|
+
*Noindex* simply adds a method `noindex` to controllers. This method is just a *before_filter* so it receives same options as a Rails *before_filter* method.
|
41
|
+
|
42
|
+
By default *Noindex* filters *new* and *edit* actions. You can customise this by calling `noindex` in any controller. For example to hide only *index* and *edit* actions in *UsersController* from search engines your can do:
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
class UsersController < InheritedResources::Base
|
46
|
+
noindex only: [ :index, :edit ]
|
47
|
+
...
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
51
|
+
If you want some actions to be searchable you can call `skip_noindex` method (that is just a *skip_before_filter* alias).
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
class UsersController < InheritedResources::Base
|
55
|
+
skip_noindex only: [ :new ]
|
56
|
+
...
|
57
|
+
end
|
58
|
+
```
|
22
59
|
|
23
60
|
## Contributing
|
24
61
|
|
data/lib/noindex/version.rb
CHANGED
data/noindex.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Noindex::VERSION
|
9
9
|
spec.authors = ["Michael Khabarov"]
|
10
10
|
spec.email = ["michaelkhabarov@alphastate.ru"]
|
11
|
-
spec.description = %q{Hide some pages from search engines
|
12
|
-
spec.summary = %q{Noindex provides a simple way for Ruby on Rails applications to tell search engines what to index on your site and what to not
|
11
|
+
spec.description = %q{Hide some pages from search engines in Ruby on Rails applications}
|
12
|
+
spec.summary = %q{Noindex provides a simple way for Ruby on Rails applications to tell search engines what to index on your site and what to not}
|
13
13
|
spec.homepage = "https://github.com/michaelkhabarov/noindex"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -20,6 +20,8 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.3"
|
22
22
|
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "redcarpet"
|
24
|
+
spec.add_development_dependency "yard"
|
23
25
|
|
24
26
|
spec.add_dependency "rails", ">= 3.0.0"
|
25
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noindex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -43,6 +43,38 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: redcarpet
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: yard
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
46
78
|
- !ruby/object:Gem::Dependency
|
47
79
|
name: rails
|
48
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,7 +91,7 @@ dependencies:
|
|
59
91
|
- - ! '>='
|
60
92
|
- !ruby/object:Gem::Version
|
61
93
|
version: 3.0.0
|
62
|
-
description: Hide some pages from search engines
|
94
|
+
description: Hide some pages from search engines in Ruby on Rails applications
|
63
95
|
email:
|
64
96
|
- michaelkhabarov@alphastate.ru
|
65
97
|
executables: []
|
@@ -67,8 +99,9 @@ extensions: []
|
|
67
99
|
extra_rdoc_files: []
|
68
100
|
files:
|
69
101
|
- .gitignore
|
102
|
+
- .yardopts
|
70
103
|
- Gemfile
|
71
|
-
- LICENSE
|
104
|
+
- LICENSE
|
72
105
|
- README.md
|
73
106
|
- Rakefile
|
74
107
|
- lib/noindex.rb
|
@@ -90,17 +123,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
123
|
- - ! '>='
|
91
124
|
- !ruby/object:Gem::Version
|
92
125
|
version: '0'
|
126
|
+
segments:
|
127
|
+
- 0
|
128
|
+
hash: -3970455516708246295
|
93
129
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
130
|
none: false
|
95
131
|
requirements:
|
96
132
|
- - ! '>='
|
97
133
|
- !ruby/object:Gem::Version
|
98
134
|
version: '0'
|
135
|
+
segments:
|
136
|
+
- 0
|
137
|
+
hash: -3970455516708246295
|
99
138
|
requirements: []
|
100
139
|
rubyforge_project:
|
101
140
|
rubygems_version: 1.8.24
|
102
141
|
signing_key:
|
103
142
|
specification_version: 3
|
104
143
|
summary: Noindex provides a simple way for Ruby on Rails applications to tell search
|
105
|
-
engines what to index on your site and what to not
|
144
|
+
engines what to index on your site and what to not
|
106
145
|
test_files: []
|
146
|
+
has_rdoc:
|