Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/workflows/lint-app.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/test-app.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
name: Ruby tests

on: [push, pull_request]
on: pull_request

jobs:
test:
strategy:
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
# In support versions of Ruby this Gem will be tested against.
# This should correspond to the version range in the gemfile.
ruby: ['3.3', '3.4']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@v1.316.0
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run Rubocop
# Note that Rubocop will conservatively use the minimal version from the gemfile for its rules
# we should only run it on the minimal Ruby version
if: matrix.ruby == '3.3'
run: bundle exec rubocop
- name: Run tests
run: bundle exec rake test
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
AllCops:
TargetRubyVersion: 2.7
NewCops: enable
Style/FrozenStringLiteralComment:
Enabled: true
Expand Down
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes will be documented in this file.

## Unreleased

- (Bogdan) Moved development dependencies from `gemspec` to `Gemfile` and updated
all dependencies [#37](https://github.com/epimorphics/nrw-landing/issues/37)

## 1.4.0 - 2026-03-04

- (AlexT) When finding wrapper type, select the most specific type if more are available
Expand Down
12 changes: 12 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in sapi-nt-client-ruby.gemspec
gemspec

group :development do
gem 'bundler'
gem 'byebug'
gem 'minitest', '~> 5.0'
gem 'minitest-reporters', '~> 1.0'
gem 'mocha', '~> 2.0'
gem 'rake'
gem 'rubocop'
gem 'simplecov'
gem 'vcr', '~> 6.0'
end
87 changes: 48 additions & 39 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ GEM
remote: https://rubygems.org/
specs:
ansi (1.5.0)
ast (2.4.2)
ast (2.4.3)
builder (3.3.0)
byebug (11.1.3)
concurrent-ruby (1.3.4)
concurrent-ruby (1.3.7)
docile (1.4.1)
faraday (1.10.4)
faraday (1.10.6)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
Expand All @@ -27,74 +27,83 @@ GEM
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-em_synchrony (1.0.1)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.1.0)
faraday-multipart (1.2.0)
multipart-post (~> 2.0)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday-retry (1.0.4)
faraday_middleware (1.0.0)
faraday (~> 1.0)
i18n (1.14.6)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
minitest (5.25.4)
minitest-reporters (1.7.1)
json (2.20.0)
language_server-protocol (3.17.0.6)
lint_roller (1.1.0)
minitest (5.26.1)
minitest-reporters (1.8.0)
ansi
builder
minitest (>= 5.0)
minitest (>= 5.0, < 7)
ruby-progressbar
mocha (2.7.1)
mocha (2.8.2)
ruby2_keywords (>= 0.0.5)
multipart-post (2.4.1)
parallel (1.26.3)
parser (3.3.6.0)
parallel (1.28.0)
parser (3.3.11.1)
ast (~> 2.4.1)
racc
prism (1.9.0)
racc (1.8.1)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.10.0)
rexml (3.4.0)
rubocop (1.26.1)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rake (13.4.2)
regexp_parser (2.12.0)
rubocop (1.88.2)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.16.0, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.37.0)
parser (>= 3.3.1.0)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.50.0)
parser (>= 3.3.7.2)
prism (~> 1.7)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
simplecov (0.21.2)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.1)
simplecov-html (0.13.2)
simplecov_json_formatter (0.1.4)
unicode-display_width (2.6.0)
vcr (6.0.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
vcr (6.4.0)

PLATFORMS
ruby
x86_64-darwin-24
x86_64-linux

DEPENDENCIES
bundler (~> 2.4.22)
byebug (~> 11.1.3)
minitest (~> 5.25)
minitest-reporters (~> 1.7)
mocha (~> 2.4)
rake (~> 13.0.1)
rubocop (~> 1.26.0)
bundler
byebug
minitest (~> 5.0)
minitest-reporters (~> 1.0)
mocha (~> 2.0)
rake
rubocop
sapi-client-ruby!
simplecov (~> 0.21.1)
vcr (~> 6.0.0)
simplecov
vcr (~> 6.0)

BUNDLED WITH
2.4.22
6 changes: 3 additions & 3 deletions exe/sapi
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env ruby
# frozen-string-literal: true
# frozen_string_literal: true

require 'bundler/setup'
require 'optparse'
require 'sapi_client'

options = {
base: ENV['SAPI_BASE_URL'],
spec: ENV['SAPI_SPEC_FILE'] || ENV['SAPI_SPEC']
base: ENV.fetch('SAPI_BASE_URL', nil),
spec: ENV['SAPI_SPEC_FILE'] || ENV.fetch('SAPI_SPEC', nil)
}

def spec_file_or_dir(options)
Expand Down
2 changes: 1 addition & 1 deletion lib/sapi_client/application.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen-string-literal: true
# frozen_string_literal: true

module SapiClient
# Wraps an entire Sapi-NT application, such that we can walk over all of the
Expand Down
2 changes: 1 addition & 1 deletion lib/sapi_client/endpoint_group.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen-string-literal: true
# frozen_string_literal: true

module SapiClient
# Encapsulates the specification of a group of SAPI endpoints, and some
Expand Down
2 changes: 1 addition & 1 deletion lib/sapi_client/endpoint_values.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen-string-literal: true
# frozen_string_literal: true

module SapiClient
# Encapsulates a set of values from a given endpoint, conditioned by various
Expand Down
6 changes: 3 additions & 3 deletions lib/sapi_client/hierarchy_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class HierarchyResource < SapiResource
attr_reader :children, :parent

def initialize(resource)
super(resource)
super
@children = []
end

Expand All @@ -22,8 +22,8 @@ def add_child(resource, add_reciprocal: true)
resource.send(:parent=, self, add_reciprocal: false) if add_reciprocal
end

def each_child(&block)
children.each(&block)
def each_child(&)
children.each(&)
end
end
end
2 changes: 1 addition & 1 deletion lib/sapi_client/instance.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen-string-literal: true
# frozen_string_literal: true

module SapiClient
# Denotes a particular instance of a Sapi-NT API. The instance has the basic
Expand Down
6 changes: 3 additions & 3 deletions lib/sapi_client/resource_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def self.default_resource_wrapper_type
# Find the first wrapper type for which there is an existing
# class constant with the same name. If no such value is
# found, return the default resource wrapper
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
# rubocop:disable Metrics/MethodLength
def self.find_wrapper_type(types)
all_wrapped = Array(types)
.map { |type| wrapper_class_constant(de_uri(type)) }
.filter { |wrapper| !wrapper.nil? }
.compact
most_specific_wrapped = all_wrapped
.filter do |t|
all_wrapped.none? do |a|
Expand All @@ -45,7 +45,7 @@ def self.find_wrapper_type(types)

default_resource_wrapper_type
end
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
# rubocop:enable Metrics/MethodLength

# Return the wrapper class for the given resource. If the
# `options` specifies the wrapper class, then use that.
Expand Down
2 changes: 1 addition & 1 deletion lib/sapi_client/sapi_endpoint.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen-string-literal: true
# frozen_string_literal: true

module SapiClient
# Denotes a single SAPI-NT endpoint, which we can call to get back JSON data
Expand Down
4 changes: 2 additions & 2 deletions lib/sapi_client/sapi_resource.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen-string-literal: true
# frozen_string_literal: true

module SapiClient
# Encapsulates a JSON-LD -style resource that we get back from a Sapi-NT endpoint,
Expand Down Expand Up @@ -193,7 +193,7 @@ def lang_select(values, preferred_lang)
# Return the given value as an un-wrapped resource. A Hash given to this
# method will have its keys transformed to symbols.
def as_resource(res)
if res.is_a?(SapiResource) # rubocop:disable Style/CaseLikeIf
if res.is_a?(SapiResource)
res.resource.clone
elsif res.is_a?(Hash)
hash_with_symbol_keys(res)
Expand Down
2 changes: 1 addition & 1 deletion lib/sapi_client/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ module SapiClient
MAJOR = 1
MINOR = 4
FIX = 0
VERSION = "#{MAJOR}.#{MINOR}.#{FIX}"
VERSION = "#{MAJOR}.#{MINOR}.#{FIX}".freeze
end
2 changes: 1 addition & 1 deletion lib/sapi_client/view.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen-string-literal: true
# frozen_string_literal: true

module SapiClient
# Encapsulates a view of a Sapi-NT endpoint, which tells us information about
Expand Down
12 changes: 1 addition & 11 deletions sapi-client-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'sapi_client/version'

Gem::Specification.new do |spec|
spec.required_ruby_version = '>= 2.7.8'
spec.required_ruby_version = '~> 3.3'
spec.name = 'sapi-client-ruby'
spec.version = SapiClient::VERSION
spec.authors = ['Epimorphics Ltd']
Expand Down Expand Up @@ -33,14 +33,4 @@ Gem::Specification.new do |spec|

spec.add_dependency 'faraday_middleware', '~> 1.0.0'
spec.add_dependency 'i18n', '~> 1.5'

spec.add_development_dependency 'bundler', '~> 2.4.22'
spec.add_development_dependency 'byebug', '~> 11.1.3'
spec.add_development_dependency 'minitest', '~> 5.25'
spec.add_development_dependency 'minitest-reporters', '~> 1.7'
spec.add_development_dependency 'mocha', '~> 2.4'
spec.add_development_dependency 'rake', '~> 13.0.1'
spec.add_development_dependency 'rubocop', '~> 1.26.0'
spec.add_development_dependency 'simplecov', '~> 0.21.1'
spec.add_development_dependency 'vcr', '~> 6.0.0'
end
2 changes: 1 addition & 1 deletion test/sapi_client/endpoint_values_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen-string-literal: true
# frozen_string_literal: true

require 'test_helper'
require 'sapi_client'
Expand Down
2 changes: 1 addition & 1 deletion test/sapi_client/sapi_resource_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen-string-literal: true
# frozen_string_literal: true

require 'test_helper'
require 'sapi_client'
Expand Down