Synced with Octolux master.
Renamed the master branch to main
This commit is contained in:
parent
725761ca02
commit
33b373bcdc
1
boot.rb
1
boot.rb
|
@ -9,6 +9,7 @@ require 'bundler/setup'
|
|||
require 'logger'
|
||||
|
||||
require 'inifile'
|
||||
require_relative 'lib/inifile' # monkey-patch :(
|
||||
require 'zeitwerk'
|
||||
|
||||
LOGGER = Logger.new(STDOUT)
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class IniFile
|
||||
class Parser
|
||||
def typecast(value)
|
||||
case value
|
||||
when /\Atrue\z/i then true
|
||||
when /\Afalse\z/i then false
|
||||
when /\A\s*\z/i then nil
|
||||
else
|
||||
# Monkey-patch to avoid converting contents of the inifile into
|
||||
# Integers or Floats. Just leave everything as Strings.
|
||||
unescape_value(value)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue