Skip to content

Commit

Permalink
adds ruby testing matrix, upgrades gems and code to support multiple …
Browse files Browse the repository at this point in the history
…versions of ruby (ideacrew#153)

* testing ruby matrix

* remove require pry

* Adjusting versions for build matrix.

* use YAML.load to support Ruby version 3.2.x

* upgrades timecop to support Ruby 3.1.4

* removes old rspec github workflow file

---------

Co-authored-by: Trey Evans <lewis.r.evans@gmail.com>
  • Loading branch information
saikumar9 and TreyE authored Nov 13, 2023
1 parent d692b74 commit 326b560
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 111 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: RSpec
on: push

jobs:
rspec:
strategy:
fail-fast: false
matrix:
ruby_version: ['2.6.3', '2.7.6', '3.0.5', '3.1.4', '3.2.2']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: wbari/start-mongoDB@v0.2
with:
mongoDBVersion: '4.2'
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- name: Cache Gems
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-${{matrix.ruby_version}}-resource_registry-gems-${{ hashFiles('**/Gemfile.lock') }}-${{ hashFiles('**/Gemfile' ) }}
restore-keys: |
${{ runner.os }}-${{matrix.ruby_version}}-resource_registry-gems-${{ hashFiles('**/Gemfile.lock') }}-${{ hashFiles('**/Gemfile' ) }}
- name: bundle install
run: |
bundle config path vendor/bundle
bundle install
- name: run tests
run: |
bundle exec rspec
35 changes: 0 additions & 35 deletions .github/workflows/tests.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.1
2.7.8
95 changes: 43 additions & 52 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@ PATH
resource_registry (0.7.0)
bootsnap (~> 1.0)
deep_merge (>= 1.0.0)
dry-configurable (= 0.9)
dry-container (~> 0.7)
dry-configurable (~> 0.12)
dry-container (~> 0.9)
dry-matcher (~> 0.7)
dry-monads (~> 1.2)
dry-monads (~> 1.3)
dry-struct (~> 1.0)
dry-types (~> 1.0)
dry-validation (~> 1.2)
i18n (>= 0.7.0)
loofah (>= 2.3.1)
mime-types
nokogiri (>= 1.9.1)
ox (~> 2.0)
rack (>= 1.6.13)

GEM
remote: https://rubygems.org/
Expand All @@ -42,66 +39,59 @@ GEM
minitest (~> 5.1)
tzinfo (~> 1.1)
ast (2.4.0)
bootsnap (1.4.6)
msgpack (~> 1.0)
bootsnap (1.17.0)
msgpack (~> 1.2)
bson (4.8.2)
builder (3.2.4)
byebug (11.1.3)
coderay (1.1.2)
concurrent-ruby (1.1.6)
crass (1.0.6)
database_cleaner (1.8.4)
deep_merge (1.2.1)
deep_merge (1.2.2)
diff-lcs (1.3)
docile (1.3.2)
dry-configurable (0.9.0)
dry-configurable (0.13.0)
concurrent-ruby (~> 1.0)
dry-core (~> 0.4, >= 0.4.7)
dry-container (0.7.2)
dry-core (~> 0.6)
dry-container (0.9.0)
concurrent-ruby (~> 1.0)
dry-configurable (~> 0.1, >= 0.1.3)
dry-core (0.4.9)
dry-configurable (~> 0.13, >= 0.13.0)
dry-core (0.7.1)
concurrent-ruby (~> 1.0)
dry-equalizer (0.3.0)
dry-inflector (0.2.0)
dry-initializer (3.0.3)
dry-logic (1.0.6)
dry-inflector (0.2.1)
dry-initializer (3.0.4)
dry-logic (1.2.0)
concurrent-ruby (~> 1.0)
dry-core (~> 0.2)
dry-equalizer (~> 0.2)
dry-matcher (0.8.3)
dry-core (>= 0.4.8)
dry-monads (1.3.5)
dry-core (~> 0.5, >= 0.5)
dry-matcher (0.9.0)
dry-core (~> 0.4, >= 0.4.8)
dry-monads (1.4.0)
concurrent-ruby (~> 1.0)
dry-core (~> 0.4, >= 0.4.4)
dry-equalizer
dry-schema (1.5.0)
dry-core (~> 0.7)
dry-schema (1.8.0)
concurrent-ruby (~> 1.0)
dry-configurable (~> 0.8, >= 0.8.3)
dry-core (~> 0.4)
dry-equalizer (~> 0.2)
dry-configurable (~> 0.13, >= 0.13.0)
dry-core (~> 0.5, >= 0.5)
dry-initializer (~> 3.0)
dry-logic (~> 1.0)
dry-types (~> 1.4)
dry-struct (1.3.0)
dry-core (~> 0.4, >= 0.4.4)
dry-equalizer (~> 0.3)
dry-types (~> 1.3)
dry-types (~> 1.5)
dry-struct (1.4.0)
dry-core (~> 0.5, >= 0.5)
dry-types (~> 1.5)
ice_nine (~> 0.11)
dry-types (1.4.0)
dry-types (1.5.1)
concurrent-ruby (~> 1.0)
dry-container (~> 0.3)
dry-core (~> 0.4, >= 0.4.4)
dry-equalizer (~> 0.3)
dry-core (~> 0.5, >= 0.5)
dry-inflector (~> 0.1, >= 0.1.2)
dry-logic (~> 1.0, >= 1.0.2)
dry-validation (1.5.0)
dry-validation (1.7.0)
concurrent-ruby (~> 1.0)
dry-container (~> 0.7, >= 0.7.1)
dry-core (~> 0.4)
dry-equalizer (~> 0.2)
dry-core (~> 0.5, >= 0.5)
dry-initializer (~> 3.0)
dry-schema (~> 1.5)
dry-schema (~> 1.8, >= 1.8.0)
erubi (1.9.0)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
Expand All @@ -111,20 +101,21 @@ GEM
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
method_source (0.9.2)
mime-types (3.3.1)
mime-types (3.5.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.0425)
mini_portile2 (2.4.0)
mime-types-data (3.2023.1003)
mini_portile2 (2.8.5)
minitest (5.14.0)
mongo (2.12.1)
bson (>= 4.8.2, < 5.0.0)
mongoid (6.4.4)
activemodel (>= 5.1, < 6.0.0)
mongo (>= 2.5.1, < 3.0.0)
msgpack (1.3.3)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
ox (2.13.2)
msgpack (1.7.2)
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
ox (2.14.14)
parallel (1.19.1)
parser (2.7.1.1)
ast (~> 2.4.0)
Expand All @@ -134,6 +125,7 @@ GEM
pry-byebug (3.8.0)
byebug (~> 11.0)
pry (~> 0.10)
racc (1.7.1)
rack (2.2.2)
rack-test (1.1.0)
rack (>= 1.0, < 3)
Expand Down Expand Up @@ -185,7 +177,7 @@ GEM
simplecov-html (0.12.2)
thor (1.0.1)
thread_safe (0.3.6)
timecop (0.9.1)
timecop (0.9.8)
tzinfo (1.2.7)
thread_safe (~> 0.1)
unicode-display_width (1.6.1)
Expand All @@ -195,7 +187,6 @@ PLATFORMS
ruby

DEPENDENCIES
actionview (>= 5.2.4.2)
activesupport (~> 5.2.4)
bundler (~> 2.0)
database_cleaner (~> 1.7)
Expand All @@ -207,8 +198,8 @@ DEPENDENCIES
rspec-rails (~> 3.9)
rubocop (~> 0.74.0)
simplecov
timecop (~> 0.9)
timecop (~> 0.9.8)
yard (~> 0.9)

BUNDLED WITH
2.0.2
2.4.17
1 change: 0 additions & 1 deletion lib/resource_registry.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

require 'dry/validation'
require 'dry/monads/result'

require 'dry/monads'
require 'dry/monads/do'
Expand Down
2 changes: 1 addition & 1 deletion lib/resource_registry/serializers/yaml/deserialize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def call(params)
def transform(params)
# result = JSON.parse(ERB.new(JSON::dump(YAML.load(params))).result)

result = YAML.safe_load(ERB.new(params).result, [Symbol])
result = YAML.load(ERB.new(params).result)
Success(result || {})
rescue Psych::SyntaxError => e
raise "YAML syntax error occurred while parsing #{params}. " \
Expand Down
30 changes: 10 additions & 20 deletions resource_registry.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,27 @@ Gem::Specification.new do |spec|
spec.add_dependency 'dry-validation', '~> 1.2'
spec.add_dependency 'dry-struct', '~> 1.0'
spec.add_dependency 'dry-types', '~> 1.0'
spec.add_dependency 'dry-configurable', '0.9'

spec.add_dependency 'dry-container', '~> 0.7'
spec.add_dependency 'deep_merge', '>= 1.0.0'

# Dependency gems added for security purposes
spec.add_dependency 'nokogiri', ">= 1.9.1"
spec.add_dependency "rack", ">= 1.6.13"
spec.add_dependency 'dry-monads', '~> 1.2'
spec.add_dependency 'dry-configurable', '~> 0.12'
spec.add_dependency 'dry-monads', '~> 1.3'
spec.add_dependency 'dry-matcher', '~> 0.7'

spec.add_dependency "loofah", ">= 2.3.1"
spec.add_development_dependency "actionview", ">= 5.2.4.2"
# end of dependency gem security updates

spec.add_dependency 'dry-container', '~> 0.9'
spec.add_dependency 'deep_merge', '>= 1.0.0'
spec.add_dependency 'i18n', '>= 0.7.0'
spec.add_dependency 'ox', '~> 2.0'
spec.add_dependency 'bootsnap', '~> 1.0'
spec.add_dependency 'mime-types'

spec.add_development_dependency "bundler", "~> 2.0"
spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_development_dependency 'rake', '~> 12.0'
spec.add_development_dependency 'rspec', '~> 3.9'
spec.add_development_dependency 'rspec-rails', '~> 3.9'
spec.add_development_dependency 'mongoid', '~> 6.0'
spec.add_development_dependency 'activesupport', '~> 5.2.4'
spec.add_development_dependency "simplecov" #, '~> 1.0'
spec.add_development_dependency "database_cleaner", '~> 1.7'
spec.add_development_dependency "timecop", '~> 0.9'
spec.add_development_dependency "rubocop", '~> 0.74.0'
spec.add_development_dependency "yard", "~> 0.9"
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'database_cleaner', '~> 1.7'
spec.add_development_dependency 'timecop', '~> 0.9.8'
spec.add_development_dependency 'rubocop', '~> 0.74.0'
spec.add_development_dependency 'yard', '~> 0.9'
spec.add_development_dependency 'pry-byebug'

end
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require "bundler/setup"
require 'resource_registry'
require 'pry'

# Custom matcher for dry-validation schema specs
require "support/matchers/match_schema"
Expand Down

0 comments on commit 326b560

Please sign in to comment.