From e3c28228102ed68915473550bcd0accc28387166 Mon Sep 17 00:00:00 2001 From: Zach Gianos Date: Mon, 31 Jan 2022 05:43:56 -1000 Subject: [PATCH] ci/lib: verify gem builds; require from `handlebars-engine` - `ci`: verify gem builds - `require`: allow loading from `handlebars-engine` and `handlebars/engine` - updates changelog --- .github/workflows/ci.yml | 17 +++++++++++++++-- .rubocop.yml | 4 ++++ CHANGELOG.md | 9 +++++++++ bin/{handlebars-engine => handlebars} | 4 ++-- lib/handlebars-engine.rb | 3 +++ 5 files changed, 33 insertions(+), 4 deletions(-) rename bin/{handlebars-engine => handlebars} (83%) create mode 100644 lib/handlebars-engine.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f50f307..36c376e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,19 @@ on: - main jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install + uses: ruby/setup-ruby@v1 + with: + ruby-version: ruby-3 + bundler-cache: true + - name: Build + run: bin/build + coverage: runs-on: ubuntu-latest steps: @@ -41,7 +54,7 @@ jobs: ruby-version: ruby-3 bundler-cache: true - name: Lint - run: bundle exec rubocop + run: bin/lint test: strategy: @@ -66,4 +79,4 @@ jobs: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Test - run: bundle exec rake + run: bin/rake diff --git a/.rubocop.yml b/.rubocop.yml index c729315..844488a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -138,6 +138,10 @@ Metrics/ModuleLength: Metrics/ParameterLists: Max: 10 +Naming/FileName: + Exclude: + - lib/handlebars-engine.rb + RSpec/ExampleLength: CountAsOne: - array diff --git a/CHANGELOG.md b/CHANGELOG.md index 2600786..c9f795c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- `initialize`: add path parameter ([#5](https://github.com/gi/handlebars-ruby/pull/5)) +- `register_helper`: accept multiple helpers as keyword parameters ([#6](https://github.com/gi/handlebars-ruby/pull/6)) +- `register_helper`: accept javascript function as string ([#7](https://github.com/gi/handlebars-ruby/pull/7)) +- `ci`: verify gem builds ([#8](https://github.com/gi/handlebars-ruby/pull/8)) +- `require`: allow loading from `handlebars-engine` and `handlebars/engine` ([#8](https://github.com/gi/handlebars-ruby/pull/8)) + +### Changed + ## [0.2.0] - 2022-01-27 This is the initial implementation, wrapping the JavaScript Handlebars. diff --git a/bin/handlebars-engine b/bin/handlebars similarity index 83% rename from bin/handlebars-engine rename to bin/handlebars index 2ef7d45..54f14f3 100755 --- a/bin/handlebars-engine +++ b/bin/handlebars @@ -4,7 +4,7 @@ # # This file was generated by Bundler. # -# The application 'handlebars-engine' is installed as part of a gem, and +# The application 'handlebars' is installed as part of a gem, and # this file is here to facilitate running it. # @@ -26,4 +26,4 @@ end require "rubygems" require "bundler/setup" -load Gem.bin_path("handlebars-engine", "handlebars-engine") +load Gem.bin_path("handlebars-engine", "handlebars") diff --git a/lib/handlebars-engine.rb b/lib/handlebars-engine.rb new file mode 100644 index 0000000..b5539a8 --- /dev/null +++ b/lib/handlebars-engine.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +require "handlebars/engine"