Sha256: f5100bdb37e7f89f01f53c584c35ed105dae7875d9925b23b7b94d37a8e6a81b

Contents?: true

Size: 685 Bytes

Versions: 34

Compression:

Stored size: 685 Bytes

Contents

module Remi
  module Settings
    extend self

    def work_dir
      @work_dir ||= File.join(Dir.tmpdir, Dir::Tmpname.make_tmpname('',nil))
    end

    def work_dir=(arg)
      @work_dir = arg
    end

    def log_level
      @log_level ||= Logger::INFO
    end

    def log_level=(arg)
      @log_level = arg
    end

    def logger
      return @logger.call if @logger.respond_to? :call
      @logger ||= lambda do
        l = Logger.new(STDOUT)
        l.level = log_level
        l.formatter = proc do |severity, datetime, progname, msg|
          "#{msg}\n"
        end
        l
      end

      @logger.call
    end

    def logger=(arg)
      @logger = arg
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
remi-0.2.35 lib/remi/settings.rb
remi-0.2.34 lib/remi/settings.rb
remi-0.2.33 lib/remi/settings.rb
remi-0.2.32 lib/remi/settings.rb
remi-0.2.31 lib/remi/settings.rb
remi-0.2.30 lib/remi/settings.rb
remi-0.2.29 lib/remi/settings.rb
remi-0.2.28 lib/remi/settings.rb
remi-0.2.27 lib/remi/settings.rb
remi-0.2.26 lib/remi/settings.rb
remi-0.2.25 lib/remi/settings.rb
remi-0.2.24 lib/remi/settings.rb
remi-0.2.23 lib/remi/settings.rb
remi-0.2.22 lib/remi/settings.rb
remi-0.2.21 lib/remi/settings.rb
remi-0.2.20 lib/remi/settings.rb
remi-0.2.19 lib/remi/settings.rb
remi-0.2.18 lib/remi/settings.rb
remi-0.2.17 lib/remi/settings.rb
remi-0.2.16 lib/remi/settings.rb