Remove lib folder from autoload path

- Load extensions explicitly
This commit is contained in:
Artur Beljajev 2018-06-05 17:26:14 +03:00
parent 9ea5b54f5c
commit 30ac973f96
12 changed files with 25 additions and 25 deletions

14
lib/gem_ext/builder.rb Normal file
View file

@ -0,0 +1,14 @@
require 'builder'
class Builder::XmlMarkup
def epp_head
self.instruct!
epp(
'xmlns' => 'https://epp.tld.ee/schema/epp-ee-1.0.xsd',
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:schemaLocation' => 'lib/schemas/epp-ee-1.0.xsd'
) do
yield
end
end
end

11
lib/gem_ext/i18n.rb Normal file
View file

@ -0,0 +1,11 @@
# Don't raise error when nil
# http://stackoverflow.com/questions/9467034/rails-i18n-how-to-handle-case-of-a-nil-date-being-passed-ie-lnil
module I18n
class << self
alias_method :original_localize, :localize
def localize(object, options = {})
object.present? ? original_localize(object, options) : ''
end
end
end

View file

@ -0,0 +1,23 @@
# the following line is required for PaperTrail >= 4.0.0 with Rails
PaperTrail::Rails::Engine.eager_load!
PaperTrail::Version.module_eval do
self.abstract_class = true
end
# Store console and rake changes in versions
if defined?(::Rails::Console) || File.basename($PROGRAM_NAME).split(' ').first == 'spring'
PaperTrail.whodunnit = "console-#{`whoami`.strip}"
elsif File.basename($PROGRAM_NAME) == "rake"
# rake username does not work when spring enabled
PaperTrail.whodunnit = "rake-#{`whoami`.strip} #{ARGV.join ' '}"
end
class PaperSession
class << self
attr_writer :session
def session
@session ||= Time.zone.now.to_s(:db)
end
end
end