Sha256: b38d6c12a7acd3ea738f05543bea3ebf2231af0ecc2277502c8f90502f997d4a

Contents?: true

Size: 824 Bytes

Versions: 15

Compression:

Stored size: 824 Bytes

Contents

require "consadole_aggregator/version"
require 'consadole_aggregator/helper.rb'
require 'consadole_aggregator/live.rb'
require 'consadole_aggregator/news.rb'

require 'logger'
require 'fileutils'

module ConsadoleAggregator
  class << self
    DEFAULT_ROOT_DIR = File.expand_path('~/.consadole_aggregator')
    DEFAULT_LOG_NAME = 'consadole_aggregator.log'

    def root_dir
      return @root_dir if @root_dir
      FileUtils.mkdir_p DEFAULT_ROOT_DIR unless File.exist? DEFAULT_ROOT_DIR
      @root_dir = DEFAULT_ROOT_DIR
    end

    def root_dir= root_dir
      FileUtil.mkdir_p root_dir unless File.exist? root_dir
      @logger &&= Logger.new(File.join(root_dir, DEFAULT_LOG_NAME))
      @root_dir = root_dir
    end

    def logger
      @logger ||= Logger.new(File.join(root_dir, DEFAULT_LOG_NAME))
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
consadole_aggregator-0.2.14 lib/consadole_aggregator.rb
consadole_aggregator-0.2.13 lib/consadole_aggregator.rb
consadole_aggregator-0.2.12 lib/consadole_aggregator.rb
consadole_aggregator-0.2.11 lib/consadole_aggregator.rb
consadole_aggregator-0.2.10 lib/consadole_aggregator.rb
consadole_aggregator-0.2.9 lib/consadole_aggregator.rb
consadole_aggregator-0.2.8 lib/consadole_aggregator.rb
consadole_aggregator-0.2.7 lib/consadole_aggregator.rb
consadole_aggregator-0.2.6 lib/consadole_aggregator.rb
consadole_aggregator-0.2.5 lib/consadole_aggregator.rb
consadole_aggregator-0.2.4 lib/consadole_aggregator.rb
consadole_aggregator-0.2.3 lib/consadole_aggregator.rb
consadole_aggregator-0.2.2 lib/consadole_aggregator.rb
consadole_aggregator-0.2.1 lib/consadole_aggregator.rb
consadole_aggregator-0.2.0 lib/consadole_aggregator.rb