bridgetown-minify-html 1.0.1 → 2.0.0.beta1

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: a51a96aaeb804c2c6309548b193dc75d9a038ec5cc4c109efb9306ccfd13f5b8
4
- data.tar.gz: 0daecbe4382876605b38a6de66c26a77561a733180a1036a840d2cf977e94e71
3
+ metadata.gz: 8d5cafe8da5e5446eff77b983e5510729b8ac8bf7cc92b803ca36965788af160
4
+ data.tar.gz: 8a46015830d35dee9bdfaf5df9eb479008961fee97085b723de7cf7e5cfa572b
5
5
  SHA512:
6
- metadata.gz: 7a364d7d18fb1c3696b7700a989338df1c43fc96dcfd42a1ea3531ebc1e54ed04693e546a7668dc8f68eda103f45a1cd581864e52e0303cb4c49b0ca3ca13211
7
- data.tar.gz: 704763e1938e69c0801a160f6e56349ef86762f1e2e6d17ddab82586810af7a27a3df05653e63c841ee9c318bff767c1de9cabe659f9ff071ce6775f5605edb3
6
+ metadata.gz: aa26f8c0e5ba918e2abc1a949f66851154a759687ff664d8b247c120d8ce034db2b8978e07fff7cd6e2e8ac03f4b66e4434a5711f7490250235d9b4718ad644c
7
+ data.tar.gz: 3e60282940f5e72f3dfe6276daec65887bacb0f36face06147dc75a9cfb5ee1d8b5d96821581e226abfb7706548fb1937f465caca9400fb576d0091f2b932aa8
@@ -0,0 +1,43 @@
1
+ name: Release
2
+
3
+ env:
4
+ BRIDGETOWN_VERSION: 1.0.0.beta2
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - main
10
+ jobs:
11
+ release-please:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: GoogleCloudPlatform/release-please-action@v3
15
+ id: release
16
+ with:
17
+ token: ${{ secrets.GITHUB_TOKEN }}
18
+ release-type: ruby
19
+ package-name: bridgetown-minify-html
20
+ bump-minor-pre-major: true
21
+ version-file: "lib/bridgetown-minify-html/version.rb"
22
+ - uses: actions/checkout@v2
23
+ if: ${{ steps.release.outputs.release_created }}
24
+ - uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: 3.0.0
27
+ if: ${{ steps.release.outputs.release_created }}
28
+ - run: |
29
+ gem install bundler -v 2.2.16
30
+ bundle install
31
+ bundle exec rake
32
+ if: ${{ steps.release.outputs.release_created }}
33
+ - name: release gem
34
+ run: |
35
+ mkdir -p $HOME/.gem
36
+ touch $HOME/.gem/credentials
37
+ chmod 0600 $HOME/.gem/credentials
38
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
39
+ gem build *.gemspec
40
+ gem push *.gem
41
+ env:
42
+ GEM_HOST_API_KEY: "${{secrets.GEM_HOST_API_KEY}}"
43
+ if: ${{ steps.release.outputs.release_created }}
@@ -1,9 +1,12 @@
1
1
  ---
2
2
  name: RSpec
3
3
 
4
+ env:
5
+ BRIDGETOWN_VERSION: 1.0.0.beta2
6
+
4
7
  on:
5
8
  push:
6
- branches: [ master ]
9
+ branches: [ main ]
7
10
  pull_request:
8
11
 
9
12
  jobs:
@@ -11,7 +14,7 @@ jobs:
11
14
  strategy:
12
15
  fail-fast: false
13
16
  matrix:
14
- ruby: [2.6, 2.7, head]
17
+ ruby: [2.7, 3.0, head]
15
18
  runs-on: ubuntu-latest
16
19
  name: Test against Ruby ${{ matrix.ruby }}
17
20
 
@@ -20,18 +23,7 @@ jobs:
20
23
  - uses: ruby/setup-ruby@v1
21
24
  with:
22
25
  ruby-version: ${{ matrix.ruby }}
23
- - name: Cache gems
24
- uses: actions/cache@v2.1.2
25
- with:
26
- path: vendor/bundle
27
- key: ${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
28
- restore-keys: |
29
- ${{ runner.os }}-ruby-${{ matrix.ruby }}
30
- - name: Install Gems
31
- run: |
32
- gem install bundler
33
- bundle config path vendor/bundle
34
- bundle install --jobs 4 --retry 3
26
+ bundler-cache: true
35
27
  - name: Run tests
36
28
  run: |
37
29
  bundle exec rake spec
@@ -3,7 +3,7 @@ name: RuboCop
3
3
  on:
4
4
  push:
5
5
  branches:
6
- - master
6
+ - main
7
7
  pull_request:
8
8
  jobs:
9
9
  build:
@@ -11,20 +11,10 @@ jobs:
11
11
 
12
12
  steps:
13
13
  - uses: actions/checkout@v2
14
- - name: Set up Ruby 2.7
14
+ - name: Set up Ruby 3.0
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
17
- ruby-version: 2.7
18
- - name: Cache gems
19
- uses: actions/cache@v2.1.1
20
- with:
21
- path: vendor/bundle
22
- key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}
23
- restore-keys: |
24
- ${{ runner.os }}-rubocop-
25
- - name: Install gems
26
- run: |
27
- bundle config path vendor/bundle
28
- bundle install --jobs 4 --retry 3
17
+ ruby-version: 3.0
18
+ bundler-cache: true
29
19
  - name: Run RuboCop
30
20
  run: bundle exec rubocop --parallel
data/CHANGELOG.md CHANGED
@@ -1,8 +1,28 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased](https://github.com/bt-rb/bridgetown-minify-html/tree/HEAD)
3
+ ## [2.0.0.beta1](https://github.com/bt-rb/bridgetown-minify-html/compare/v1.0.1...v2.0.0.beta1) (2022-01-28)
4
4
 
5
- [Full Changelog](https://github.com/bt-rb/bridgetown-minify-html/compare/v1.0.0...HEAD)
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * Upgrade to account for changes to @site.pages and @site.documents (#25)
9
+
10
+ ### Bug Fixes
11
+
12
+ * Changelog was pushing to main not master ([#19](https://github.com/bt-rb/bridgetown-minify-html/issues/19)) ([5483b12](https://github.com/bt-rb/bridgetown-minify-html/commit/5483b1250b3c0035600ed8a3bab6d7512cc17a97))
13
+ * set required reuby version to >= 2.7 ([7171051](https://github.com/bt-rb/bridgetown-minify-html/commit/717105125bad53f0b574044cdda81d2ffa96038d))
14
+ * Upgrade to account for changes to [@site](https://github.com/site).pages and [@site](https://github.com/site).documents ([#25](https://github.com/bt-rb/bridgetown-minify-html/issues/25)) ([ed63a53](https://github.com/bt-rb/bridgetown-minify-html/commit/ed63a53686abc0b15298d6d84f70cfeff67e9287))
15
+
16
+ ### Legacy
17
+
18
+ - Adjust Readme to center title & subtitle [\#23](https://github.com/bt-rb/bridgetown-minify-html/pull/23) ([MikeRogers0](https://github.com/MikeRogers0))
19
+ - Adding GitHub Action to autorelease when GitHub changes [\#22](https://github.com/bt-rb/bridgetown-minify-html/pull/22) ([MikeRogers0](https://github.com/MikeRogers0))
20
+ - Adding support for Ruby 3.0 [\#20](https://github.com/bt-rb/bridgetown-minify-html/pull/20) ([MikeRogers0](https://github.com/MikeRogers0))
21
+ - Fix: Changelog was pushing to main not master [\#19](https://github.com/bt-rb/bridgetown-minify-html/pull/19) ([MikeRogers0](https://github.com/MikeRogers0))
22
+
23
+ ## [v1.0.1](https://github.com/bt-rb/bridgetown-minify-html/tree/v1.0.1) (2020-12-02)
24
+
25
+ [Full Changelog](https://github.com/bt-rb/bridgetown-minify-html/compare/v1.0.0...v1.0.1)
6
26
 
7
27
  **Merged pull requests:**
8
28
 
@@ -28,10 +48,6 @@
28
48
 
29
49
  [Full Changelog](https://github.com/bt-rb/bridgetown-minify-html/compare/v0.1.0...v0.2.0)
30
50
 
31
- **Implemented enhancements:**
32
-
33
- - Preparing for 0.1.0 release [\#3](https://github.com/bt-rb/bridgetown-minify-html/pull/3) ([MikeRogers0](https://github.com/MikeRogers0))
34
-
35
51
  **Fixed bugs:**
36
52
 
37
53
  - bug: undefined local variable or method extension [\#8](https://github.com/bt-rb/bridgetown-minify-html/pull/8) ([MikeRogers0](https://github.com/MikeRogers0))
@@ -49,6 +65,10 @@
49
65
 
50
66
  [Full Changelog](https://github.com/bt-rb/bridgetown-minify-html/compare/5ce9f22631f178ecf164501e7d28d6dee902ce9c...v0.1.0)
51
67
 
68
+ **Implemented enhancements:**
69
+
70
+ - Preparing for 0.1.0 release [\#3](https://github.com/bt-rb/bridgetown-minify-html/pull/3) ([MikeRogers0](https://github.com/MikeRogers0))
71
+
52
72
 
53
73
 
54
74
  \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/CODE_OF_CONDUCT.md CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
  ## Enforcement
56
56
 
57
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at me@mikerogers.io. All
58
+ reported by contacting the project team at support@andrewm.codes. All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
61
  obligated to maintain confidentiality with regard to the reporter of an incident.
data/Gemfile CHANGED
@@ -4,3 +4,8 @@ source "https://rubygems.org"
4
4
  gemspec
5
5
 
6
6
  gem "bridgetown", ENV["BRIDGETOWN_VERSION"] if ENV["BRIDGETOWN_VERSION"]
7
+
8
+ group :development, :test do
9
+ gem "github_changelog_generator", "~> 1.15.2"
10
+ gem "rubocop", "~> 0.81.0"
11
+ end
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 Mike Rogers
3
+ Copyright (c) 2022 Andrew Mason
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,11 +1,22 @@
1
- [![Twitter Follow](https://img.shields.io/twitter/follow/MikeRogers0?label=Follow%20%40MikeRogers0%20For%20Updates&style=social)](https://twitter.com/MikeRogers0)
2
- ![RSpec](https://github.com/bt-rb/bridgetown-minify-html/workflows/RSpec/badge.svg)
3
- ![RuboCop](https://github.com/bt-rb/bridgetown-minify-html/workflows/RuboCop/badge.svg)
4
- [![Gem Version](https://badge.fury.io/rb/bridgetown-minify-html.svg)](https://badge.fury.io/rb/bridgetown-minify-html)
1
+ <h1 align="center">
2
+ Bridgetown Minify HTML
3
+ </h1>
5
4
 
6
- # Bridgetown Minify HTML
5
+ <p align="center">
6
+ <a target="_blank" rel="noopener noreferrer" href="https://badge.fury.io/rb/bridgetown-minify-html">
7
+ <img src="https://badge.fury.io/rb/bridgetown-minify-html.svg" alt="Gem Version" style="max-width:100%;">
8
+ </a>
9
+ <a target="_blank" rel="noopener noreferrer" href="https://github.com/bt-rb/bridgetown-minify-html/workflows/RSpec/badge.svg">
10
+ <img src="https://github.com/bt-rb/bridgetown-minify-html/workflows/RSpec/badge.svg" alt="RSpec" style="max-width:100%;">
11
+ </a>
12
+ <a target="_blank" rel="noopener noreferrer" href="https://github.com/bt-rb/bridgetown-minify-html/workflows/RuboCop/badge.svg">
13
+ <img src="https://github.com/bt-rb/bridgetown-minify-html/workflows/RuboCop/badge.svg" alt="RuboCop" style="max-width:100%;">
14
+ </a>
15
+ </p>
7
16
 
8
- A Bridgetown plugin to Minify your outputted HTML.
17
+ <p align="center">
18
+ A Bridgetown plugin to Minify your outputted HTML.
19
+ </p>
9
20
 
10
21
  ## Installation
11
22
 
@@ -58,3 +69,7 @@ minify_html:
58
69
  4. Commit your changes (`git commit -am 'Add some feature'`)
59
70
  5. Push to the branch (`git push origin my-new-feature`)
60
71
  6. Create a new Pull Request
72
+
73
+ ## 💌 In Loving Memory of Mike Rogers
74
+
75
+ [Mike Rogers](https://github.com/MikeRogers0) was the creator of `bridgetown-minify-html` and participated in the project from July 2020 until his passing in November 2021. This project is maintained by [@andrewmcodes](https://github.com/andrewmcodes) in his honor. You can find Mike's obituary [here if you'd like to leave a message.](https://www.mykeeper.com/profile/MikeRogers/)
@@ -5,26 +5,25 @@ require_relative "lib/bridgetown-minify-html/version"
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "bridgetown-minify-html"
7
7
  spec.version = BridgetownMinifyHtml::VERSION
8
- spec.author = "Mike Rogers"
9
- spec.email = "me@mikerogers.io"
8
+ spec.authors = ["Mike Rogers", "Andrew Mason"]
9
+ spec.email = "support@andrewm.codes"
10
10
  spec.summary = "Minify Outputted HTML in Bridgetown"
11
11
  spec.homepage = "https://github.com/bt-rb/bridgetown-minify-html"
12
12
  spec.license = "MIT"
13
13
 
14
14
  spec.metadata = {
15
15
  'bug_tracker_uri' => "#{spec.homepage}/issues",
16
- 'changelog_uri' => "#{spec.homepage}/blob/master/CHANGELOG.md",
16
+ "changelog_uri" => "#{spec.homepage}/blob/main/CHANGELOG.md",
17
17
  'documentation_uri' => spec.homepage,
18
18
  'homepage_uri' => spec.homepage,
19
- 'source_code_uri' => spec.homepage,
20
- 'funding_uri' => 'https://www.buymeacoffee.com/MikeRogers0'
19
+ "source_code_uri" => spec.homepage
21
20
  }
22
21
 
23
22
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|script|spec|features|frontend)/!) }
24
23
  spec.test_files = spec.files.grep(%r!^spec/!)
25
24
  spec.require_paths = ["lib"]
26
25
 
27
- spec.required_ruby_version = ">= 2.6"
26
+ spec.required_ruby_version = ">= 2.7"
28
27
 
29
28
  spec.add_dependency "bridgetown", ">= 0.15", "< 2.0"
30
29
  spec.add_dependency "htmlcompressor", ">= 0.4", "< 1.0"
@@ -31,7 +31,7 @@ module BridgetownMinifyHtml
31
31
  end
32
32
 
33
33
  def call!
34
- (@site.pages + @site.documents).each do |page|
34
+ @site.resources.each do |page|
35
35
  minify_page(page)
36
36
  end
37
37
 
@@ -41,14 +41,15 @@ module BridgetownMinifyHtml
41
41
  private
42
42
 
43
43
  def minify_page(page)
44
- return unless compressible?(page)
44
+ return unless compressible?(page.destination)
45
45
 
46
46
  page.output = compressor.compress(page.output)
47
47
  @minified_count += 1
48
48
  end
49
49
 
50
- def compressible?(page)
51
- page.respond_to?(:output_ext) && [".html", ".svg", ".xml"].include?(page.output_ext)
50
+ def compressible?(destination)
51
+ destination.respond_to?(:output_ext) &&
52
+ [".html", ".svg", ".xml"].include?(destination.output_ext)
52
53
  end
53
54
 
54
55
  def compressor
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgetownMinifyHtml
4
- VERSION = "1.0.1"
4
+ VERSION = "2.0.0.beta1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-minify-html
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Rogers
8
- autorequire:
8
+ - Andrew Mason
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2020-12-02 00:00:00.000000000 Z
12
+ date: 2022-01-28 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bridgetown
@@ -120,19 +121,15 @@ dependencies:
120
121
  - - "~>"
121
122
  - !ruby/object:Gem::Version
122
123
  version: '0.2'
123
- description:
124
- email: me@mikerogers.io
124
+ description:
125
+ email: support@andrewm.codes
125
126
  executables: []
126
127
  extensions: []
127
128
  extra_rdoc_files: []
128
129
  files:
129
- - ".github/FUNDING.yml"
130
- - ".github/dependabot.yml"
131
- - ".github/workflows/changelog.yml"
132
- - ".github/workflows/gempush.yml"
130
+ - ".github/workflows/release.yml"
133
131
  - ".github/workflows/rspec.yml"
134
132
  - ".github/workflows/rubocop.yml"
135
- - ".github/workflows/spelling.yml"
136
133
  - ".gitignore"
137
134
  - ".rspec"
138
135
  - ".rubocop.yml"
@@ -152,12 +149,11 @@ licenses:
152
149
  - MIT
153
150
  metadata:
154
151
  bug_tracker_uri: https://github.com/bt-rb/bridgetown-minify-html/issues
155
- changelog_uri: https://github.com/bt-rb/bridgetown-minify-html/blob/master/CHANGELOG.md
152
+ changelog_uri: https://github.com/bt-rb/bridgetown-minify-html/blob/main/CHANGELOG.md
156
153
  documentation_uri: https://github.com/bt-rb/bridgetown-minify-html
157
154
  homepage_uri: https://github.com/bt-rb/bridgetown-minify-html
158
155
  source_code_uri: https://github.com/bt-rb/bridgetown-minify-html
159
- funding_uri: https://www.buymeacoffee.com/MikeRogers0
160
- post_install_message:
156
+ post_install_message:
161
157
  rdoc_options: []
162
158
  require_paths:
163
159
  - lib
@@ -165,15 +161,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
165
161
  requirements:
166
162
  - - ">="
167
163
  - !ruby/object:Gem::Version
168
- version: '2.6'
164
+ version: '2.7'
169
165
  required_rubygems_version: !ruby/object:Gem::Requirement
170
166
  requirements:
171
- - - ">="
167
+ - - ">"
172
168
  - !ruby/object:Gem::Version
173
- version: '0'
169
+ version: 1.3.1
174
170
  requirements: []
175
- rubygems_version: 3.1.4
176
- signing_key:
171
+ rubygems_version: 3.2.3
172
+ signing_key:
177
173
  specification_version: 4
178
174
  summary: Minify Outputted HTML in Bridgetown
179
175
  test_files: []
data/.github/FUNDING.yml DELETED
@@ -1,2 +0,0 @@
1
- github: MikeRogers0
2
- custom: ["https://www.buymeacoffee.com/MikeRogers0", "https://mikerogers.io/"]
@@ -1,15 +0,0 @@
1
- version: 2
2
-
3
- updates:
4
-
5
- # Maintain dependencies for GitHub Actions
6
- - package-ecosystem: "github-actions"
7
- directory: "/"
8
- schedule:
9
- interval: "daily"
10
-
11
- # Maintain dependencies for Bundler
12
- - package-ecosystem: "bundler"
13
- directory: "/"
14
- schedule:
15
- interval: "daily"
@@ -1,40 +0,0 @@
1
- # From: https://github.com/hopsoft/stimulus_reflex/blob/master/.github/workflows/changelog.yml
2
- name: Changelog
3
-
4
- on:
5
- release:
6
- types: [created]
7
- push:
8
- branches:
9
- - master
10
-
11
- jobs:
12
- build:
13
- runs-on: ubuntu-latest
14
- timeout-minutes: 4
15
- if: "!contains(github.event.head_commit.message, '[nodoc]')"
16
- steps:
17
- - uses: actions/checkout@master
18
- - name: Set up Ruby 2.7
19
- uses: ruby/setup-ruby@v1
20
- with:
21
- ruby-version: 2.7.1
22
- - uses: actions/cache@v2
23
- with:
24
- path: vendor/bundle
25
- key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
26
- restore-keys: |
27
- ${{ runner.os }}-gem-
28
- - name: Create local changes
29
- run: |
30
- gem install github_changelog_generator
31
- github_changelog_generator -u bt-rb -p bridgetown-minify-html --token ${{ secrets.GITHUB_TOKEN }} --exclude-labels duplicate,question,invalid,wontfix,nodoc
32
- - name: Commit files
33
- run: |
34
- git config --local user.email "github-actions@example.com"
35
- git config --local user.name "GitHub Actions"
36
- git commit -am "[nodoc] Update Changelog" || echo "No changes to commit"
37
- - name: Push changes
38
- uses: ad-m/github-push-action@master
39
- with:
40
- github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -1,18 +0,0 @@
1
- name: Build & Publish Ruby Gem
2
-
3
- on:
4
- release:
5
- types: [created]
6
-
7
- jobs:
8
- build:
9
- name: Build + Publish
10
- runs-on: ubuntu-latest
11
-
12
- steps:
13
- - uses: actions/checkout@v2
14
- - name: Publish to GitHub Packages
15
- uses: jstastny/publish-gem-to-github@master
16
- with:
17
- token: ${{ secrets.GITHUB_TOKEN }}
18
- owner: MikeRogers0
@@ -1,22 +0,0 @@
1
- name: Typo CI
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
- jobs:
9
- spellcheck:
10
- name: Typo CI (GitHub Action)
11
- runs-on: ubuntu-latest
12
- timeout-minutes: 4
13
- if: "!contains(github.event.head_commit.message, '[ci skip]')"
14
- steps:
15
- - name: TypoCheck
16
- uses: typoci/spellcheck-action@master
17
- # with:
18
- # A license can be purchased via:
19
- # https://gumroad.com/l/MvvBE
20
- # typo_ci_license_key: ${{ secrets.TYPO_CI_LICENSE_KEY }}
21
- env:
22
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}