jekyll-gh-contributors 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +18 -0
- data/.gitignore +12 -0
- data/.rspec +3 -0
- data/.rubocop.yml +10 -0
- data/Gemfile +12 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -1
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/jekyll-gh-contributors.gemspec +34 -0
- data/lib/jekyll-gh-contributors.rb +41 -0
- data/lib/jekyll-gh-contributors/version.rb +5 -0
- metadata +22 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af037f356206494c03a248ef1931b1757e0ca31cd749b24e2c846428e21f9ed2
|
4
|
+
data.tar.gz: 88f7aa6ab452dab1f97beaed70c2e6874ab9038bc71dd84cd5ca33a2f37a405e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5baadd896b25d2546e152baafa76a606f5bba731be3433f651ee3585982074c0b8996a3f32519f045d34d1c093134e05800d129256b65e090d978ccba8490b00
|
7
|
+
data.tar.gz: 97adaeba1a352b6736b71220a9994c736141229ad80028c833a94e6e84d9ef52abb3b4cd45866524f5c89860ca0a5147665c675db117086aebd050399b2c5376
|
@@ -0,0 +1,18 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push,pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@v2
|
10
|
+
- name: Set up Ruby
|
11
|
+
uses: ruby/setup-ruby@v1
|
12
|
+
with:
|
13
|
+
ruby-version: 3.0.0
|
14
|
+
- name: Run the default task
|
15
|
+
run: |
|
16
|
+
gem install bundler -v 2.2.3
|
17
|
+
bundle install
|
18
|
+
bundle exec rake
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2021 joel ibaceta
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1 +1,43 @@
|
|
1
|
-
#
|
1
|
+
# Jekyll::Gh::Contributors
|
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/gh/contributors`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'jekyll-gh-contributors'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install jekyll-gh-contributors
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. 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
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jekyll-gh-contributors. 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-gh-contributors/blob/master/CODE_OF_CONDUCT.md).
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
+
|
41
|
+
## Code of Conduct
|
42
|
+
|
43
|
+
Everyone interacting in the Jekyll::Gh::Contributors project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/jekyll-gh-contributors/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "jekyll/gh/contributors"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/jekyll-gh-contributors/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "jekyll-gh-contributors"
|
7
|
+
spec.version = Jekyll::JekyllGHContributors::VERSION
|
8
|
+
spec.authors = ["joel ibaceta"]
|
9
|
+
spec.email = ["mail@joelibaceta.com"]
|
10
|
+
|
11
|
+
spec.summary = "Jekyll plugin to generate contributors pics grid"
|
12
|
+
spec.description = "Jekyll plugin to generate contributors pics grid"
|
13
|
+
spec.homepage = "https://github.com/joelibaceta/jekyll-gh-contributors"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
16
|
+
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = "https://github.com/joelibaceta/jekyll-gh-contributors"
|
19
|
+
|
20
|
+
# Specify which files should be added to the gem when it is released.
|
21
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
23
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
24
|
+
end
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
# Uncomment to register a new dependency of your gem
|
30
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
31
|
+
|
32
|
+
# For more information and examples about making a new gem, checkout our
|
33
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
34
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'net/http'
|
4
|
+
require 'uri'
|
5
|
+
require 'jekyll'
|
6
|
+
require 'jekyll-gh-contributors/version'
|
7
|
+
|
8
|
+
class ContributorsTag < Liquid::Tag
|
9
|
+
def initialize(tag_name, text, tokens)
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
13
|
+
def getContributors(repo_url)
|
14
|
+
uri = URI.parse('{repo_url}/contributors')
|
15
|
+
response = Net::HTTP.get_response(uri)
|
16
|
+
|
17
|
+
contributors = JSON.parse(response.body)
|
18
|
+
contributors
|
19
|
+
end
|
20
|
+
|
21
|
+
def render(_context)
|
22
|
+
|
23
|
+
repo_url = "#{context[@content.strip]}"
|
24
|
+
contributors = getContributors(repo_url)
|
25
|
+
|
26
|
+
element = "<style>.contributors{margin-top:30px;display:flex;flex-flow:row wrap}.contributors .contributor{width:39px;padding:1px}</style>"
|
27
|
+
|
28
|
+
element += "<div class='contributors scrollbar'>"
|
29
|
+
contributors.each do |contributor|
|
30
|
+
element += "<div class='contributor'>"
|
31
|
+
element += " <a href='#{contributor['html_url']}' title='#{contributor['title']}'>"
|
32
|
+
element += " <img class='User__image' src='#{contributor['avatar_url']}'>"
|
33
|
+
element += ' </a>'
|
34
|
+
element += '</div>'
|
35
|
+
end
|
36
|
+
element += '</div>'
|
37
|
+
element
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
Liquid::Template.register_tag('gh_contributors', Jekyll::ContributorsTag)
|
metadata
CHANGED
@@ -1,69 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-gh-contributors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- joel ibaceta
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
11
|
date: 2021-07-29 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
13
|
-
|
14
|
-
name: jekyll
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.10'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.10'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '10.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '10.0'
|
55
|
-
description: jekyll plugin to generate contributors grid from GitHub
|
12
|
+
dependencies: []
|
13
|
+
description: Jekyll plugin to generate contributors pics grid
|
56
14
|
email:
|
57
15
|
- mail@joelibaceta.com
|
58
16
|
executables: []
|
59
17
|
extensions: []
|
60
18
|
extra_rdoc_files: []
|
61
19
|
files:
|
20
|
+
- ".github/workflows/main.yml"
|
21
|
+
- ".gitignore"
|
22
|
+
- ".rspec"
|
23
|
+
- ".rubocop.yml"
|
24
|
+
- Gemfile
|
25
|
+
- LICENSE.txt
|
62
26
|
- README.md
|
27
|
+
- Rakefile
|
28
|
+
- bin/console
|
29
|
+
- bin/setup
|
30
|
+
- jekyll-gh-contributors.gemspec
|
31
|
+
- lib/jekyll-gh-contributors.rb
|
32
|
+
- lib/jekyll-gh-contributors/version.rb
|
63
33
|
homepage: https://github.com/joelibaceta/jekyll-gh-contributors
|
64
34
|
licenses:
|
65
35
|
- MIT
|
66
|
-
metadata:
|
36
|
+
metadata:
|
37
|
+
homepage_uri: https://github.com/joelibaceta/jekyll-gh-contributors
|
38
|
+
source_code_uri: https://github.com/joelibaceta/jekyll-gh-contributors
|
67
39
|
post_install_message:
|
68
40
|
rdoc_options: []
|
69
41
|
require_paths:
|
@@ -72,7 +44,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
72
44
|
requirements:
|
73
45
|
- - ">="
|
74
46
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
47
|
+
version: 2.3.0
|
76
48
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
49
|
requirements:
|
78
50
|
- - ">="
|
@@ -82,5 +54,5 @@ requirements: []
|
|
82
54
|
rubygems_version: 3.2.3
|
83
55
|
signing_key:
|
84
56
|
specification_version: 4
|
85
|
-
summary:
|
57
|
+
summary: Jekyll plugin to generate contributors pics grid
|
86
58
|
test_files: []
|