Skip to content

Commit

Permalink
Compatibility with Zeitwerk
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Jan 9, 2025
1 parent c9a0afa commit 13ce09e
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ end

RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'ForemanDhcpBrowser'
rdoc.title = 'ForemanDHCPBrowser'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/dhcp_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class DhcpController < ApplicationController
class DHCPController < ApplicationController
before_action :find_proxy
before_action :find_record, only: %i[show edit update destroy]

Expand Down Expand Up @@ -45,7 +45,7 @@ def find_proxy
return not_found if params[:subnet_id].blank?
@subnet = ::Subnet.find(params[:subnet_id])
return not_found unless @subnet.try(:dhcp?)
@entries = DhcpEntries.new(subnet: @subnet)
@entries = DHCPEntries.new(subnet: @subnet)
end

def find_record
Expand Down
2 changes: 1 addition & 1 deletion app/models/dhcp_entries.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class DhcpEntries
class DHCPEntries
delegate :dhcp_proxy, to: :subnet
alias_attribute :proxy, :dhcp_proxy

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module ForemanDhcpBrowser::Concerns::NetRecordExtension
module ForemanDHCPBrowser::Concerns::NetRecordExtension
extend ActiveSupport::Concern

included do
Expand Down
2 changes: 1 addition & 1 deletion foreman_dhcp_browser.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require 'foreman_dhcp_browser/version'
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = 'foreman_dhcp_browser'
s.version = ForemanDhcpBrowser::VERSION
s.version = ForemanDHCPBrowser::VERSION
s.license = 'GPL-3.0'
s.authors = ['Ohad Levy']
s.email = 'ohadlevy@gmail.com'
Expand Down
2 changes: 1 addition & 1 deletion lib/foreman_dhcp_browser.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'foreman_dhcp_browser/engine'

module ForemanDhcpBrowser
module ForemanDHCPBrowser
end
13 changes: 9 additions & 4 deletions lib/foreman_dhcp_browser/engine.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
require 'deface'
module ForemanDhcpBrowser
module ForemanDHCPBrowser
class Engine < ::Rails::Engine
initializer 'foreman_dhcp_browser.register_plugin', before: :finisher_hook do |_app|
Foreman::Plugin.register :foreman_dhcp_browser do
engine_name 'foreman_dhcp_browser'

initializer 'foreman_dhcp_browser.register_plugin', before: :finisher_hook do |app|
app.reloader.to_prepare do
Foreman::Plugin.register :foreman_dhcp_browser do
requires_foreman '>= 3.14.0'
end
end
end

config.to_prepare do
::Net::Record.include ::ActiveModel::AttributeMethods
::Net::Record.include ::ActiveModel::Conversion
::Net::Record.extend ::ActiveModel::Naming
::Net::Record.include ForemanDhcpBrowser::Concerns::NetRecordExtension
::Net::Record.include ForemanDHCPBrowser::Concerns::NetRecordExtension
end
end
end
2 changes: 1 addition & 1 deletion lib/foreman_dhcp_browser/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ForemanDhcpBrowser
module ForemanDHCPBrowser
VERSION = '0.0.8'.freeze
end

0 comments on commit 13ce09e

Please sign in to comment.