meta-tags 2.17.0 → 2.19.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5d6a918c74ab34bf285b01fd38c0c490745e0ee51f958d8bf2bf405dd26b287
4
- data.tar.gz: eee0a81f5b209b140ff27ec0cad12852c672ab1f035d930a1ab1ae5b82b8bfa8
3
+ metadata.gz: 8492bea82b4f8198d1586fbf8455ad77fb86942deb24a176bc2905d680410e73
4
+ data.tar.gz: 2bc51a95760a70183e21edfe6f7b5dc7f443b0eb1d5e4449a2da398f48074f71
5
5
  SHA512:
6
- metadata.gz: cc19a58a8e0c30867e1019a1e78bc502b6e6efff3edfa1494699ad8701a51bd0f80a345a51b86dbf7ab1924f7f7e211cf9965234f51ae005ae4376af4ab6e1d5
7
- data.tar.gz: edd7b528239c11d3f8fe1275270bd46b9584696b73415bd86fe4cda5549f9a05cd0c02c44c69ecd955e4964cfaa413fc14956c7c67ca478d491b7a4078128b53
6
+ metadata.gz: 781610100e7ec63c46e2f377cda42bbbec151009ddb45f17f353d6b4f6271b2645e4883b51ea476fbd5180f6fec14764d5ba7c69130f58cdf59ac90ad452add2
7
+ data.tar.gz: ad30e462d9fc9b8fea8dd8244c13447e6a9221201485491960754b213bff085cf24522bb93d909ae1a16c9cf37b4770ce1c54f2427480875a06dde749c028eb0
checksums.yaml.gz.sig CHANGED
Binary file
data/Appraisals ADDED
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ appraise "rails-5.1" do
4
+ gem "railties", "5.1.7"
5
+ end
6
+
7
+ appraise "rails-5.2" do
8
+ gem "railties", "5.2.8.1"
9
+ end
10
+
11
+ appraise "rails-6.0" do
12
+ gem "railties", "6.0.6"
13
+ end
14
+
15
+ appraise "rails-6.1" do
16
+ gem "railties", "6.1.7"
17
+ end
18
+
19
+ appraise "rails-7.0" do
20
+ gem "railties", "7.0.4"
21
+ end
22
+
23
+ appraise "rails-7.1" do
24
+ gem "railties", "7.1.0"
25
+ end
data/CHANGELOG.md CHANGED
@@ -1,10 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.19.0 (October 5, 2023) [☰](https://github.com/kpumuk/meta-tags/compare/v2.18.0...v2.19.0)
4
+
5
+ Changes:
6
+
7
+ - Switched code style from custom rules to Standard ([246](https://github.com/kpumuk/meta-tags/pull/251)).
8
+ - Switched from testing Rails using environment variables to Appraisal gem ([251](https://github.com/kpumuk/meta-tags/pull/247)).
9
+ - Ruby 2.7 is minimum supported version ([257](https://github.com/kpumuk/meta-tags/pull/257/))
10
+ - Added support for Rails 7.1 ([267](https://github.com/kpumuk/meta-tags/pull/267))
11
+
12
+ ## 2.18.0 (September 15, 2022) [☰](https://github.com/kpumuk/meta-tags/compare/v2.17.0...v2.18.0)
13
+
14
+ Changes:
15
+
16
+ - Fallback to site name when title is empty in mirrored tags ([243](https://github.com/kpumuk/meta-tags/pull/243))
17
+
3
18
  ## 2.17.0 (July 5, 2022) [☰](https://github.com/kpumuk/meta-tags/compare/v2.16.0...v2.17.0)
4
19
 
5
20
  Changes:
6
21
 
7
- - Separate RBS files to _internal directory to avoid exposing RBS ([237](https://github.com/kpumuk/meta-tags/pull/237))
22
+ - Separate RBS files to \_internal directory to avoid exposing RBS ([237](https://github.com/kpumuk/meta-tags/pull/237))
8
23
  - Added Ruby 3.1 to supported versions, Ruby 2.6 is minimum supported version ([235](https://github.com/kpumuk/meta-tags/pull/235/))
9
24
 
10
25
  ## 2.16.0 (September 24, 2021) [☰](https://github.com/kpumuk/meta-tags/compare/v2.15.0...v2.16.0)
data/Gemfile CHANGED
@@ -1,30 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
- # Specify your gem's dependencies in meta-tags.gemspec
5
+ # Specify gem's dependencies in meta-tags.gemspec
6
6
  gemspec
7
7
 
8
- if ENV['RAILS_VERSION']
9
- # Install specified version of actionpack if requested
10
- gem 'railties', "~> #{ENV['RAILS_VERSION']}"
11
- end
12
-
13
- unless ENV["NO_STEEP"] == '1'
8
+ unless ENV["NO_STEEP"] == "1"
14
9
  # Ruby typings
15
- gem 'steep', '~> 1.0.1', platform: :mri
16
- end
17
-
18
- group :test do
19
- # Lock rubocop to a specific version we use on CI. If you update this,
20
- # don't forget to switch rubocop channel in the .codeclimate.yml
21
- gem 'rubocop', '= 1.31.0'
22
- # Cops for rails apps
23
- gem 'rubocop-rails'
24
- # Apply RSpec rubocop cops
25
- gem 'rubocop-rspec', require: false
26
- # We use this gem on CI to calculate code coverage.
27
- gem 'simplecov', '>= 0.17.0', '< 0.18'
28
- # Format RSpec output for CircleCI
29
- gem 'rspec_junit_formatter'
10
+ gem "steep", "~> 1.5.2", platform: :mri
30
11
  end
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![CircleCI](https://circleci.com/gh/kpumuk/meta-tags.svg?style=shield)](https://circleci.com/gh/kpumuk/meta-tags)
4
4
  [![Gem Version](https://badge.fury.io/rb/meta-tags.svg)](https://badge.fury.io/rb/meta-tags)
5
+ [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
5
6
  [![Code Climate](https://codeclimate.com/github/kpumuk/meta-tags/badges/gpa.svg)](https://codeclimate.com/github/kpumuk/meta-tags)
6
7
  [![Test Coverage](https://codeclimate.com/github/kpumuk/meta-tags/badges/coverage.svg)](https://codeclimate.com/github/kpumuk/meta-tags/coverage)
7
8
  [![Gem Downloads](https://img.shields.io/gem/dt/meta-tags.svg)](https://badge.fury.io/rb/meta-tags)
@@ -12,9 +13,9 @@ Search Engine Optimization (SEO) plugin for Ruby on Rails applications.
12
13
  ## Ruby on Rails
13
14
 
14
15
  MetaTags main branch fully supports Ruby on Rails 5.1+, and is tested against all
15
- major Rails releases up to 7.0.
16
+ major Rails releases up to 7.1.
16
17
 
17
- Ruby versions older than 2.6 are no longer officially supported.
18
+ Ruby versions older than 2.7 are no longer officially supported.
18
19
 
19
20
  _Please note_ that we no longer support Ruby versions older than 2.6.0 and
20
21
  Ruby on Rails older than 5.1, because they reached their [End of Life](https://endoflife.date/ruby).
@@ -24,7 +25,7 @@ Ruby on Rails older than 5.1, because they reached their [End of Life](https://e
24
25
  Add the "meta-tags" gem to your `Gemfile`.
25
26
 
26
27
  ```ruby
27
- gem 'meta-tags'
28
+ gem "meta-tags"
28
29
  ```
29
30
 
30
31
  And run `bundle install` command.
@@ -55,14 +56,14 @@ First, add this code to your main layout:
55
56
 
56
57
  ```erb
57
58
  <head>
58
- <%= display_meta_tags site: 'My website' %>
59
+ <%= display_meta_tags site: "My website" %>
59
60
  </head>
60
61
  ```
61
62
 
62
63
  Then, to set the page title, add this to each of your views (see below for other options):
63
64
 
64
65
  ```erb
65
- <h1><%= title 'My page title' %></h1>
66
+ <h1><%= title "My page title" %></h1>
66
67
  ```
67
68
 
68
69
  When views are rendered, the page title will be included in the right spots:
@@ -83,17 +84,19 @@ You can find allowed options for `display_meta_tags` method below.
83
84
  You can define following instance variables:
84
85
 
85
86
  ```ruby
86
- @page_title = 'Member Login'
87
- @page_description = 'Member login page.'
88
- @page_keywords = 'Site, Login, Members'
87
+ @page_title = "Member Login"
88
+ @page_description = "Member login page."
89
+ @page_keywords = "Site, Login, Members"
89
90
  ```
90
91
 
91
92
  Also you could use `set_meta_tags` method to define all meta tags simultaneously:
92
93
 
93
94
  ```ruby
94
- set_meta_tags title: 'Member Login',
95
- description: 'Member login page.',
96
- keywords: 'Site, Login, Members'
95
+ set_meta_tags(
96
+ title: "Member Login",
97
+ description: "Member login page.",
98
+ keywords: "Site, Login, Members"
99
+ )
97
100
  ```
98
101
 
99
102
  You can find allowed options for `set_meta_tags` method below.
@@ -103,9 +106,9 @@ You can find allowed options for `set_meta_tags` method below.
103
106
  To set meta tags you can use following methods:
104
107
 
105
108
  ```erb
106
- <% title 'Member Login' %>
107
- <% description 'Member login page.' %>
108
- <% keywords 'Site, Login, Members' %>
109
+ <% title "Member Login" %>
110
+ <% description "Member login page." %>
111
+ <% keywords "Site, Login, Members" %>
109
112
  <% nofollow %>
110
113
  <% noindex %>
111
114
  <% refresh 3 %>
@@ -114,9 +117,13 @@ To set meta tags you can use following methods:
114
117
  Also there is `set_meta_tags` method exists:
115
118
 
116
119
  ```erb
117
- <% set_meta_tags title: 'Member Login',
118
- description: 'Member login page.',
119
- keywords: 'Site, Login, Members' %>
120
+ <%
121
+ set_meta_tags(
122
+ title: "Member Login",
123
+ description: "Member login page.",
124
+ keywords: "Site, Login, Members"
125
+ )
126
+ %>
120
127
  ```
121
128
 
122
129
  You can pass an object that implements `#to_meta_tags` method and returns a Hash:
@@ -126,7 +133,7 @@ class Document < ApplicationRecord
126
133
  def to_meta_tags
127
134
  {
128
135
  title: title,
129
- description: summary,
136
+ description: summary
130
137
  }
131
138
  end
132
139
  end
@@ -139,13 +146,13 @@ The `title` method returns title itself, so you can use it to show the title
139
146
  somewhere on the page:
140
147
 
141
148
  ```erb
142
- <h1><%= title 'Member Login' %></h1>
149
+ <h1><%= title "Member Login" %></h1>
143
150
  ```
144
151
 
145
152
  If you want to set the title and display another text, use this:
146
153
 
147
154
  ```erb
148
- <h1><%= title 'Member Login', 'Here you can login to the site:' %></h1>
155
+ <h1><%= title "Member Login", "Here you can login to the site:" %></h1>
149
156
  ```
150
157
 
151
158
  ### Allowed options for `display_meta_tags` and `set_meta_tags` methods
@@ -164,11 +171,11 @@ Use these options to customize the title format:
164
171
  | `:suffix` | text between separator and page title |
165
172
  | `:lowercase` | when true, the page name will be lowercase |
166
173
  | `:reverse` | when true, the page and site names will be reversed |
167
- | `:noindex` | add noindex meta tag; when true, 'robots' will be used; accepts a string with a robot name, or an array of strings |
168
- | `:index` | add index meta tag; when true, 'robots' will be used; accepts a string with a robot name, or an array of strings |
169
- | `:nofollow` | add nofollow meta tag; when true, 'robots' will be used; accepts a string with a robot name, or an array of strings |
170
- | `:follow` | add follow meta tag; when true, 'robots' will be used; accepts a string with a robot name, or an array of strings |
171
- | `:noarchive` | add noarchive meta tag; when true, 'robots' will be used; accepts a string with a robot name, or an array of strings |
174
+ | `:noindex` | add noindex meta tag; when true, "robots" will be used; accepts a string with a robot name, or an array of strings |
175
+ | `:index` | add index meta tag; when true, "robots" will be used; accepts a string with a robot name, or an array of strings |
176
+ | `:nofollow` | add nofollow meta tag; when true, "robots" will be used; accepts a string with a robot name, or an array of strings |
177
+ | `:follow` | add follow meta tag; when true, "robots" will be used; accepts a string with a robot name, or an array of strings |
178
+ | `:noarchive` | add noarchive meta tag; when true, "robots" will be used; accepts a string with a robot name, or an array of strings |
172
179
  | `:canonical` | add canonical link tag |
173
180
  | `:prev` | add prev link tag |
174
181
  | `:next` | add next link tag |
@@ -184,8 +191,8 @@ And here are a few examples to give you ideas.
184
191
  <%= display_meta_tags prefix: false, separator: ":" %>
185
192
  <%= display_meta_tags lowercase: true %>
186
193
  <%= display_meta_tags reverse: true, prefix: false %>
187
- <%= display_meta_tags og: { title: 'The Rock', type: 'video.movie' } %>
188
- <%= display_meta_tags alternate: { 'zh-Hant' => 'http://example.com.tw/base/url' } %>
194
+ <%= display_meta_tags og: { title: "The Rock", type: "video.movie" } %>
195
+ <%= display_meta_tags alternate: { "zh-Hant" => "http://example.com.tw/base/url" } %>
189
196
  ```
190
197
 
191
198
  ### Allowed values
@@ -193,16 +200,16 @@ And here are a few examples to give you ideas.
193
200
  You can specify `:title` as a string or array:
194
201
 
195
202
  ```ruby
196
- set_meta_tags title: ['part1', 'part2'], site: 'site'
203
+ set_meta_tags title: ["part1", "part2"], site: "site"
197
204
  # site | part1 | part2
198
- set_meta_tags title: ['part1', 'part2'], reverse: true, site: 'site'
205
+ set_meta_tags title: ["part1", "part2"], reverse: true, site: "site"
199
206
  # part2 | part1 | site
200
207
  ```
201
208
 
202
209
  Keywords can be passed as string of comma-separated values, or as an array:
203
210
 
204
211
  ```ruby
205
- set_meta_tags keywords: ['tag1', 'tag2']
212
+ set_meta_tags keywords: ["tag1", "tag2"]
206
213
  # tag1, tag2
207
214
  ```
208
215
 
@@ -219,7 +226,7 @@ Say, you have the following in your application layout:
219
226
  ```ruby
220
227
  display_meta_tags og: {
221
228
  title: :title,
222
- site_name: :site,
229
+ site_name: :site
223
230
  }
224
231
  ```
225
232
 
@@ -227,7 +234,7 @@ The value of `og[:title]` is a symbol and therefore references the value of the
227
234
  top level `title` meta tag. With the following in any view:
228
235
 
229
236
  ```ruby
230
- title 'my great view'
237
+ title "my great view"
231
238
  ```
232
239
 
233
240
  You get this open graph meta tag for free:
@@ -261,10 +268,10 @@ code duplication, you can define a helper in `application_helper.rb`:
261
268
  ```ruby
262
269
  def default_meta_tags
263
270
  {
264
- title: 'Member Login',
265
- description: 'Member login page.',
266
- keywords: 'Site, Login, Members',
267
- separator: "&mdash;".html_safe,
271
+ title: "Member Login",
272
+ description: "Member login page.",
273
+ keywords: "Site, Login, Members",
274
+ separator: "&mdash;".html_safe
268
275
  }
269
276
  end
270
277
  ```
@@ -295,11 +302,11 @@ browser are displayed in the title bar. The search engines look at
295
302
  the title bar to determine what the page is all about.
296
303
 
297
304
  ```ruby
298
- set_meta_tags title: 'Member Login'
305
+ set_meta_tags title: "Member Login"
299
306
  # <title>Member Login</title>
300
- set_meta_tags site: 'Site Title', title: 'Member Login'
307
+ set_meta_tags site: "Site Title", title: "Member Login"
301
308
  # <title>Site Title | Member Login</title>
302
- set_meta_tags site: 'Site Title', title: 'Member Login', reverse: true
309
+ set_meta_tags site: "Site Title", title: "Member Login", reverse: true
303
310
  # <title>Member Login | Site Title</title>
304
311
  ```
305
312
 
@@ -352,7 +359,7 @@ include specific pages in their indexes.
352
359
  ```ruby
353
360
  set_meta_tags noindex: true
354
361
  # <meta name="robots" content="noindex">
355
- set_meta_tags noindex: 'googlebot'
362
+ set_meta_tags noindex: "googlebot"
356
363
  # <meta name="googlebot" content="noindex">
357
364
  ```
358
365
 
@@ -365,7 +372,7 @@ Further reading:
365
372
 
366
373
  ### Index
367
374
 
368
- Although it is not required to add 'index' to 'robots' as it is default value for Google, some SEO specialists recommend to add it to website
375
+ Although it is not required to add "index" to "robots" as it is default value for Google, some SEO specialists recommend to add it to website
369
376
 
370
377
  ```ruby
371
378
  set_meta_tags index: true
@@ -382,7 +389,7 @@ still arrives at your undesired page.
382
389
  ```ruby
383
390
  set_meta_tags nofollow: true
384
391
  # <meta name="robots" content="nofollow">
385
- set_meta_tags nofollow: 'googlebot'
392
+ set_meta_tags nofollow: "googlebot"
386
393
  # <meta name="googlebot" content="nofollow">
387
394
  ```
388
395
 
@@ -429,13 +436,13 @@ icon, tab icon or bookmark icon, is a file containing one or more small icons,
429
436
  most commonly 16×16 pixels, associated with a particular website or web page.
430
437
 
431
438
  ```ruby
432
- set_meta_tags icon: '/favicon.ico'
439
+ set_meta_tags icon: "/favicon.ico"
433
440
  # <link rel="icon" href="/favicon.ico" type="image/x-icon">
434
- set_meta_tags icon: '/favicon.png', type: 'image/png'
441
+ set_meta_tags icon: "/favicon.png", type: "image/png"
435
442
  # <link rel="icon" href="/favicon.png" type="image/png">
436
443
  set_meta_tags icon: [
437
- { href: '/images/icons/icon_96.png', sizes: '32x32 96x96', type: 'image/png' },
438
- { href: '/images/icons/icon_itouch_precomp_32.png', rel: 'apple-touch-icon-precomposed', sizes: '32x32', type: 'image/png' },
444
+ {href: "/images/icons/icon_96.png", sizes: "32x32 96x96", type: "image/png"},
445
+ {href: "/images/icons/icon_itouch_precomp_32.png", rel: "apple-touch-icon-precomposed", sizes: "32x32", type: "image/png"}
439
446
  ]
440
447
  # <link rel="icon" href="/images/icons/icon_96.png" type="image/png" sizes="32x32 96x96">
441
448
  # <link rel="apple-touch-icon-precomposed" href="/images/icons/icon_itouch_precomp_32.png" type="image/png" sizes="32x32">
@@ -452,11 +459,11 @@ Alternate link elements tell a search engine when there is content that's
452
459
  translated or targeted to users in a certain region.
453
460
 
454
461
  ```ruby
455
- set_meta_tags alternate: { "fr" => "http://yoursite.fr/alternate/url" }
462
+ set_meta_tags alternate: {"fr" => "http://yoursite.fr/alternate/url"}
456
463
  # <link rel="alternate" href="http://yoursite.fr/alternate/url" hreflang="fr">
457
464
 
458
- set_meta_tags alternate: { "fr" => "http://yoursite.fr/alternate/url",
459
- "de" => "http://yoursite.de/alternate/url" }
465
+ set_meta_tags alternate: {"fr" => "http://yoursite.fr/alternate/url",
466
+ "de" => "http://yoursite.de/alternate/url"}
460
467
  # <link rel="alternate" href="http://yoursite.fr/alternate/url" hreflang="fr">
461
468
  # <link rel="alternate" href="http://yoursite.de/alternate/url" hreflang="de">
462
469
  ```
@@ -465,10 +472,10 @@ If you need more than just multi-lingual links, you can use an alternative synta
465
472
 
466
473
  ```ruby
467
474
  set_meta_tags alternate: [
468
- { href: 'http://example.fr/base/url', hreflang: 'fr' },
469
- { href: 'http://example.com/feed.rss', type: 'application/rss+xml', title: 'RSS' },
470
- { href: 'http://m.example.com/page-1', media: 'only screen and (max-width: 640px)'},
471
- ]
475
+ {href: "http://example.fr/base/url", hreflang: "fr"},
476
+ {href: "http://example.com/feed.rss", type: "application/rss+xml", title: "RSS"},
477
+ {href: "http://m.example.com/page-1", media: "only screen and (max-width: 640px)"}
478
+ ]
472
479
  ```
473
480
 
474
481
  Further reading:
@@ -526,7 +533,7 @@ To link back to normal version, use `canonical`.
526
533
  ### Manifest links
527
534
 
528
535
  ```ruby
529
- set_meta_tags manifest: 'manifest.json'
536
+ set_meta_tags manifest: "manifest.json"
530
537
  # <link rel="manifest" href="manifest.json">
531
538
  ```
532
539
 
@@ -544,7 +551,7 @@ meta refresh to be used as a method of URL redirection.
544
551
  ```ruby
545
552
  set_meta_tags refresh: 5
546
553
  # <meta content="5" http-equiv="refresh">
547
- set_meta_tags refresh: '5;url=http://example.com'
554
+ set_meta_tags refresh: "5;url=http://example.com"
548
555
  # <meta content="5;url=http://example.com" http-equiv="refresh">
549
556
  ```
550
557
 
@@ -560,7 +567,7 @@ Open Search link element to describe a search engine in a standard and accessibl
560
567
  ```ruby
561
568
  set_meta_tags open_search: {
562
569
  title: "Open Search",
563
- href: "/opensearch.xml"
570
+ href: "/opensearch.xml"
564
571
  }
565
572
  # <link href="/opensearch.xml" rel="search" title="Open Search" type="application/opensearchdescription+xml">
566
573
  ```
@@ -591,7 +598,7 @@ Repeated meta tags can be built just using an Array inside a Hash. For example:
591
598
 
592
599
  ```ruby
593
600
  set_meta_tags og: {
594
- image: ["http://example.com/rock.jpg", "http://example.com/rock2.jpg"]
601
+ image: ["http://example.com/rock.jpg", "http://example.com/rock2.jpg"]
595
602
  }
596
603
  # <meta property="og:image" content="http://example.com/rock.jpg">
597
604
  # <meta property="og:image" content="http://example.com/rock2.jpg">
@@ -606,13 +613,13 @@ and in the future. Here's an example for a movie page:
606
613
 
607
614
  ```ruby
608
615
  set_meta_tags og: {
609
- title: 'The Rock',
610
- type: 'video.movie',
611
- url: 'http://www.imdb.com/title/tt0117500/',
612
- image: 'http://ia.media-imdb.com/rock.jpg',
613
- video: {
614
- director: 'http://www.imdb.com/name/nm0000881/',
615
- writer: ['http://www.imdb.com/name/nm0918711/', 'http://www.imdb.com/name/nm0177018/']
616
+ title: "The Rock",
617
+ type: "video.movie",
618
+ url: "http://www.imdb.com/title/tt0117500/",
619
+ image: "http://ia.media-imdb.com/rock.jpg",
620
+ video: {
621
+ director: "http://www.imdb.com/name/nm0000881/",
622
+ writer: ["http://www.imdb.com/name/nm0918711/", "http://www.imdb.com/name/nm0177018/"]
616
623
  }
617
624
  }
618
625
  # <meta property="og:title" content="The Rock">
@@ -628,19 +635,21 @@ Multiple images declared as an **array** (look at the `_` character):
628
635
 
629
636
  ```ruby
630
637
  set_meta_tags og: {
631
- title: 'Two structured image properties',
632
- type: 'website',
633
- url: 'view-source:http://examples.opengraphprotocol.us/image-array.html',
634
- image: [{
635
- _: 'http://examples.opengraphprotocol.us/media/images/75.png',
636
- width: 75,
637
- height: 75,
638
- },
639
- {
640
- _: 'http://examples.opengraphprotocol.us/media/images/50.png',
641
- width: 50,
642
- height: 50,
643
- }]
638
+ title: "Two structured image properties",
639
+ type: "website",
640
+ url: "view-source:http://examples.opengraphprotocol.us/image-array.html",
641
+ image: [
642
+ {
643
+ _: "http://examples.opengraphprotocol.us/media/images/75.png",
644
+ width: 75,
645
+ height: 75
646
+ },
647
+ {
648
+ _: "http://examples.opengraphprotocol.us/media/images/50.png",
649
+ width: 50,
650
+ height: 50
651
+ }
652
+ ]
644
653
  }
645
654
  # <meta property="og:title" content="Two structured image properties">
646
655
  # <meta property="og:type" content="website">
@@ -657,10 +666,10 @@ Article meta tags are supported too:
657
666
 
658
667
  ```ruby
659
668
  set_meta_tags article: {
660
- published_time: '2013-09-17T05:59:00+01:00',
661
- modified_time: '2013-09-16T19:08:47+01:00',
662
- section: 'Article Section',
663
- tag: 'Article Tag',
669
+ published_time: "2013-09-17T05:59:00+01:00",
670
+ modified_time: "2013-09-16T19:08:47+01:00",
671
+ section: "Article Section",
672
+ tag: "Article Tag"
664
673
  }
665
674
  # <meta property="article:published_time" content="2013-09-17T05:59:00+01:00">
666
675
  # <meta property="article:modified_time" content="2013-09-16T19:08:47+01:00">
@@ -693,11 +702,11 @@ When you need to generate a [Twitter Photo card](https://dev.twitter.com/docs/ca
693
702
 
694
703
  ```ruby
695
704
  set_meta_tags twitter: {
696
- card: "photo",
705
+ card: "photo",
697
706
  image: {
698
- _: "http://example.com/1.png",
699
- width: 100,
700
- height: 100,
707
+ _: "http://example.com/1.png",
708
+ width: 100,
709
+ height: 100
701
710
  }
702
711
  }
703
712
  # <meta name="twitter:card" content="photo">
@@ -710,12 +719,12 @@ Special parameter `itemprop` can be used on a "anonymous" tag "\_" to generate "
710
719
 
711
720
  ```ruby
712
721
  set_meta_tags twitter: {
713
- card: "photo",
722
+ card: "photo",
714
723
  image: {
715
- _: "http://example.com/1.png",
716
- width: 100,
717
- height: 100,
718
- itemprop: "image",
724
+ _: "http://example.com/1.png",
725
+ width: 100,
726
+ height: 100,
727
+ itemprop: "image"
719
728
  }
720
729
  }
721
730
  # <meta name="twitter:card" content="photo">
@@ -765,7 +774,7 @@ You can also specify value as an Array, and values will be displayed as a list
765
774
  of `meta` tags:
766
775
 
767
776
  ```ruby
768
- set_meta_tags author: [ "Dmytro Shteflyuk", "John Doe" ]
777
+ set_meta_tags author: ["Dmytro Shteflyuk", "John Doe"]
769
778
  # <meta name="author" content="Dmytro Shteflyuk">
770
779
  # <meta name="author" content="John Doe">
771
780
  ```
data/Rakefile CHANGED
@@ -1,19 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler'
3
+ require "bundler"
4
4
  Bundler::GemHelper.install_tasks
5
5
 
6
- require 'rspec/core/rake_task'
6
+ require "rspec/core/rake_task"
7
7
  RSpec::Core::RakeTask.new(:spec)
8
8
 
9
+ desc "Run RSpec tests"
9
10
  task test: :spec
10
11
  task default: :spec
11
12
 
12
- desc 'Rebuild Circle CI configuration based on the build matrix template .circleci/config.yml.erb'
13
+ desc "Rebuild Circle CI configuration based on the build matrix template .circleci/config.yml.erb"
13
14
  task :circleci do
14
- require 'erb'
15
- template_path = File.expand_path('.circleci/config.yml.erb', __dir__)
16
- config_path = File.expand_path('.circleci/config.yml', __dir__)
15
+ require "erb"
16
+ template_path = File.expand_path(".circleci/config.yml.erb", __dir__)
17
+ config_path = File.expand_path(".circleci/config.yml", __dir__)
17
18
  File.write config_path, ERB.new(File.read(template_path)).result
18
19
  end
19
20
 
@@ -26,24 +27,30 @@ module SteepRunner
26
27
  end
27
28
  end
28
29
 
29
- task :steep do
30
- SteepRunner.run("check")
31
- end
30
+ desc "Check type information"
31
+ task steep: "steep:check"
32
32
 
33
33
  namespace :steep do
34
+ desc "Check type information"
35
+ task :check do
36
+ SteepRunner.run("check")
37
+ end
38
+
39
+ desc "Print type statistics"
34
40
  task :stats do
35
41
  SteepRunner.run("stats", "--log-level=fatal")
36
42
  end
37
43
  end
38
44
 
39
45
  namespace :rbs do
46
+ desc "Run RSpec tests with RBS enabled to test type signatures"
40
47
  task :spec do
41
48
  exec(
42
49
  {
43
- 'RBS_TEST_TARGET' => 'MetaTags::*',
44
- 'RUBYOPT' => '-rrbs/test/setup',
50
+ "RBS_TEST_TARGET" => "MetaTags::*",
51
+ "RUBYOPT" => "-rrbs/test/setup"
45
52
  },
46
- 'bundle exec rspec',
53
+ "bundle exec rspec"
47
54
  )
48
55
  end
49
56
  end
data/Steepfile CHANGED
@@ -10,6 +10,4 @@ target :lib do
10
10
  # (because we don't have RBS files for it)
11
11
  ignore "lib/meta_tags/railtie.rb"
12
12
  ignore "lib/generators"
13
-
14
- library "set"
15
13
  end