Skip to content

Commit

Permalink
upgrade to ruby 3.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
wendelfabianchinsamy committed Apr 3, 2024
1 parent 36b67da commit fc9a8d3
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
steps:
- uses: actions/checkout@v3
- name: Set up Ruby 2.6
- name: Set up Ruby 3.1.4
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
ruby-version: '3.1.4'
- uses: actions/cache@v3
with:
path: vendor/bundle
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/parallel_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Set up Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.6.8"
ruby-version: "3.1.4"
bundler-cache: true

- name: Run Specs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6.8'
ruby-version: '3.1.4'
- uses: actions/cache@v3
with:
path: vendor/bundle
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM phusion/passenger-full:2.0.1
FROM phusion/passenger-full:2.5.1
LABEL maintainer="[email protected]"

# Set correct environment variables.
Expand All @@ -11,8 +11,8 @@ RUN usermod -a -G docker_env app
# Use baseimage-docker's init process.
CMD ["/sbin/my_init"]

# Use Ruby 2.6.8
RUN bash -lc 'rvm --default use ruby-2.6.8'
# Use Ruby 3.1.4
RUN bash -lc 'rvm --default use ruby-3.1.4'

# Update installed APT packages
RUN apt-get update && apt-get upgrade -y --allow-unauthenticated -o Dpkg::Options::="--force-confold" && \
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ group :test do
gem "rubocop-rspec", "~> 1.28"
gem "shoulda-matchers", "~> 4.1", ">= 4.1.2"
gem "simplecov"
gem "vcr", "~> 5.1"
gem "vcr", "~> 6.2"
gem "webmock", "~> 3.1"
end
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ GEM
unicode-display_width (2.5.0)
unicode-types (1.9.0)
unicode_utils (1.4.0)
vcr (5.1.0)
vcr (6.2.0)
webmock (3.14.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand Down Expand Up @@ -508,7 +508,7 @@ DEPENDENCIES
spring
spring-watcher-listen (~> 2.0.0)
sprockets (~> 3.7, >= 3.7.2)
vcr (~> 5.1)
vcr (~> 6.2)
webmock (~> 3.1)

BUNDLED WITH
Expand Down
30 changes: 30 additions & 0 deletions spec/concerns/cacheable_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
require "rails_helper"

describe "Cacheable", type: :concern do
let(:token) { User.generate_token }
subject { User.new(token) }

describe "cached_datacite_response" do
before do
Rails.cache.delete("datacite/100")
end

describe "when the is a cache miss" do
it "will fetch the value using Base.get_datacite_metadata" do
allow(Base).to(receive(:get_datacite_metadata).and_return({message: "from get_datacite_metadata"}))
result = RelatedIdentifier.cached_datacite_response(100)
expect(result).to(eq({message: "from get_datacite_metadata"}))
end
end

describe "when there is a cache hit" do
it "will fetch the value from cache" do
allow(Rails).to(receive_message_chain(:cache, :fetch).and_return({message: "from cache"}))
allow(Base).to(receive(:get_datacite_metadata).and_return({message: "from get_datacite_metadata"}))

result = RelatedIdentifier.cached_datacite_response(100)
expect(result).to(eq({message: "from cache"}))
end
end
end
end

0 comments on commit fc9a8d3

Please sign in to comment.