Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2']
ruby-version: ['3.2', '3.3']
Comment thread
FlexonyoPizza marked this conversation as resolved.

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/AccessModifierDeclarations:
Enabled: false
Style/ModuleFunction:
Enabled: false
Style/SymbolArray:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we updated this file, also update .tool-versions to match

Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.2
3.3.6
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ group :development, :test do
gem 'debug'
gem 'pry'
gem 'pry-byebug'
gem 'rubocop', '~> 1.86', require: false
end
168 changes: 96 additions & 72 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,39 @@ PATH
bcp47 (>= 0.3)
date_time_precision (>= 0.8)
mime-types (>= 3.0)
nokogiri (>= 1.11.4)
nokogiri (>= 1.19.1)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
ast (2.4.3)
bcp47 (0.3.3)
i18n
byebug (11.1.3)
byebug (13.0.0)
reline (>= 0.6.0)
coderay (1.1.3)
concurrent-ruby (1.3.1)
concurrent-ruby (1.3.6)
coolline (0.5.0)
unicode_utils (~> 1.4)
date (3.5.1)
date_time_precision (0.8.1)
debug (1.9.2)
debug (1.11.1)
irb (~> 1.10)
reline (>= 0.3.8)
diff-lcs (1.4.4)
docile (1.3.2)
ffi (1.13.1)
formatador (0.2.5)
guard (2.16.2)
diff-lcs (1.6.2)
docile (1.4.1)
erb (6.0.3)
ffi (1.17.4)
formatador (1.2.3)
reline
guard (2.20.1)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
logger (~> 1.6)
lumberjack (>= 1.0.12, < 2.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
pry (>= 0.13.0)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
Expand All @@ -43,98 +48,117 @@ GEM
guard-test (2.0.8)
guard-compat (~> 1.2)
test-unit (~> 3.0)
i18n (1.14.5)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.13.2)
io-console (0.8.2)
irb (1.17.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.3.1)
listen (3.3.1)
json (2.19.3)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
listen (3.10.0)
logger
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
lumberjack (1.2.8)
method_source (1.0.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0702)
mini_portile2 (2.8.6)
logger (1.7.0)
lumberjack (1.4.2)
method_source (1.1.0)
mime-types (3.7.0)
logger
mime-types-data (~> 3.2025, >= 3.2025.0507)
mime-types-data (3.2026.0414)
mini_portile2 (2.8.9)
nenv (0.3.0)
nokogiri (1.16.5)
nokogiri (1.19.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri-diff (0.2.0)
nokogiri-diff (0.3.0)
nokogiri (~> 1.5)
tdiff (~> 0.3, >= 0.3.2)
tdiff (~> 0.4)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
parallel (1.23.0)
parser (3.2.2.4)
parallel (2.0.1)
parser (3.3.11.1)
ast (~> 2.4.1)
racc
power_assert (1.2.0)
pry (0.14.2)
power_assert (3.0.1)
pp (0.6.3)
prettyprint
prettyprint (0.2.0)
prism (1.9.0)
pry (0.16.0)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
pry-coolline (0.2.5)
reline (>= 0.6.0)
pry-byebug (3.12.0)
byebug (~> 13.0)
pry (>= 0.13, < 0.17)
pry-coolline (0.2.6)
coolline (~> 0.5)
psych (5.1.2)
pry (~> 0.13)
psych (5.3.1)
date
stringio
racc (1.8.0)
racc (1.8.1)
rainbow (3.1.1)
rake (13.0.1)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
rake (13.4.2)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rdoc (6.7.0)
rdoc (7.2.0)
erb
psych (>= 4.0.0)
regexp_parser (2.8.2)
reline (0.5.9)
tsort
regexp_parser (2.12.0)
reline (0.6.3)
io-console (~> 0.5)
rexml (3.2.8)
strscan (>= 3.0.9)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.0)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.0)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.0)
rubocop (1.23.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.7)
rubocop (1.86.1)
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.12.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.30.0)
parser (>= 3.2.1.0)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.49.1)
parser (>= 3.3.7.2)
prism (~> 1.7)
ruby-progressbar (1.13.0)
shellany (0.0.1)
simplecov (0.17.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
stringio (3.1.1)
strscan (3.1.0)
tdiff (0.3.4)
test-unit (3.3.6)
stringio (3.2.0)
tdiff (0.4.0)
test-unit (3.7.7)
power_assert
thor (1.0.1)
unicode-display_width (2.5.0)
thor (1.5.0)
tsort (0.2.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
unicode_utils (1.4.0)

PLATFORMS
Expand All @@ -152,12 +176,12 @@ DEPENDENCIES
pry-coolline
rake
rspec
rubocop (= 1.23.0)
rubocop (~> 1.86)
simplecov (~> 0.17.0)
test-unit

RUBY VERSION
ruby 3.1.2p20
ruby 3.3.6p108

BUNDLED WITH
2.2.21
2.3.7
3 changes: 1 addition & 2 deletions fhir_models.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']

spec.required_ruby_version = '>= 3.0.0'
spec.add_dependency 'nokogiri', '>= 1.11.4'
spec.add_dependency 'nokogiri', '>= 1.19.1'
spec.add_dependency 'date_time_precision', '>= 0.8'
spec.add_dependency 'bcp47', '>= 0.3'
spec.add_dependency 'mime-types', '>= 3.0'
Expand All @@ -35,7 +35,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'simplecov', '~> 0.17.0'
spec.add_development_dependency 'nokogiri-diff'
spec.add_development_dependency 'rubocop', '1.23.0'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why delete rubocop entirely here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many ways to slice this, but planning to be consistent with inferno_core, which has rubocop as a development and test dependency in the Gemfile, not a development_dependency in the gemspec. So removing keeps it consistent.

spec.add_development_dependency 'guard-rspec'
spec.add_development_dependency 'guard-test'
end
8 changes: 4 additions & 4 deletions lib/fhir_models/bootstrap/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def validate_profile(metadata, contained = nil)
errors.delete(typename) unless present.include?(typename)
end
end
errors.keep_if { |_k, v| (v && !v.empty?) }
errors.keep_if { |_k, v| v && !v.empty? }
end

# ----- validate a field -----
Expand Down Expand Up @@ -232,7 +232,7 @@ def validate_field(field, value, contained_here, meta, errors)
end
has_valid_code = false
if meta['valid_codes']
meta['valid_codes'].each do |_key, codes|
meta['valid_codes'].each_value do |codes|
has_valid_code = true unless (codes & the_codes).empty?
break if has_valid_code
end
Expand Down Expand Up @@ -287,7 +287,7 @@ def primitive?(datatype, value)
def check_binding_uri(uri, value)
valid = false
# Strip off the |4.0.0 or |4.0.1 or |2014-03-26 or similar from the ends of URLs
uri&.gsub!(/\|[A-Za-z0-9.\-]*/, '')
uri&.gsub!(/\|[A-Za-z0-9.-]*/, '')
valueset = versioned_fhir_module::Definitions.get_codes(uri)

if ['http://hl7.org/fhir/ValueSet/mimetypes', 'http://www.rfc-editor.org/bcp/bcp13.txt'].include?(uri)
Expand Down Expand Up @@ -332,7 +332,7 @@ def find_extension(extension_source, method_name)
extension_source.select do |extension|
name = extension.url.tr('-', '_').split('/').last
anchor = name.split('#').last
(method_name.to_s == name || method_name.to_s == anchor)
[name, anchor].include?(method_name.to_s)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/fhir_models/bootstrap/preprocess.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def self.pre_process_searchparam(hash)

def self.remove_fhir_comments(hash)
hash.delete('fhir_comments')
hash.each do |_key, value|
hash.each_value do |value|
case value
when Hash
remove_fhir_comments(value)
Expand Down
2 changes: 1 addition & 1 deletion lib/fhir_models/fhir.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def self.primitive?(datatype:, value:)
!(value.to_s =~ /\A[A-Za-z0-9\-.]{1,64}\Z/).nil?
when 'xhtml'
fragment = Nokogiri::HTML::DocumentFragment.parse(value)
value.is_a?(String) && fragment.errors.size.zero?
value.is_a?(String) && fragment.errors.empty?
when 'unsignedint'
!(value.to_s =~ /\A(0|([1-9][0-9]*))\Z/).nil?
when 'positiveint'
Expand Down
4 changes: 2 additions & 2 deletions lib/fhir_models/fhir_ext/common_structure_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def valid_json?(json)
verify_element(element, json)
end

@errors.size.zero?
@errors.empty?
end
deprecate :is_valid_json?, :valid_json?

Expand Down Expand Up @@ -410,7 +410,7 @@ def check_binding_element(element, value)
if ['http://hl7.org/fhir/ValueSet/mimetypes', 'http://www.rfc-editor.org/bcp/bcp13.txt'].include?(vs_uri)
matches = MIME::Types[value]
known_weird = ['text/cql', 'application/cql+text', 'application/hl7-v2'].include?(value)
if (matches.nil? || matches.size.zero? || known_weird) && !some_type_of_xml_or_json?(value)
if (matches.nil? || matches.empty? || known_weird) && !some_type_of_xml_or_json?(value)
@errors << "#{element.path} has invalid mime-type: '#{value}'"
matching_type -= 1 if element.binding.strength == 'required'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def compatible?(another_definition)
end
@errors.flatten!
@warnings.flatten!
@errors.size.zero?
@errors.empty?
end
deprecate :is_compatible?, :compatible?

Expand Down Expand Up @@ -225,7 +225,7 @@ def compare_extension_definition(x, y, another_definition)
x_only = x_profiles - y_profiles
shared = x_profiles - x_only

if !shared.nil? && shared.size.zero?
if !shared.nil? && shared.empty?
# same name, but different profiles
# maybe the profiles are the same, just with different URLs...
# ... so we have to compare them, if we can.
Expand Down Expand Up @@ -269,7 +269,7 @@ def compare_element_definitions(x, y, another_definition)
y_only = y_types - x_types
shared = x_types - x_only

if !shared.nil? && shared.size.zero? && !x_types.empty? && !y_types.empty? && !x.constraint.empty? && !y.constraint.empty?
if !shared.nil? && shared.empty? && !x_types.empty? && !y_types.empty? && !x.constraint.empty? && !y.constraint.empty?
@errors << @finding.error(x.path.to_s, 'type.code', 'Incompatible data types', x_types.to_s, y_types.to_s)
end
if !x_only.nil? && !x_only.empty?
Expand Down Expand Up @@ -359,7 +359,7 @@ def compare_element_definitions(x, y, another_definition)
y_only = y_constraints - x_constraints
shared = x_constraints - x_only

if !shared.nil? && shared.size.zero? && !x.constraint.empty? && !y.constraint.empty?
if !shared.nil? && shared.empty? && !x.constraint.empty? && !y.constraint.empty?
@errors << @finding.error(x.path.to_s, 'constraint.xpath', 'Incompatible constraints', x_constraints.map { |z| z.tr(',', ';') }.join(' && ').to_s, y_constraints.map { |z| z.tr(',', ';') }.join(' && ').to_s)
end
if !x_only.nil? && !x_only.empty?
Expand Down
Loading
Loading