Skip to content

Commit

Permalink
chore: rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mromulus committed Dec 5, 2023
1 parent 1a86e5e commit 0469a63
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/calculation/exercise_resource_usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions app/calculation/hostname_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/calculation/liquid_range_substitution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def numbering_actor
vm_numbering_source(subject)
else
subject.actor
end
end
end

def vm_numbering_source(vm)
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/network_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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: [] })
]
Expand Down
1 change: 0 additions & 1 deletion app/views/exercises/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
1 change: 0 additions & 1 deletion spec/models/service_subject_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require 'rails_helper'

RSpec.describe ServiceSubject do

context 'spec cache' do
subject { create(:service_subject, service:) }
let(:service) { create(:service) }
Expand Down

0 comments on commit 0469a63

Please sign in to comment.