Skip to content

Commit

Permalink
tidy up in preparation for release
Browse files Browse the repository at this point in the history
  • Loading branch information
robkilby committed Sep 6, 2023
1 parent 6377c94 commit 260ed53
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 27 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
name: CI

on:
- push

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
ruby-version: ['3.2', '3.1', '3.0']

steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
- uses: actions/checkout@v4

- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Run tests
run: bundle exec rspec

- name: Code Coverage
uses: paambaati/codeclimate-action@v5.0.0
uses: paambaati/codeclimate-action@v5
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${{github.workspace}}/coverage/.coverage.json:simplecov
publish:
needs: test
if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/build-')
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Publish to RubyGems
run: |
Expand All @@ -39,4 +48,4 @@ jobs:
gem build yaml_normalizer.gemspec
gem push yaml_normalizer-*.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}"
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.0
3.2.2
51 changes: 41 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,91 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Added

### Changed

### Removed

## [2.0.0.rc1] - 2023-08-14
## [2.0.0] - 2023-09-06

### Added

- Tests now run against Ruby 3.0, 3.1, and 3.2

### Changed
- Update Ruby version to 3.2

- Update minimum Ruby version to v3.0
- Relaxed version constraint on Rake
- Set minimum Psych version to v5

## [1.2.0] - 2019-08-08

### Added

- Versioning and help messages for CLI

### Changed

- Extended allowed line length to 120
- Change the mutant to only scan the latest commits


## [1.1.0] - 2019-05-21

### Added

- Add rubocop-performance gem

### Changed

- Update Ruby version to 2.5
- Reduce average code complexity threshold to 6.3
- Use thread safe output in peach blocks
- Only require `pathname` when used


## [1.0.1] - 2018-05-04

### Changed
- Specify executables in Gemspec

- Specify executables in Gemspec

## [1.0.0] - 2018-05-04

### Added

- Add .ruby-version file to improve development experience
- Add gem version badge to README
- Add pry-doc
- Add helper method to retrieve relative path for a file
- Add executable "yaml_check" to check normalization of YAML files

### Changed

- Clean up README
- Rename executable to normalize YAML files to "yaml_normalize"
- Lower average complexity threshold to 6.5

### Removed

- Remove parallel_tests
- Remove console and setup executables
- Remove bundler/gem_tasks


## [0.3.0] - 2018-03-26

### Added

- Add YamlNormalizer::Ext::Nested to generate nested hash from namespaces key-value pairs
- Add Codeclimate integration https://codeclimate.com/github/Sage/yaml_normalizer/

### Changed

- Change flog method to :average, set threshold to 7.7
- Reset default_proc before returning to app code
- Open-source Yaml Normalizer at https://github.com/Sage/yaml_normalizer
Expand All @@ -75,39 +96,47 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Support sorting keys of different types

### Removed
- Remove Coveralls.io integration

- Remove Coveralls.io integration

## [0.2.2] - 2017-06-23

### Added

- Add hint to run normalize task when check task fails

### Changed

- Fix check rake task's exit value
- Fix return when checking YAMLs
- Fix section "rake -t" in README.md
- Fix mutant output parsing

### Removed
- Stop requiring simplecov when running mutation tests

- Stop requiring simplecov when running mutation tests

## [0.2.1] - 2017-06-01

### Added

- CHANGELOG.md

### Changed
- Fix handling of UTF-8-encoded files using byte order mark

- Fix handling of UTF-8-encoded files using byte order mark

## [0.2.0] - 2017-05-10

### Added

- Add file configuration to rake task
- Add YAML check service, including rake task
- Add ci_task helper methods
- Add more documentation and improve wording

### Changed

- Enable RSpec's verify_partial_doubles and disable_monkey_patching
- Change License to Apache-2.0
- Move CI helper methods to separate file
Expand All @@ -117,11 +146,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Make "rake ci" the default rake task

### Removed

- Remove flay
- Remove cane
- Remove Ruby refinements


## [0.1.0] - 2017-04-07

### Added

- Minimal initial version of "YAML Normalizer", fmi see README.md
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

source 'https://rubygems.org'

ruby '~> 3.2'

gem 'simplecov', '0.21.2', require: false, group: :test
ruby '>= 3.0'

gemspec
3 changes: 1 addition & 2 deletions Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
# rspec may be run, below are examples of the most common uses.
# * bundler: 'bundle exec rspec'
# * bundler binstubs: 'bin/rspec'
# * spring: 'bin/rspec' (This will use spring if running and you have
# installed the spring binstubs per the docs)
# * spring: 'bin/rspec' (This will use spring if running and you have installed the spring binstubs per the docs)
# * zeus: 'zeus rspec' (requires the server to be started separately)
# * 'just' rspec: 'rspec'

Expand Down
2 changes: 1 addition & 1 deletion lib/yaml_normalizer/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

module YamlNormalizer
# The current Yaml Normalizer version
VERSION = '2.0.0.rc1'
VERSION = '2.0.0.rc2'
end
14 changes: 14 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,18 @@ def data_path
mocks.verify_partial_doubles = true
end
config.disable_monkey_patching!

original_stderr = $stderr
original_stdout = $stdout

config.before(:all) do
# Redirect stderr and stdout
$stderr = File.open(File::NULL, "w")
$stdout = File.open(File::NULL, "w")
end

config.after(:all) do
$stderr = original_stderr
$stdout = original_stdout
end
end
8 changes: 6 additions & 2 deletions yaml_normalizer.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'yaml_normalizer/version'

Gem::Specification.new do |spec|
spec.name = 'yaml_normalizer'
spec.version = YamlNormalizer::VERSION
spec.authors = ['Wolfgang Teuber', 'Jan Taras']
spec.email = ['jan.taras@sage.com']
spec.authors = ['The Sage Group plc']
spec.email = ['support@sageone.com']

spec.summary = 'Yaml Normalizer normalizes YAML files'
spec.description = "Yaml Normalizer follows the notion that there is
Expand All @@ -22,6 +23,8 @@ Gem::Specification.new do |spec|
spec.executables = %w[yaml_check yaml_normalize]
spec.require_paths = ['lib']

spec.required_ruby_version = '>= 3.0'

spec.add_dependency 'peach', '~> 0.5'
spec.add_dependency 'psych', '~> 5.0'
spec.add_dependency 'rake', '< 14.0'
Expand All @@ -43,5 +46,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rubocop-performance'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'yard'
end

0 comments on commit 260ed53

Please sign in to comment.