meta_tags-rails 1.1.0 → 1.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/.travis.yml +4 -4
- data/README.md +0 -13
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/meta_tags-rails/renderer.rb +2 -0
- data/lib/meta_tags-rails/version.rb +1 -1
- data/spec/spec_helper.rb +0 -5
- data/spec/view_helper/article_spec.rb +34 -0
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d79752b421de3cbd0287dacf55bb01888cabe78c
|
4
|
+
data.tar.gz: ac2ded5d6926d8c77c1d75c2c74eddae9cd5d712
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e14b962b4d8da9413701e3af0536b51e85983255af70f81512b8373dcc6bd08f71f06a7f0f182564ff7878e49d778b5962de3d652535fc3957597d8c0796169
|
7
|
+
data.tar.gz: 61bf02aa314c06f0bfd080d4def8efe9dd5b0ee4e219156605e6983f9211a2a2e6667db91363f923bd7fffcce164470dbce3595a2021964acb985ba9cd899ca1
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -161,19 +161,6 @@ Further reading:
|
|
161
161
|
* [Favicon](https://www.wikiwand.com/en/Favicon)
|
162
162
|
* [Touch Icons](https://mathiasbynens.be/notes/touch-icons)
|
163
163
|
|
164
|
-
### Author links
|
165
|
-
|
166
|
-
Link to your Google+ profile using rel="author"
|
167
|
-
|
168
|
-
```ruby
|
169
|
-
set_meta_tags author: "http://yourgplusprofile.com/profile/url"
|
170
|
-
# => <link rel="author" href="http://yourgplusprofile.com/profile/url" />
|
171
|
-
```
|
172
|
-
|
173
|
-
Further reading:
|
174
|
-
|
175
|
-
* [About rel="author"](https://support.google.com/webmasters/answer/2539557?hl=en)
|
176
|
-
|
177
164
|
### Publisher links
|
178
165
|
|
179
166
|
Link to your Google+ profile using rel="publisher"
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "meta_tags-rails"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -32,6 +32,8 @@ module MetaTags
|
|
32
32
|
render_hash(tags, :og, name_key: :property)
|
33
33
|
render_hash(tags, :fb, name_key: :property)
|
34
34
|
render_hash(tags, :al, name_key: :property)
|
35
|
+
render_hash(tags, :article, name_key: :property)
|
36
|
+
|
35
37
|
render_hashes(tags)
|
36
38
|
render_custom(tags)
|
37
39
|
|
data/spec/spec_helper.rb
CHANGED
@@ -8,11 +8,6 @@ require 'rspec-html-matchers'
|
|
8
8
|
|
9
9
|
RSpec.configure do |config|
|
10
10
|
if config.files_to_run.one?
|
11
|
-
# RSpec filters the backtrace by default so as not to be so noisy.
|
12
|
-
# This causes the full backtrace to be printed when running a single
|
13
|
-
# spec file (e.g. to troubleshoot a particular spec failure).
|
14
|
-
config.full_backtrace = true
|
15
|
-
|
16
11
|
# Use the documentation formatter for detailed output,
|
17
12
|
# unless a formatter has already been configured
|
18
13
|
# (e.g. via a command-line flag).
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe MetaTags::ViewHelper, "displaying Article meta tags" do
|
4
|
+
subject { ActionView::Base.new }
|
5
|
+
|
6
|
+
it "should display meta tags specified with :article" do
|
7
|
+
subject.set_meta_tags(article: {
|
8
|
+
author: "https://www.facebook.com/facebook"
|
9
|
+
})
|
10
|
+
subject.display_meta_tags(site: "someSite").tap do |meta|
|
11
|
+
expect(meta).to have_tag("meta", with: { content: "https://www.facebook.com/facebook", property: "article:author" })
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should use deep merge when displaying open graph meta tags" do
|
16
|
+
subject.set_meta_tags(article: { author: "https://www.facebook.com/facebook" })
|
17
|
+
subject.display_meta_tags(article: { publisher: "https://www.facebook.com/Google/" }).tap do |meta|
|
18
|
+
expect(meta).to have_tag("meta", with: { content: "https://www.facebook.com/facebook", property: "article:author" })
|
19
|
+
expect(meta).to have_tag("meta", with: { content: "https://www.facebook.com/Google/", property: "article:publisher" })
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should not display meta tags without content" do
|
24
|
+
subject.set_meta_tags(article: {
|
25
|
+
author: "",
|
26
|
+
publisher: ""
|
27
|
+
})
|
28
|
+
subject.display_meta_tags(site: "someSite").tap do |meta|
|
29
|
+
expect(meta).to_not have_tag("meta", with: { content: "", property: "article:author" })
|
30
|
+
expect(meta).to_not have_tag("meta", with: { content: "", property: "article:publisher" })
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta_tags-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmytro Shteflyuk
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-08-
|
12
|
+
date: 2016-08-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -98,7 +98,9 @@ dependencies:
|
|
98
98
|
description: Search Engine Optimization (SEO) plugin for Ruby on Rails applications.
|
99
99
|
email:
|
100
100
|
- Elektron1c97@gmail.com
|
101
|
-
executables:
|
101
|
+
executables:
|
102
|
+
- console
|
103
|
+
- setup
|
102
104
|
extensions: []
|
103
105
|
extra_rdoc_files:
|
104
106
|
- README.md
|
@@ -114,6 +116,8 @@ files:
|
|
114
116
|
- MIT-LICENSE
|
115
117
|
- README.md
|
116
118
|
- Rakefile
|
119
|
+
- bin/console
|
120
|
+
- bin/setup
|
117
121
|
- lib/meta_tags-rails.rb
|
118
122
|
- lib/meta_tags-rails/configuration.rb
|
119
123
|
- lib/meta_tags-rails/content_tag.rb
|
@@ -130,6 +134,7 @@ files:
|
|
130
134
|
- spec/spec_helper.rb
|
131
135
|
- spec/text_normalizer/normalize_title_spec.rb
|
132
136
|
- spec/text_normalizer/truncate_array_spec.rb
|
137
|
+
- spec/view_helper/article_spec.rb
|
133
138
|
- spec/view_helper/charset_spec.rb
|
134
139
|
- spec/view_helper/custom_spec.rb
|
135
140
|
- spec/view_helper/description_spec.rb
|