diff --git a/app/calculation/exercise_resource_usage.rb b/app/calculation/exercise_resource_usage.rb index 1e97896d..980c5251 100644 --- a/app/calculation/exercise_resource_usage.rb +++ b/app/calculation/exercise_resource_usage.rb @@ -15,6 +15,6 @@ def result results[:cpu] += (vm.cpu || vm.operating_system&.applied_cpu).to_i * instance_count results[:primary_disk_size] += (vm.primary_disk_size || vm.operating_system&.applied_primary_disk_size).to_i * instance_count end - OpenStruct.new(results) + Struct.new(*results.keys).new(**results) end end diff --git a/app/calculation/hostname_generator.rb b/app/calculation/hostname_generator.rb index 3bddf635..4288ec4b 100644 --- a/app/calculation/hostname_generator.rb +++ b/app/calculation/hostname_generator.rb @@ -13,11 +13,11 @@ def result hostname = "#{subject.hostname}#{sequences.join('_')}" domain = nic&.network&.full_domain.to_s.gsub(/#+/, '{{ team_nr_str }}') - OpenStruct.new({ + Struct.new(:hostname, :domain, :fqdn).new( hostname:, domain:, fqdn: "#{hostname}.#{domain}" - }) + ) end def virtual_machine diff --git a/app/calculation/liquid_range_substitution.rb b/app/calculation/liquid_range_substitution.rb index 09d26199..3ed30466 100644 --- a/app/calculation/liquid_range_substitution.rb +++ b/app/calculation/liquid_range_substitution.rb @@ -25,7 +25,7 @@ def numbering_actor vm_numbering_source(subject) else subject.actor - end + end end def vm_numbering_source(vm) diff --git a/app/helpers/network_helper.rb b/app/helpers/network_helper.rb index b3f9a5dc..eff8de3f 100644 --- a/app/helpers/network_helper.rb +++ b/app/helpers/network_helper.rb @@ -9,7 +9,7 @@ def sorted_used_addresses(network) [ vm, addresses - .sort_by {|a| a.offset.to_s } + .sort_by { |a| a.offset.to_s } .group_by(&:ip_family) .reverse_merge({ ipv4: [], ipv6: [] }) ] diff --git a/app/views/exercises/show.html.haml b/app/views/exercises/show.html.haml index acb300a3..63fcc036 100644 --- a/app/views/exercises/show.html.haml +++ b/app/views/exercises/show.html.haml @@ -77,7 +77,6 @@ %i.fas.fa-plus.self-center Add actor - #actors.grid.gap-4.grid-cols-1.lg:grid-cols-2 - @actors.each do |actor, tree| = render 'actor', actor:, tree: diff --git a/spec/models/service_subject_spec.rb b/spec/models/service_subject_spec.rb index 08bc8a56..96e9025e 100644 --- a/spec/models/service_subject_spec.rb +++ b/spec/models/service_subject_spec.rb @@ -3,7 +3,6 @@ require 'rails_helper' RSpec.describe ServiceSubject do - context 'spec cache' do subject { create(:service_subject, service:) } let(:service) { create(:service) }