Skip to content

Commit

Permalink
Add Ruby 3.2/3.3 support and drop 2.6/2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeSouthan committed Jan 9, 2024
1 parent e867461 commit cadd9fd
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 33 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ name: tests

on:
push:
branches:
- "master"
pull_request:

jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -18,10 +21,10 @@ jobs:
tests:
strategy:
matrix:
ruby-version: [2.6, 2.7, 3.0, 3.1]
ruby-version: ["3.0", "3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ require:
- rubocop-rspec

AllCops:
NewCops: enable
Exclude:
- vendor/**/*
TargetRubyVersion: 3.1
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.2
3.3.0
27 changes: 16 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
# 6.0.0 - 2024-01-09

- Drop support for Ruby 2.6 and 2.7.
- Add support for Ruby 3.2 and 3.3.

# 5.0.0

* Ensure Prius#load raises an error when unexpected options are passed
- Ensure Prius#load raises an error when unexpected options are passed

# 4.1.0

* Add support for coercing to a date.
- Add support for coercing to a date.

# 4.0.0

* Add support for Ruby 3.0
* Enforce Ruby 2.6 as minimum required version
* Drop support for Ruby 2.2, 2.3, 2.4, 2.5
* Drop support for JRuby versions < 9.3.x (implicity enforced by C Ruby version 2.6 as minimum)
- Add support for Ruby 3.0
- Enforce Ruby 2.6 as minimum required version
- Drop support for Ruby 2.2, 2.3, 2.4, 2.5
- Drop support for JRuby versions < 9.3.x (implicity enforced by C Ruby version 2.6 as minimum)

# 3.0.0

* Enforce Ruby 2.2 as minimum required version
* Use CircleCI instead of Travis for CI builds
* Add Dependabot support
* Some development dependency updates
- Enforce Ruby 2.2 as minimum required version
- Use CircleCI instead of Travis for CI builds
- Add Dependabot support
- Some development dependency updates

# 2.0.0

* Drop support for Ruby versions 1.9, 2.0, 2.1, and add support for 2.3 and 2.4
- Drop support for Ruby versions 1.9, 2.0, 2.1, and add support for 2.3 and 2.4

# 1.0.0

Expand Down
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@
source "https://rubygems.org"

gemspec

group :development do
gem "gc_ruboconfig", "~> 4.4"
gem 'pry'
gem "rspec", "~> 3.12"
gem "rspec-github", "~> 2.4.0"
end
2 changes: 1 addition & 1 deletion lib/prius/registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize(env)

# See Prius.load for documentation.
def load(name, env_var: nil, type: :string, required: true)
env_var = env_var.nil? ? name.to_s.upcase : env_var
env_var = name.to_s.upcase if env_var.nil?
@registry[name] = case type
when :string then load_string(env_var, required)
when :int then load_int(env_var, required)
Expand Down
2 changes: 1 addition & 1 deletion lib/prius/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Prius
VERSION = "5.0.0"
VERSION = "6.0.0"
end
30 changes: 15 additions & 15 deletions prius.gemspec
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# coding: utf-8
# frozen_string_literal: true

require "English"

lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "prius/version"
require_relative "lib/prius/version"

Gem::Specification.new do |spec|
spec.name = "prius"
spec.version = Prius::VERSION
spec.authors = ["GoCardless Engineering"]
spec.email = ["[email protected]"]
spec.description = "Environmentally-friendly config"
spec.summary = spec.description
spec.summary = "Environmentally-friendly config. Validate and enforce the presence " \
"and correct types of environment variables."
spec.description = <<~MSG.strip.tr("\n", " ")
Prius is a powerful and versatile gem designed to simplify the management of environment variables
in your application. With Prius, you can guarantee that your environment variables are not only
present but also valid, ensuring a smoother and more reliable app experience.
MSG
spec.homepage = "https://github.com/gocardless/prius"
spec.license = "MIT"

spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.required_ruby_version = ">= 2.6"
spec.required_ruby_version = ">= 3.0"
spec.files = Dir.chdir(__dir__) do
`git ls-files -z`.split("\x0").reject do |f|
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/
.git .circleci appveyor])
end
end

spec.add_development_dependency "gc_ruboconfig", "~> 3.6.0"
spec.add_development_dependency "rspec", "~> 3.1"
spec.add_development_dependency "rspec-github", "~> 2.4.0"
spec.metadata["rubygems_mfa_required"] = "true"
end
2 changes: 1 addition & 1 deletion spec/prius/registry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require "prius/registry"

describe Prius::Registry do
RSpec.describe Prius::Registry do
let(:env) do
{
"NAME" => "Harry",
Expand Down

0 comments on commit cadd9fd

Please sign in to comment.