jekyll-hostname 1.0.7 → 1.0.9

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: f2af2cce6c35b7090b7c5147584910b014bac934bd3a9291e82f71d15daf636c
4
- data.tar.gz: d8421ed0e9c4695ab0210bb8d3af34c96e3b0c8a17173eea23a97da22d3e2828
3
+ metadata.gz: 7ba07cc9c2105aa7968e5360f851f0807428fbb69a22649abb56e58805b3ebbe
4
+ data.tar.gz: 848a1efdca14c7c9624524de3ab050ecb51ae599754ed31ddc1ca4aa65aed000
5
5
  SHA512:
6
- metadata.gz: 662c9784e9d9d997753de7434b3b2c7651e8f2e70b0b4b737c5fba90fae444c0acb87dedef25818e7ea787718f0ce6120b4055e5c1257c84c77edfaf2b685d5c
7
- data.tar.gz: 670b5d3c47d81978593204e0ab929fba1c3c937c39701865a48b7bfead40135f7d2251f84e63d627553b54024f816e5a50f5ad153fb4080988ac6f203b7ce131
6
+ metadata.gz: 7c9f3c06ecc8c44feb9f7b917ccb0fdbd83bf8f26ff7bbefc57ac57bdd3be90bc33a6764c9e6729fbcacbd2d4ca0dc57a7381f81acfa83c251f60ff07a03ed0a
7
+ data.tar.gz: 9f1fd168bf81f94a537451b2ded3ea52e6a8d0f4f709074be69d838f53394e1afaf4e5aa0d1da51dc91fbe9b9ad8305e6dee51c2dc6ef9c5d8e16a13b559cb69
data/.gitignore CHANGED
@@ -11,4 +11,4 @@ Gemfile.lock
11
11
  /tmp/
12
12
 
13
13
  # Ignore all files with the .gem extension
14
- *.gem
14
+ *.gem
File without changes
data/README.md CHANGED
@@ -1,43 +1,73 @@
1
1
  # Jekyll::Hostname
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/jekyll/hostname`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ A jekyll plugin to grab the hostnames from a URL, meaning
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ - `https://google.com` becomes `google.com`
6
+ - `http://github.com` becomes `github.com`
7
+ - `https://github.com/gouravkhunger/jekyll-hostname` becomes `github.com`
8
+
9
+ This gem was originally authored to be used as a custom plugin for the [static site](https://github.com/genicsblog/genicsblog.github.io) of [genicsblog.com](https://genicsblog.com)
6
10
 
7
11
  ## Installation
8
12
 
9
- Add this line to your application's Gemfile:
13
+ Add this line to your application's Gemfile inside the `jekyll_plugins` group:
10
14
 
11
15
  ```ruby
12
- gem 'jekyll-hostname'
16
+ group :jekyll_plugins do
17
+ # other gems
18
+ gem "jekyll-hostname"
19
+ end
13
20
  ```
14
21
 
15
- And then execute:
22
+ Then, enable the plugin by adding it to the `plugins` section in the `_config.yml` file:
16
23
 
17
- $ bundle install
24
+ ```yaml
25
+ plugins:
26
+ # - other plugins
27
+ - jekyll-hostname
28
+ ```
18
29
 
19
- Or install it yourself as:
30
+ And then execute:
20
31
 
21
- $ gem install jekyll-hostname
32
+ ```shell
33
+ bundle install
34
+ ```
22
35
 
23
36
  ## Usage
24
37
 
25
- TODO: Write usage instructions here
26
-
27
- ## Development
38
+ This plugin is essentially a filter and works on any [valid URL string](https://en.wikipedia.org/wiki/URL#Syntax) provided inside a liquid tag. Use it as below:
28
39
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
40
+ ```liquid
41
+ {% assign host = site.url | hostname %}
42
+ {% assign domain = post.source | hostname %}
43
+ ```
34
44
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jekyll-hostname. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/jekyll-hostname/blob/main/CODE_OF_CONDUCT.md).
45
+ The `hostname` filter extracts the root domain from the given url string(here `site.url` or `page.source`)
36
46
 
37
47
  ## License
38
48
 
39
49
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
50
 
41
- ## Code of Conduct
42
-
43
- Everyone interacting in the Jekyll::Hostname project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/jekyll-hostname/blob/main/CODE_OF_CONDUCT.md).
51
+ ```
52
+ MIT License
53
+
54
+ Copyright (c) 2021 Gourav Khunger
55
+
56
+ Permission is hereby granted, free of charge, to any person obtaining a copy
57
+ of this software and associated documentation files (the "Software"), to deal
58
+ in the Software without restriction, including without limitation the rights
59
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
60
+ copies of the Software, and to permit persons to whom the Software is
61
+ furnished to do so, subject to the following conditions:
62
+
63
+ The above copyright notice and this permission notice shall be included in all
64
+ copies or substantial portions of the Software.
65
+
66
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
67
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
68
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
69
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
70
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
71
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
72
+ SOFTWARE.
73
+ ```
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "rake/testtask"
2
+
3
+ Rake::TestTask.new do |t|
4
+ t.pattern = "spec/*_spec.rb"
5
+ end
6
+
7
+ desc "Run tests"
8
+ task :default => [:test]
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "jekyll-hostname"
3
- spec.version = "1.0.7"
3
+ spec.version = "1.0.9"
4
4
  spec.authors = ["Gourav Khunger"]
5
5
  spec.email = ["gouravkhunger18@gmail.com"]
6
6
 
@@ -9,8 +9,9 @@ Gem::Specification.new do |spec|
9
9
  spec.license = "MIT"
10
10
 
11
11
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|spec|features)/!) }
12
- spec.require_paths = ['lib']
13
- spec.required_ruby_version = ">= 2.4.0"
12
+ spec.require_paths = ["lib"]
13
+ spec.required_ruby_version = ">= 2.5.0"
14
14
 
15
- spec.add_dependency "jekyll"
15
+ spec.add_runtime_dependency "jekyll", ">= 3.0.0"
16
+ spec.add_development_dependency "minitest", "~> 5.14"
16
17
  end
@@ -1,10 +1,13 @@
1
- require 'uri'
1
+ require "uri"
2
+ require "jekyll"
2
3
 
3
4
  module Jekyll
4
5
  module JekyllHostname
6
+
5
7
  def hostname(input)
6
8
  URI.parse(input).host
7
9
  end
10
+
8
11
  end
9
12
  end
10
13
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-hostname
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gourav Khunger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-26 00:00:00.000000000 Z
11
+ date: 2022-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -16,14 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 3.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 3.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: minitest
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.14'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5.14'
27
41
  description:
28
42
  email:
29
43
  - gouravkhunger18@gmail.com
@@ -32,10 +46,10 @@ extensions: []
32
46
  extra_rdoc_files: []
33
47
  files:
34
48
  - ".gitignore"
35
- - CODE_OF_CONDUCT.md
36
49
  - Gemfile
37
- - LICENSE.txt
50
+ - LICENSE.md
38
51
  - README.md
52
+ - Rakefile
39
53
  - jekyll-hostname.gemspec
40
54
  - lib/jekyll-hostname.rb
41
55
  homepage: https://github.com/gouravkhunger/jekyll-hostname
@@ -50,14 +64,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
50
64
  requirements:
51
65
  - - ">="
52
66
  - !ruby/object:Gem::Version
53
- version: 2.4.0
67
+ version: 2.5.0
54
68
  required_rubygems_version: !ruby/object:Gem::Requirement
55
69
  requirements:
56
70
  - - ">="
57
71
  - !ruby/object:Gem::Version
58
72
  version: '0'
59
73
  requirements: []
60
- rubygems_version: 3.2.32
74
+ rubygems_version: 3.3.11
61
75
  signing_key:
62
76
  specification_version: 4
63
77
  summary: A Jekyll plugin that provides a liquid filter to extract the hostname from
data/CODE_OF_CONDUCT.md DELETED
@@ -1,84 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
29
-
30
- ## Enforcement Responsibilities
31
-
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
-
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
-
36
- ## Scope
37
-
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
-
40
- ## Enforcement
41
-
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at gouravkhunger18@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
-
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
-
46
- ## Enforcement Guidelines
47
-
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
-
50
- ### 1. Correction
51
-
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
-
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
-
56
- ### 2. Warning
57
-
58
- **Community Impact**: A violation through a single incident or series of actions.
59
-
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
-
62
- ### 3. Temporary Ban
63
-
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
-
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
-
68
- ### 4. Permanent Ban
69
-
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
-
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
73
-
74
- ## Attribution
75
-
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
-
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
82
-
83
- For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.