metatag_cop 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/README.md +12 -9
- data/lib/metatag_cop/parser.rb +6 -2
- data/lib/metatag_cop/version.rb +1 -1
- data/sample/sample.csv +3 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35678b5fe8efcdcaaeadb0a8674499dca32641f7
|
4
|
+
data.tar.gz: 947de54b6c3bff07bd88e8c27e8df89c11ad9be3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4734bbcd13f42db37f47544d31264f5a733debcd680a646ce8b2c400858e14243428f755a89c539133b993eb4ffea5a1a215fe357466c7053bb51cc14dc03e52
|
7
|
+
data.tar.gz: 025fc2becf5d887e5b0a4397ec3df5cb3d7c106721db7c34bd6304e3b2e85d235c4a06d8c60d767bdf672d2ff80cc7fd42f5bb89919088e913e80c0249464305
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# MetatagCop
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
MetatagCop loads csv file and checks whether meta tags is set proper value.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,18 +20,23 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
1. Prepare csv file like this.
|
26
24
|
|
27
|
-
|
25
|
+
```
|
26
|
+
url, title, description, h1
|
27
|
+
https://www.google.co.jp/, exepected title here, exepected description here, exepected h1 here
|
28
|
+
https://www.google.com/doodles, exepected title here, exepected description here, exepected h1 here
|
29
|
+
```
|
28
30
|
|
29
|
-
|
31
|
+
2. Run ` $ metatag_cop file_path `
|
30
32
|
|
31
|
-
|
33
|
+
## Development
|
32
34
|
|
33
|
-
|
35
|
+
- TODO
|
34
36
|
|
35
|
-
|
37
|
+
## Contributing
|
36
38
|
|
39
|
+
- TODO
|
37
40
|
|
38
41
|
## License
|
39
42
|
|
data/lib/metatag_cop/parser.rb
CHANGED
@@ -18,15 +18,19 @@ module MetatagCop
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def description
|
21
|
-
document.at('meta[name=description]')
|
21
|
+
description = document.at('meta[name=description]')
|
22
|
+
description['content'] unless description.nil?
|
22
23
|
end
|
23
24
|
|
24
25
|
def keywords
|
25
|
-
document.at('meta[name=keywords]')
|
26
|
+
keywords = document.at('meta[name=keywords]')
|
27
|
+
keywords['content'] unless keywords.nil?
|
26
28
|
end
|
27
29
|
|
28
30
|
def h1
|
29
31
|
h1 = document.at('h1')
|
32
|
+
|
33
|
+
return if h1.nil?
|
30
34
|
return h1['content'] unless h1['content'].nil?
|
31
35
|
|
32
36
|
# it regards alt as h1 content if h1 content is blank.
|
data/lib/metatag_cop/version.rb
CHANGED
data/sample/sample.csv
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metatag_cop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tackeyy
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- lib/metatag_cop/parser.rb
|
98
98
|
- lib/metatag_cop/version.rb
|
99
99
|
- metatag_cop.gemspec
|
100
|
+
- sample/sample.csv
|
100
101
|
homepage: http://tackeyy.com/
|
101
102
|
licenses:
|
102
103
|
- MIT
|