meta-rails 1.0.0 → 2.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e91103f602c3e7f2dc9d205675dc9afadd8ccddbc3d50f884c218c9e471d14b
4
- data.tar.gz: 9095044ab4e566c005212226efeb9f6b077f923bf2d4dfe64c72b5845f909c5a
3
+ metadata.gz: fc01e4c4154507b6117276775367e66cba7e80073478f43e29dda8d062eba2b1
4
+ data.tar.gz: 33784877f4a0311ef3172b44118a39fde32871b47dcfcaa330e12e7f8aad7700
5
5
  SHA512:
6
- metadata.gz: 5726eac72cbe99e0e38c6f7e71a787fad93097cf5b45642bf4b7f78c5515ffc9a7509bd52dbb09583fe9e7f31efc536dd6ef8aa3af9608ebb76a74f923c8966b
7
- data.tar.gz: 606d588e315cfad395f278536e44708ffb38a582d25f8ba4b239af41f84f0620c352c2e66988a7fa219fe55d4f0f7f6a7233eaa886d6985cd183fd605cf2f8dc
6
+ metadata.gz: 782e8ab9f79af7140c54c0f64a11178602597b5c9c93297ee5d5ecab01308a00b7c0225d0b5632df0311e9373f095dd229b5aac19f00a21a1cd2fc6a7646364f
7
+ data.tar.gz: ce7387d5ec9fd202f3004f3022f2f778162525c3ebbdc5fc37c0e7ead4a165fdbe80482ed053d485fc0f87a128a2e6413a670729976dd0236ecbda64248b3274
@@ -0,0 +1,36 @@
1
+ name: CI
2
+ on: [push, pull_request]
3
+ jobs:
4
+ tests:
5
+ runs-on: ubuntu-latest
6
+ strategy:
7
+ fail-fast: false
8
+ matrix:
9
+ include:
10
+ - rails: '6.0'
11
+ ruby: 2.5
12
+ - rails: '6.0'
13
+ ruby: 2.6
14
+ - rails: '6.0'
15
+ ruby: 2.7
16
+ - rails: '6.1'
17
+ ruby: 2.5
18
+ - rails: '6.1'
19
+ ruby: 2.6
20
+ - rails: '6.1'
21
+ ruby: 2.7
22
+ name: Rails ${{ matrix.rails }} on Ruby ${{ matrix.ruby }}
23
+ steps:
24
+ - name: Checkout
25
+ uses: actions/checkout@v2
26
+ - name: Set up Ruby
27
+ env:
28
+ RAILS_VERSION: ${{ matrix.rails }}
29
+ uses: ruby/setup-ruby@v1
30
+ with:
31
+ ruby-version: ${{ matrix.ruby }}
32
+ bundler-cache: true
33
+ - name: Run tests
34
+ env:
35
+ RAILS_VERSION: ${{ matrix.rails }}
36
+ run: bundle exec rake
data/.gitignore CHANGED
@@ -1,10 +1,11 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
- /Gemfile.lock
4
3
  /_yardoc/
5
4
  /coverage/
6
5
  /doc/
6
+ /Gemfile.lock
7
7
  /log/
8
8
  /pkg/
9
9
  /spec/reports/
10
10
  /tmp/
11
+ .rspec_status
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --format documentation
2
2
  --color
3
+ --require rails_helper
@@ -0,0 +1,21 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ TargetRubyVersion: 2.5
4
+
5
+ Layout/IndentationConsistency:
6
+ EnforcedStyle: indented_internal_methods
7
+
8
+ Layout/LineLength:
9
+ Max: 100
10
+
11
+ Naming/FileName:
12
+ Exclude: [lib/meta-rails.rb]
13
+
14
+ Metrics/BlockLength:
15
+ IgnoredMethods: [RSpec.describe, describe, context]
16
+
17
+ Style/Documentation:
18
+ Enabled: false
19
+
20
+ Style/FrozenStringLiteralComment:
21
+ EnforcedStyle: never
@@ -1,14 +1,18 @@
1
- ## 1.0.0 (2018-05-11)
1
+ # [2.0.0](https://github.com/rubysamurai/meta-rails/compare/v1.0.0...v2.0.0) (2020-12-16)
2
+
3
+ - Rails versioning: drop support for rails < 6.0
4
+
5
+ # [1.0.0](https://github.com/rubysamurai/meta-rails/compare/v0.1.1...v1.0.0) (2018-05-11)
2
6
 
3
7
  - New: `meta_description` helper
4
8
  - New: `robots` helper
5
9
  - Changed: `:page_title` renamed to `:identifer` for `title` helper
6
- - Rails versioning: support rails 5.0, 5.1, 5.2; drop support for rails 3.2, 4.0, 4.1
10
+ - Rails versioning: drop support for rails < 5.0
7
11
 
8
- ## 0.1.1 (2015-11-16)
12
+ # [0.1.1](https://github.com/rubysamurai/meta-rails/compare/v0.1.0...v0.1.1) (2015-11-16)
9
13
 
10
14
  - Bug Fix: Brand display when page title is omitted
11
15
 
12
- ## 0.1.0 (2015-11-16)
16
+ # 0.1.0 (2015-11-16)
13
17
 
14
18
  - Initial release
data/Gemfile CHANGED
@@ -2,5 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- rails_version = ENV['RAILS_VERSION'] || '5.2'
6
- eval_gemfile File.expand_path("../gemfiles/#{rails_version}.gemfile", __FILE__)
5
+ if ENV['CI']
6
+ rails_version = ENV['RAILS_VERSION'] || '6.1'
7
+ eval_gemfile File.expand_path("../gemfiles/#{rails_version}.gemfile", __FILE__)
8
+ end
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Meta Rails
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/meta-rails.svg)](https://badge.fury.io/rb/meta-rails)
4
- [![Build Status](https://travis-ci.org/rubysamurai/meta-rails.svg)](https://travis-ci.org/rubysamurai/meta-rails)
4
+ [![CI](https://github.com/rubysamurai/meta-rails/workflows/CI/badge.svg)](https://github.com/rubysamurai/meta-rails/actions?query=workflow%3ACI)
5
5
 
6
6
  Collection of view helpers to improve search engine optimization of Ruby on Rails application by including appropriate meta tags.
7
7
 
@@ -17,7 +17,7 @@ Save `Gemfile` and execute `bundle` command to install the gem.
17
17
 
18
18
  ## Title
19
19
 
20
- Based on [Moz](https://moz.com/learn/seo/title-tag) and [Google Help](https://support.google.com/webmasters/answer/35624#3) guidelines a proper title consist of *page title*, *brand name*, and *separator* between them.
20
+ Based on [Google Help](https://support.google.com/webmasters/answer/35624#3) and [Moz](https://moz.com/learn/seo/title-tag) guidelines a proper title consist of *page title*, *brand name*, and *separator* between them.
21
21
 
22
22
  #### How to use `title` helper
23
23
 
@@ -39,18 +39,18 @@ This code will create HTML `<title>` element:
39
39
  <title>Sign up | AwesomeRailsApp</title>
40
40
  ```
41
41
 
42
- Format of HTML `<title>` element can be modified by passing options hash to the `title` helper:
42
+ Format of HTML `<title>` element can be modified by passing keyword arguments to `title` helper:
43
43
 
44
- Option | Description | Default
44
+ Argument | Description | Default
45
45
  -------------|-----------------------------------------------|-----------
46
46
  `:identifier`| Identifier for stored page's title | `:title`
47
- `:brand` | Brand name | Rails.application.class.parent_name
47
+ `:brand` | Brand name | Rails.application.class.module_parent_name
48
48
  `:separator` | Character between title and brand | `\|`
49
49
  `:reverse` | Switch position of title and brand | `false`
50
50
 
51
51
  ## Meta description
52
52
 
53
- Meta description tag provides a short summary of the page.
53
+ Meta description tag provides a short summary of the page (refer to [this](https://support.google.com/webmasters/answer/35624?hl=en&ref_topic=6001942#1) and [this](https://moz.com/learn/seo/meta-description) articles for details).
54
54
 
55
55
  #### How to use `meta_description` helper
56
56
 
@@ -72,15 +72,15 @@ This code will create HTML `<meta>` tag:
72
72
  <meta name="description" content="Register to manage your account" />
73
73
  ```
74
74
 
75
- Options hash can be passed to `meta_description` helper:
75
+ Keyword arguments can be passed to `meta_description` helper:
76
76
 
77
- Option | Description | Default
77
+ Argument | Description | Default
78
78
  -------------|-----------------------------------------------|-----------
79
79
  `:identifier`| Identifier for stored page's meta description | `:meta_description`
80
80
 
81
81
  ## Robots
82
82
 
83
- Robots meta tag can control the behavior of search engine crawling and indexing.
83
+ Robots meta tag can control the behavior of search engine crawling and indexing (refer to [this](https://developers.google.com/search/reference/robots_meta_tag) and [this](https://moz.com/learn/seo/robots-meta-directives) articles for details).
84
84
 
85
85
  #### How to use `robots` helper
86
86
 
@@ -102,9 +102,9 @@ This code will create HTML `<meta>` tag:
102
102
  <meta name="robots" content="noindex,nofollow" />
103
103
  ```
104
104
 
105
- Options hash can be passed to `robots` helper:
105
+ Keyword arguments can be passed to `robots` helper:
106
106
 
107
- Option | Description | Default
107
+ Argument | Description | Default
108
108
  -------------|------------------------------------------------|-----------
109
109
  `:identifier`| Identifier for stored page's robots directives | `:robots`
110
110
 
data/Rakefile CHANGED
@@ -1,4 +1,6 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
3
6
  task default: :spec
4
- RSpec::Core::RakeTask.new
@@ -7,8 +7,8 @@ require 'meta-rails'
7
7
  # with your gem easier. You can also use a different console, if you like.
8
8
 
9
9
  # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
10
+ # require 'pry'
11
11
  # Pry.start
12
12
 
13
13
  require 'irb'
14
- IRB.start
14
+ IRB.start(__FILE__)
data/bin/setup CHANGED
@@ -1,6 +1,7 @@
1
- #!/bin/bash
1
+ #!/usr/bin/env bash
2
2
  set -euo pipefail
3
3
  IFS=$'\n\t'
4
+ set -vx
4
5
 
5
6
  bundle install
6
7
 
@@ -0,0 +1 @@
1
+ gem 'railties', '~> 6.0.0'
@@ -0,0 +1 @@
1
+ gem 'railties', '~> 6.1.0'
@@ -3,8 +3,3 @@ require 'meta/rails/helpers/meta_description_helper'
3
3
  require 'meta/rails/helpers/robots_helper'
4
4
  require 'meta/rails/helpers/title_helper'
5
5
  require 'meta/rails/railtie' if defined? Rails
6
-
7
- module Meta
8
- module Rails
9
- end
10
- end
@@ -4,6 +4,7 @@ module MetaRailsHelpers
4
4
  def meta_description(identifier: :meta_description)
5
5
  meta_description = content_for(identifier)
6
6
  return if meta_description.blank?
7
+
7
8
  tag(:meta, name: 'description', content: meta_description)
8
9
  end
9
10
  end
@@ -4,6 +4,7 @@ module MetaRailsHelpers
4
4
  def robots(identifier: :robots)
5
5
  robots = content_for(identifier)
6
6
  return if robots.blank?
7
+
7
8
  tag(:meta, name: 'robots', content: robots)
8
9
  end
9
10
  end
@@ -18,7 +18,7 @@ module MetaRailsHelpers
18
18
 
19
19
  # Returns Rails application class name as default brand
20
20
  def default_brand
21
- Rails.application.class.parent_name
21
+ Rails.application.class.module_parent_name
22
22
  end
23
23
  end
24
24
  end
@@ -1,3 +1,5 @@
1
+ require 'rails/railtie'
2
+
1
3
  module MetaRailsHelpers
2
4
  class Railtie < Rails::Railtie
3
5
  initializer 'meta_description.helper' do
@@ -1,5 +1,5 @@
1
1
  module Meta
2
2
  module Rails
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '2.0.0'.freeze
4
4
  end
5
5
  end
@@ -1,6 +1,4 @@
1
- lib = File.expand_path('../lib', __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require 'meta/rails/version'
1
+ require_relative 'lib/meta/rails/version'
4
2
 
5
3
  Gem::Specification.new do |spec|
6
4
  spec.name = 'meta-rails'
@@ -8,19 +6,26 @@ Gem::Specification.new do |spec|
8
6
  spec.authors = ['Dmitriy Tarasov']
9
7
  spec.email = ['info@rubysamurai.com']
10
8
 
11
- spec.summary = 'Meta tags helpers for search engine optimization (SEO)'
12
- spec.description = 'Meta tags helpers to improve search engine optimization (SEO) of Rails application'
9
+ spec.summary = 'Meta tags helpers for search engine optimization of Rails application'
10
+ spec.description = spec.summary
13
11
  spec.homepage = 'https://github.com/rubysamurai/meta-rails'
14
12
  spec.license = 'MIT'
13
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
15
14
 
16
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
- f.match(%r{^(test|spec|features)/})
15
+ spec.metadata['homepage_uri'] = spec.homepage
16
+ spec.metadata['source_code_uri'] = spec.homepage
17
+ spec.metadata['bug_tracker_uri'] = "#{spec.homepage}/issues"
18
+ spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/master/CHANGELOG.md"
19
+
20
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
21
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
22
  end
23
+
19
24
  spec.bindir = 'exe'
20
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
26
  spec.require_paths = ['lib']
22
27
 
23
- spec.required_ruby_version = '>= 2.1.0'
28
+ spec.add_runtime_dependency 'railties', '>= 6.0'
24
29
 
25
- spec.add_development_dependency 'rspec-rails', '>= 3.5'
30
+ spec.add_development_dependency 'rspec-rails', '>= 3.9'
26
31
  end
metadata CHANGED
@@ -1,40 +1,54 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meta-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Tarasov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-11 00:00:00.000000000 Z
11
+ date: 2020-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '6.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '6.0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rspec-rails
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - ">="
18
32
  - !ruby/object:Gem::Version
19
- version: '3.5'
33
+ version: '3.9'
20
34
  type: :development
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - ">="
25
39
  - !ruby/object:Gem::Version
26
- version: '3.5'
27
- description: Meta tags helpers to improve search engine optimization (SEO) of Rails
28
- application
40
+ version: '3.9'
41
+ description: Meta tags helpers for search engine optimization of Rails application
29
42
  email:
30
43
  - info@rubysamurai.com
31
44
  executables: []
32
45
  extensions: []
33
46
  extra_rdoc_files: []
34
47
  files:
48
+ - ".github/workflows/ci.yml"
35
49
  - ".gitignore"
36
50
  - ".rspec"
37
- - ".travis.yml"
51
+ - ".rubocop.yml"
38
52
  - CHANGELOG.md
39
53
  - Gemfile
40
54
  - LICENSE.txt
@@ -42,10 +56,8 @@ files:
42
56
  - Rakefile
43
57
  - bin/console
44
58
  - bin/setup
45
- - gemfiles/4.2.gemfile
46
- - gemfiles/5.0.gemfile
47
- - gemfiles/5.1.gemfile
48
- - gemfiles/5.2.gemfile
59
+ - gemfiles/6.0.gemfile
60
+ - gemfiles/6.1.gemfile
49
61
  - lib/meta-rails.rb
50
62
  - lib/meta/rails/helpers/meta_description_helper.rb
51
63
  - lib/meta/rails/helpers/robots_helper.rb
@@ -56,7 +68,11 @@ files:
56
68
  homepage: https://github.com/rubysamurai/meta-rails
57
69
  licenses:
58
70
  - MIT
59
- metadata: {}
71
+ metadata:
72
+ homepage_uri: https://github.com/rubysamurai/meta-rails
73
+ source_code_uri: https://github.com/rubysamurai/meta-rails
74
+ bug_tracker_uri: https://github.com/rubysamurai/meta-rails/issues
75
+ changelog_uri: https://github.com/rubysamurai/meta-rails/blob/master/CHANGELOG.md
60
76
  post_install_message:
61
77
  rdoc_options: []
62
78
  require_paths:
@@ -65,16 +81,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
81
  requirements:
66
82
  - - ">="
67
83
  - !ruby/object:Gem::Version
68
- version: 2.1.0
84
+ version: 2.5.0
69
85
  required_rubygems_version: !ruby/object:Gem::Requirement
70
86
  requirements:
71
87
  - - ">="
72
88
  - !ruby/object:Gem::Version
73
89
  version: '0'
74
90
  requirements: []
75
- rubyforge_project:
76
- rubygems_version: 2.7.6
91
+ rubygems_version: 3.1.4
77
92
  signing_key:
78
93
  specification_version: 4
79
- summary: Meta tags helpers for search engine optimization (SEO)
94
+ summary: Meta tags helpers for search engine optimization of Rails application
80
95
  test_files: []
@@ -1,13 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.2.10
5
- - 2.3.7
6
- - 2.4.4
7
- - 2.5.1
8
- env:
9
- - RAILS_VERSION=4.2
10
- - RAILS_VERSION=5.0
11
- - RAILS_VERSION=5.1
12
- - RAILS_VERSION=5.2
13
- before_install: gem install bundler
@@ -1 +0,0 @@
1
- gem 'rails', '~> 4.2.0'
@@ -1 +0,0 @@
1
- gem 'rails', '~> 5.0.0'
@@ -1 +0,0 @@
1
- gem 'rails', '~> 5.1.0'
@@ -1 +0,0 @@
1
- gem 'rails', '~> 5.2.0'