Skip to content

Commit 6f1177c

Browse files
committed
Updated to test with Ruby 3.4
1 parent 8e8d9ad commit 6f1177c

16 files changed

+263
-156
lines changed

.github/workflows/build.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
name: Build
3+
4+
on:
5+
push:
6+
branches: [ main, dev ]
7+
pull_request:
8+
branches: [ main, dev ]
9+
10+
jobs:
11+
test:
12+
name: Ruby ${{ matrix.ruby }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
ruby:
17+
- "2.7"
18+
- "3.0"
19+
- "3.1"
20+
- "3.2"
21+
- "3.3"
22+
- "3.4"
23+
include:
24+
- ruby: "2.7"
25+
gemfile: "ruby-2-7"
26+
- ruby: "3.0"
27+
gemfile: "ruby-3"
28+
- ruby: "3.1"
29+
gemfile: "ruby-3"
30+
- ruby: "3.2"
31+
gemfile: "ruby-3"
32+
- ruby: "3.3"
33+
gemfile: "ruby-3"
34+
- ruby: "3.4"
35+
gemfile: "ruby-3"
36+
37+
runs-on: ubuntu-latest
38+
39+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
40+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}/Gemfile
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
- name: Set up Ruby
45+
uses: ruby/setup-ruby@v1
46+
with:
47+
ruby-version: ${{ matrix.ruby }}
48+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
49+
50+
- name: Run Tests
51+
run: bundle exec rspec spec

.github/workflows/code_coverage.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
build:
1414
runs-on: ubuntu-latest
1515

16+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
17+
BUNDLE_GEMFILE: gemfiles/ruby-3/Gemfile
18+
1619
steps:
1720
- uses: actions/checkout@v4
1821
with:
@@ -21,7 +24,7 @@ jobs:
2124
- name: Set up Ruby
2225
uses: ruby/setup-ruby@v1
2326
with:
24-
ruby-version: '3.3' # Not needed with a .ruby-version file
27+
ruby-version: '3.4' # Not needed with a .ruby-version file
2528
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
2629

2730
- name: Install Appraisal Gems

.github/workflows/ruby_2_7.yml

-27
This file was deleted.

.github/workflows/ruby_3_0.yml

-26
This file was deleted.

.github/workflows/ruby_3_1.yml

-26
This file was deleted.

.github/workflows/ruby_3_2.yml

-26
This file was deleted.

.github/workflows/ruby_3_3.yml

-26
This file was deleted.

.irbrc

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
##
22
# Load development gems
33
#
4-
require 'debug'
4+
5+
load File.expand_path('ruby_version.rb', Dir.pwd)
6+
# require 'debug'
57

68

79
##
810
# Load all the gem files in /lib
911
#
10-
Dir['./lib/*.rb'].each { |f| load f }
11-
Dir['./lib/**/*.rb'].each { |f| load f }
12-
12+
Dir[Dir.pwd + '/lib/*.rb'].each { |f| load f }
13+
Dir[Dir.pwd + '/lib/**/*.rb'].each { |f| load f }
1314

15+
puts "LOADED"
1416
##
1517
# Reload all the gem files in /lib
1618
#
1719
def reload!
18-
Dir['./lib/*.rb'].each { |f| load f }
19-
Dir['./lib/**/*.rb'].each { |f| load f }
20+
load File.expand_path('ruby_version.rb', Dir.pwd)
21+
Dir[Dir.pwd + '/lib/*.rb'].each { |f| load f }
22+
Dir[Dir.pwd + '/lib/**/*.rb'].each { |f| load f }
2023
end

.tool-versions

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 3.4.1

README.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,16 @@
1212
[//]: # "##### BADGES #####"
1313
[//]: # "############################################"
1414

15+
## Status
16+
17+
![Build](https://github.com/Rubology/result_vault/actions/workflows/build.yml/badge.svg?branch=dev)
18+
 
19+
![100% Test Coverage](https://github.com/Rubology/result_vault/actions/workflows/code_coverage.yml/badge.svg?branch=dev)
20+
 
21+
[![Gem Version](https://badge.fury.io/rb/result_vault.svg)](https://badge.fury.io/rb/result_vault)
22+
 
23+
[![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)](#license)
1524

16-
| Main Branch| Dev Branch|
17-
|---|---|
18-
| ![ruby 3.3](https://github.com/Rubology/result_vault/actions/workflows/ruby_3_3.yml/badge.svg?branch=main) | ![ruby 3.3](https://github.com/Rubology/result_vault/actions/workflows/ruby_3_3.yml/badge.svg?branch=dev) |
19-
| ![ruby 3.2](https://github.com/Rubology/result_vault/actions/workflows/ruby_3_2.yml/badge.svg?branch=main) | ![ruby 3.2](https://github.com/Rubology/result_vault/actions/workflows/ruby_3_2.yml/badge.svg?branch=dev) |
20-
| ![ruby 3.1](https://github.com/Rubology/result_vault/actions/workflows/ruby_3_1.yml/badge.svg?branch=main) | ![ruby 3.1](https://github.com/Rubology/result_vault/actions/workflows/ruby_3_1.yml/badge.svg?branch=dev) |
21-
| ![ruby 3.0](https://github.com/Rubology/result_vault/actions/workflows/ruby_3_0.yml/badge.svg?branch=main) | ![ruby 3.0](https://github.com/Rubology/result_vault/actions/workflows/ruby_3_0.yml/badge.svg?branch=dev) |
22-
| ![ruby 2.7](https://github.com/Rubology/result_vault/actions/workflows/ruby_2_7.yml/badge.svg?branch=main) | ![ruby 2.7](https://github.com/Rubology/result_vault/actions/workflows/ruby_2_7.yml/badge.svg?branch=dev) |
23-
|   | |
24-
| [![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)](#license) | [![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)](#license) |
25-
| [![Gem Version](https://badge.fury.io/rb/result_vault.svg)](https://badge.fury.io/rb/result_vault) | [![Gem Version](https://badge.fury.io/rb/result_vault.svg)](https://badge.fury.io/rb/result_vault) |
26-
| ![100% Coverage](https://github.com/Rubology/result_vault/actions/workflows/code_coverage.yml/badge.svg?branch=main) | ![100% Coverage](https://github.com/Rubology/result_vault/actions/workflows/code_coverage.yml/badge.svg?branch=dev) |
2725

2826

2927

Rakefile

+25
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,32 @@
22

33
require "bundler/gem_tasks"
44
require "rspec/core/rake_task"
5+
require "./ruby_version"
56

67
RSpec::Core::RakeTask.new(:spec)
78

89
task default: :spec
10+
11+
12+
desc "Installs gems using the correct gemfile for the current version of ruby."
13+
task :bundle do
14+
puts "Installing from '#{RubyVersion.gemfile}'"
15+
system("bundle --gemfile=#{RubyVersion.gemfile}")
16+
system("bundle lock --add-platform x86_64-linux --gemfile=#{RubyVersion.gemfile}")
17+
end
18+
19+
20+
21+
desc "Runs bundle outdated for the current version of ruby."
22+
task :outdated do
23+
puts "Checking outdated for '#{RubyVersion.gemfile}'"
24+
system("BUNDLE_GEMFILE=#{RubyVersion.gemfile} bundle outdated")
25+
end
26+
27+
28+
29+
desc "Runs bundle update for the current version of ruby."
30+
task :update do
31+
puts "Updating for '#{RubyVersion.gemfile}'"
32+
system("BUNDLE_GEMFILE=#{RubyVersion.gemfile} bundle update")
33+
end

gemfiles/ruby-2-7/Gemfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
4+
5+
# Specify your gem's dependencies in result_vault.gemspec
6+
# gemspec
7+
8+
gem 'rake'
9+
10+
gem 'rspec'
11+
12+
gem 'debug'
13+
14+
gem 'amazing_print'
15+
16+
gem 'simplecov'

gemfiles/ruby-2-7/Gemfile.lock

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
amazing_print (1.6.0)
5+
date (3.4.1)
6+
debug (1.10.0)
7+
irb (~> 1.10)
8+
reline (>= 0.3.8)
9+
diff-lcs (1.5.1)
10+
docile (1.4.1)
11+
io-console (0.8.0)
12+
irb (1.14.3)
13+
rdoc (>= 4.0.0)
14+
reline (>= 0.4.2)
15+
psych (5.2.2)
16+
date
17+
stringio
18+
rake (13.2.1)
19+
rdoc (6.10.0)
20+
psych (>= 4.0.0)
21+
reline (0.6.0)
22+
io-console (~> 0.5)
23+
rspec (3.13.0)
24+
rspec-core (~> 3.13.0)
25+
rspec-expectations (~> 3.13.0)
26+
rspec-mocks (~> 3.13.0)
27+
rspec-core (3.13.2)
28+
rspec-support (~> 3.13.0)
29+
rspec-expectations (3.13.3)
30+
diff-lcs (>= 1.2.0, < 2.0)
31+
rspec-support (~> 3.13.0)
32+
rspec-mocks (3.13.2)
33+
diff-lcs (>= 1.2.0, < 2.0)
34+
rspec-support (~> 3.13.0)
35+
rspec-support (3.13.2)
36+
simplecov (0.22.0)
37+
docile (~> 1.1)
38+
simplecov-html (~> 0.11)
39+
simplecov_json_formatter (~> 0.1)
40+
simplecov-html (0.13.1)
41+
simplecov_json_formatter (0.1.4)
42+
stringio (3.1.2)
43+
44+
PLATFORMS
45+
arm64-darwin-23
46+
x86_64-linux
47+
48+
DEPENDENCIES
49+
amazing_print
50+
debug
51+
rake
52+
rspec
53+
simplecov
54+
55+
BUNDLED WITH
56+
2.4.22

Gemfile gemfiles/ruby-3/Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
source 'https://rubygems.org'
44

55
# Specify your gem's dependencies in result_vault.gemspec
6-
gemspec
6+
# gemspec
77

88
gem 'rake', '~> 13.0'
99

Gemfile.lock gemfiles/ruby-3/Gemfile.lock

-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
PATH
2-
remote: .
3-
specs:
4-
result_vault (1.4.0)
5-
61
GEM
72
remote: https://rubygems.org/
83
specs:
@@ -82,7 +77,6 @@ DEPENDENCIES
8277
amazing_print
8378
debug
8479
rake (~> 13.0)
85-
result_vault!
8680
rspec (~> 3.0)
8781
rubocop
8882
simplecov

0 commit comments

Comments
 (0)