jekyll-material-icon-tag 1.0.4 → 1.1.1

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: abbb4b3eceb8ec1f84ebcc57c9d666075d5e0e877de9d0fef991373d7049a7e7
4
- data.tar.gz: f4dbe58aa16fe2903d5e277ce6cd35c4965fb45fe68eb2930e2acd71dac612b4
3
+ metadata.gz: 7392131aff9012f46817af3453da5d0065cb842b822ad5f9c396d6d49f78057e
4
+ data.tar.gz: 63a8d7b7d7a51c74a93923e4cd3c279144d5761a99df61f2f851a52fde42fd73
5
5
  SHA512:
6
- metadata.gz: 5e877c1dfa0e594cdb279ec3933332901b9c672a327c6e77edb911799cdcf7a5bd01047d0a21572c47fba0eec0954152b00f05d06f99aa7b845da4e6abc1622a
7
- data.tar.gz: daa71f373c4eb97781478428785b8daa7b24765fa8877fbafbac11dfa9415c0cc114380fa363ac6d263877124f48659c8dd42b8a8208f35b315d200ec87cf497
6
+ metadata.gz: 8075ddb27637dc3bb4254c76242cd0fca4fb2efe39bb13df332cecb261674b5cf10c3b09f3bf6b8840f385f45e2a242bd5fca54c005f7149c283009826d220e5
7
+ data.tar.gz: 97d0cdfc669055a9109ca11e040a70b52f02ae78fa7fbc1a48004decaa32809ccead1931453f9ed13867292983d44eca4b3c765bbb6c7e0a2ddacff1ed697be2
@@ -1,12 +1,6 @@
1
1
  name: Ruby Gem
2
2
 
3
- on:
4
- push:
5
- branches: [ master ]
6
- tags:
7
- - '*'
8
- pull_request:
9
- branches: [ master ]
3
+ on: [pull_request, push]
10
4
 
11
5
  jobs:
12
6
  build:
@@ -14,94 +8,98 @@ jobs:
14
8
  runs-on: ubuntu-latest
15
9
 
16
10
  steps:
17
- - uses: actions/checkout@v2
18
-
19
- - name: Fetch all history for all tags and branches
20
- run: |
21
- git fetch --prune --unshallow --tags
22
- echo "REF: ${{ github.ref }}"
23
-
24
- - name: Install GitVersion
25
- uses: gittools/actions/gitversion/setup@v0.9.2
26
- with:
27
- versionSpec: '5.2.x'
28
-
29
- - name: Execute GitVersion
30
- id: gitversion
31
- uses: gittools/actions/gitversion/execute@v0.9.2
32
-
33
- - name: Version variables for unstable builds
34
- id: unstable
35
- if: startsWith(github.ref, 'refs/tags/') != true
36
- env:
37
- LABEL: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}.${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}
38
- run: |
39
- echo "Pre-release: ${LABEL}"
40
- echo "::set-output name=label::${LABEL}"
41
-
42
- - name: Create gem version number
43
- id: gemversion
44
- env:
45
- GEM_VERSION: "${{ steps.gitversion.outputs.majorMinorPatch }}${{ steps.unstable.outputs.label }}"
46
- run: |
47
- echo "Gem version: ${GEM_VERSION}"
48
- echo "::set-output name=version::${GEM_VERSION}"
49
-
50
- - name: Set up Ruby 2.6
51
- uses: actions/setup-ruby@v1
52
- with:
53
- ruby-version: 2.6.x
54
-
55
- - name: Cache dependencies
56
- uses: actions/cache@v1
57
- with:
58
- path: vendor/bundle
59
- key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
60
- restore-keys: ${{ runner.os }}-gems-
61
-
62
- - name: Bundle install
63
- run: |
64
- gem install bundler
65
- bundle config path vendor/bundle
66
- bundle install --jobs 4 --retry 3
67
-
68
- - name: Build gem
69
- id: gem
70
- env:
71
- GEM_VERSION: ${{ steps.gemversion.outputs.version }}
72
- run: |
73
- GEM_BUILD_NAME=$(gem build jekyll-material-icon-tag.gemspec | awk '/File/ {print $2}')
74
- echo "Gem filename: '${GEM_BUILD_NAME}'"
75
- echo "::set-output name=name::${GEM_BUILD_NAME}"
76
-
77
- - name: Upload artifact
78
- uses: actions/upload-artifact@v2-preview
79
- with:
80
- name: ${{ steps.gem.outputs.name }}
81
- path: ${{ steps.gem.outputs.name }}
82
-
83
- - name: Publish to GPR
84
- env:
85
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86
- OWNER: SwedbankPay
87
- run: |
88
- mkdir -p $HOME/.gem
89
- touch $HOME/.gem/credentials
90
- chmod 0600 $HOME/.gem/credentials
91
- printf -- "---\n:github: Bearer ${GITHUB_TOKEN}\n" > $HOME/.gem/credentials
92
- set -e
93
- gem push --KEY github \
94
- --host https://rubygems.pkg.github.com/${OWNER} \
95
- ${{ steps.gem.outputs.name }} \
96
- || echo "push failed ($?) probably due to version '${{ steps.gemversion.outputs.version }}' already existing in GPR."
97
-
98
- - name: Publish to RubyGems
99
- if: startsWith(github.ref, 'refs/tags/') # Only publish tagged commits
100
- env:
101
- RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
102
- run: |
103
- mkdir -p $HOME/.gem
104
- touch $HOME/.gem/credentials
105
- chmod 0600 $HOME/.gem/credentials
106
- printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
107
- gem push ${{ steps.gem.outputs.name }}
11
+ - uses: actions/checkout@v2
12
+
13
+ - name: Fetch all history for all tags and branches
14
+ run: |
15
+ git fetch --prune --unshallow --tags
16
+ echo "REF: ${{ github.ref }}"
17
+
18
+ - name: Install GitVersion
19
+ uses: gittools/actions/gitversion/setup@v0.9.2
20
+ with:
21
+ versionSpec: "5.2.x"
22
+
23
+ - name: Execute GitVersion
24
+ id: gitversion
25
+ uses: gittools/actions/gitversion/execute@v0.9.2
26
+
27
+ - name: Version variables for unstable builds
28
+ id: unstable
29
+ if: startsWith(github.ref, 'refs/tags/') != true
30
+ env:
31
+ LABEL: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}.${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}
32
+ run: |
33
+ echo "Pre-release: ${LABEL}"
34
+ echo "::set-output name=label::${LABEL}"
35
+
36
+ - name: Create gem version number
37
+ id: gemversion
38
+ env:
39
+ GEM_VERSION: "${{ steps.gitversion.outputs.majorMinorPatch }}${{ steps.unstable.outputs.label }}"
40
+ run: |
41
+ echo "Gem version: ${GEM_VERSION}"
42
+ echo "::set-output name=version::${GEM_VERSION}"
43
+
44
+ - name: Set up Ruby 2.6
45
+ uses: actions/setup-ruby@v1
46
+ with:
47
+ ruby-version: 2.6.x
48
+
49
+ - name: Cache dependencies
50
+ uses: actions/cache@v1
51
+ with:
52
+ path: vendor/bundle
53
+ key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
54
+ restore-keys: ${{ runner.os }}-gems-
55
+
56
+ - name: Bundle install
57
+ run: |
58
+ gem install bundler
59
+ bundle config path vendor/bundle
60
+ bundle install --jobs 4 --retry 3
61
+
62
+ - name: Build gem
63
+ id: gem
64
+ env:
65
+ GEM_VERSION: ${{ steps.gemversion.outputs.version }}
66
+ run: |
67
+ GEM_BUILD_NAME=$(gem build jekyll-material-icon-tag.gemspec | awk '/File/ {print $2}')
68
+ echo "Gem filename: '${GEM_BUILD_NAME}'"
69
+ echo "::set-output name=name::${GEM_BUILD_NAME}"
70
+
71
+ - name: Test gem
72
+ run: |
73
+ bundle exec rake test
74
+
75
+ - name: Upload artifact
76
+ uses: actions/upload-artifact@v2-preview
77
+ with:
78
+ name: ${{ steps.gem.outputs.name }}
79
+ path: ${{ steps.gem.outputs.name }}
80
+
81
+ - name: Publish to GPR
82
+ env:
83
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84
+ OWNER: SwedbankPay
85
+ run: |
86
+ mkdir -p $HOME/.gem
87
+ touch $HOME/.gem/credentials
88
+ chmod 0600 $HOME/.gem/credentials
89
+ printf -- "---\n:github: Bearer ${GITHUB_TOKEN}\n" > $HOME/.gem/credentials
90
+ set -e
91
+ gem push --KEY github \
92
+ --host https://rubygems.pkg.github.com/${OWNER} \
93
+ ${{ steps.gem.outputs.name }} \
94
+ || echo "push failed ($?) probably due to version '${{ steps.gemversion.outputs.version }}' already existing in GPR."
95
+
96
+ - name: Publish to RubyGems
97
+ if: startsWith(github.ref, 'refs/tags/') # Only publish tagged commits
98
+ env:
99
+ RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
100
+ run: |
101
+ mkdir -p $HOME/.gem
102
+ touch $HOME/.gem/credentials
103
+ chmod 0600 $HOME/.gem/credentials
104
+ printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
105
+ gem push ${{ steps.gem.outputs.name }}
data/.gitignore CHANGED
@@ -9,3 +9,6 @@
9
9
  bin/
10
10
  *.gem
11
11
  /Gemfile.lock
12
+ .jekyll-cache/
13
+ _site/
14
+ vendor/
data/Gemfile CHANGED
@@ -5,3 +5,7 @@ gemspec
5
5
 
6
6
  gem "rake", "~> 12.0"
7
7
  gem "liquid", "~> 4.0"
8
+
9
+ gem 'jekyll', '~> 4.0', group: :jekyll_plugins
10
+ # Neccessary to prevent Jekyll errors. See https://github.com/github/personal-website/issues/166
11
+ gem 'faraday', '~> 1.0.1'
data/README.md CHANGED
@@ -7,12 +7,15 @@ gem 'jekyll-material-icon-tag'
7
7
  ```
8
8
 
9
9
  And then execute:
10
+
10
11
  ```shell
11
- $ bundle install
12
+ bundle install
12
13
  ```
14
+
13
15
  Or install it yourself as:
16
+
14
17
  ```shell
15
- $ gem install jekyll-material-icon-tag
18
+ gem install jekyll-material-icon-tag
16
19
  ```
17
20
 
18
21
  ## Usage
@@ -25,9 +28,17 @@ To render a Material Design Icon use as follows:
25
28
  {% icon name_of_icon_you_want %}
26
29
  ```
27
30
 
31
+ You can also add style if you want a different material icon style:
32
+
33
+ ```liquid
34
+ {% icon name_of_icon_you_want two-tone %}
35
+ {% icon another_icon_perhaps round %}
36
+ {% icon the_outlined_one outlined %}
37
+ ```
38
+
28
39
  ## Contributing
29
40
 
30
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jekyll-material-icon-tag. 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-material-icon-tag/blob/master/CODE_OF_CONDUCT.md).
41
+ Bug reports and pull requests are welcome on GitHub at <https://github.com/SwedbankPay/jekyll-material-icon-tag. 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/SwedbankPay/jekyll-material-icon-tag/blob/master/CODE_OF_CONDUCT.md).
31
42
 
32
43
  ## License
33
44
 
data/Rakefile CHANGED
@@ -1,2 +1,49 @@
1
- require "bundler/gem_tasks"
2
- task :default => :spec
1
+ # coding: utf-8
2
+ require 'jekyll'
3
+
4
+ # Extend string to allow for bold text.
5
+ class String
6
+ def bold
7
+ "\033[1m#{self}\033[0m"
8
+ end
9
+ end
10
+
11
+ # Rake Jekyll tasks
12
+ task :build do
13
+ conf = Jekyll.configuration({
14
+ 'source' => 'test/jekyll-material-icon-tag',
15
+ 'destination' => './_site/',
16
+ 'verbose' => false,
17
+ 'quiet' => true
18
+ })
19
+ puts 'Building site...'.bold
20
+ Jekyll::Commands::Build.process(conf)
21
+ end
22
+
23
+ task :clean do
24
+ puts 'Cleaning up _site...'.bold
25
+ Jekyll::Commands::Clean.process({})
26
+ end
27
+
28
+ # Test generated output has valid HTML and links.
29
+ task :test => :build do
30
+ File.open("_site/index.html") do |file|
31
+ content = file.read
32
+
33
+ if content.include? "{% icon"
34
+ raise "Hell"
35
+ end
36
+
37
+ unless content.include? "material-icons-two-tone"
38
+ raise "Hell of two tones"
39
+ end
40
+
41
+ unless content.include? "material-icons-two-tone"
42
+ raise "Hell of two tones"
43
+ end
44
+
45
+ file.close
46
+ end
47
+ end
48
+
49
+ task :default => ["build"]
@@ -8,7 +8,18 @@ class IconTag < Liquid::Tag
8
8
  end
9
9
 
10
10
  def render(_)
11
- "<i class=\"material-icons\">#{@text.strip}</i>"
11
+ iconname, type = parse_parameters @text
12
+
13
+ if type.nil?
14
+ "<i class=\"material-icons\">#{iconname.strip}</i>"
15
+ else
16
+ "<i class=\"material-icons-#{type.strip}\">#{iconname.strip}</i>"
17
+ end
18
+ end
19
+
20
+ def parse_parameters(text)
21
+ text.strip!
22
+ text.split(/\s+/)
12
23
  end
13
24
 
14
25
  Liquid::Template.register_tag "icon", self
@@ -1,3 +1,4 @@
1
1
  module JekyllMaterialIconTag
2
- VERSION = "1.0.4"
3
- end
2
+ @version = ENV['GEM_VERSION'] || '0.0.1-INVALID'
3
+ VERSION = @version
4
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-material-icon-tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nullint
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-03 00:00:00.000000000 Z
11
+ date: 2020-05-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: