From c60324542c68a83d491c7a3f28fcabdc95e07fb6 Mon Sep 17 00:00:00 2001 From: MariaJosefinaAlliende Date: Fri, 27 Jan 2023 12:15:44 -0300 Subject: [PATCH 1/2] fix(ruby-3): fix date and datetime formatters for ruby 3 --- .ruby-version | 2 +- Gemfile.lock | 24 +++++++++++++++++---- lib/human_attributes/formatters/date.rb | 2 +- lib/human_attributes/formatters/datetime.rb | 2 +- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.ruby-version b/.ruby-version index 1effb00..ef538c2 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7 +3.1.2 diff --git a/Gemfile.lock b/Gemfile.lock index 9f1509b..162678f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - human_attributes (0.7.1) + human_attributes (0.7.2) factory_bot rails (>= 4.2.0) @@ -82,6 +82,7 @@ GEM thor (>= 0.19.4, < 2.0) tins (~> 1.6) crass (1.0.6) + date (3.3.3) diff-lcs (1.4.4) docile (1.4.0) draper (4.0.2) @@ -98,7 +99,7 @@ GEM activesupport (>= 5.0.0) ffi (1.15.1) formatador (0.2.5) - globalid (1.0.0) + globalid (1.0.1) activesupport (>= 5.0) guard (2.17.0) formatador (>= 0.2.4) @@ -124,15 +125,28 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.2.8) - mail (2.7.1) + mail (2.8.0.1) mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp marcel (1.0.2) method_source (1.0.0) mini_mime (1.0.3) minitest (5.14.4) nenv (0.3.0) + net-imap (0.3.4) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-smtp (0.3.3) + net-protocol nio4r (2.5.8) - nokogiri (1.11.7-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.14.0-x86_64-darwin) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) @@ -242,6 +256,7 @@ GEM term-ansicolor (1.7.1) tins (~> 1.0) thor (1.1.0) + timeout (0.3.1) tins (1.29.1) sync tzinfo (2.0.4) @@ -253,6 +268,7 @@ GEM zeitwerk (2.4.2) PLATFORMS + x86_64-darwin-19 x86_64-darwin-20 DEPENDENCIES diff --git a/lib/human_attributes/formatters/date.rb b/lib/human_attributes/formatters/date.rb index 77ac41f..8b93d4f 100644 --- a/lib/human_attributes/formatters/date.rb +++ b/lib/human_attributes/formatters/date.rb @@ -2,7 +2,7 @@ module HumanAttributes module Formatters class Date < Base def apply(_instance, value) - I18n.l(value.to_date, options) + I18n.l(value.to_date, **options) rescue nil end diff --git a/lib/human_attributes/formatters/datetime.rb b/lib/human_attributes/formatters/datetime.rb index 2ce1d09..a3d2b6a 100644 --- a/lib/human_attributes/formatters/datetime.rb +++ b/lib/human_attributes/formatters/datetime.rb @@ -2,7 +2,7 @@ module HumanAttributes module Formatters class Datetime < Base def apply(_instance, value) - I18n.l(value.to_datetime, options) + I18n.l(value.to_datetime, **options) rescue nil end From d44a17f106ad2afcb386c08f97876b100c414731 Mon Sep 17 00:00:00 2001 From: MariaJosefinaAlliende Date: Mon, 6 Feb 2023 14:33:06 -0300 Subject: [PATCH 2/2] Releasing v1.0.0 --- .circleci/config.yml | 6 +++--- CHANGELOG.md | 13 +++++++++++-- lib/human_attributes/version.rb | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9a0c165..a3d2720 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ executors: default: "2.7" type: string docker: - - image: circleci/ruby:<>-node + - image: cimg/ruby:<>-node environment: *env-vars commands: @@ -94,11 +94,11 @@ workflows: - test: matrix: parameters: - ruby-version: ["2.5", "2.6", "2.7"] + ruby-version: ["2.7", "3.1" ] - deploy: context: org-global filters: tags: only: /.*/ branches: - ignore: /.*/ \ No newline at end of file + ignore: /.*/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d05390..4c69656 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,21 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -# 0.7.0 +### 1.0.0 +##### Removed + +* Removed support for ruby 2.5 and 2.6 + +##### Fixed + +* Fix enum translations for ruby 3.1 + +### 0.7.1 ##### Fixed * Fix enum translations: move translations under pluralized attribute key. -# 0.7.0 +### 0.7.0 ##### Changed * Replace travis with circleci. diff --git a/lib/human_attributes/version.rb b/lib/human_attributes/version.rb index 4acfcc1..3e0aca1 100644 --- a/lib/human_attributes/version.rb +++ b/lib/human_attributes/version.rb @@ -1,3 +1,3 @@ module HumanAttributes - VERSION = "0.7.1" + VERSION = "1.0.0" end