Sha256: 39d9ab6efd40a79be3d2772820496736c6e20e4be516913ec6393a2551cdabbe

Contents?: true

Size: 885 Bytes

Versions: 5

Compression:

Stored size: 885 Bytes

Contents

require_relative "troo/troo"
require_relative "troo/version"

module Troo
  class InvalidAccessToken < StandardError; end

  def self.config
    @config ||= OpenStruct.new(YAML.load_file(Dir.home + "/.trooconf"))
  rescue Errno::ENOENT
    warn "No configuration file found..."
    src = File.dirname(__FILE__) + "/../configuration.yml.example"
    dst = Dir.home + "/.trooconf"
    FileUtils.cp(src, dst)
    warn "New configuration file created at '#{Dir.home}/.trooconf'"
    exit!
  end

  def self.logger
    @logger ||= Logger.new("logs/troo.log")
  end

  # Trello.logger = Logger.new("logs/trello.log")
  Trello.configure do |trello|
    trello.consumer_key       = config.key
    trello.consumer_secret    = config.secret
    trello.oauth_token        = config.oauth_token
    trello.oauth_token_secret = config.oauth_token_secret
  end

  Ohm.connect(db: config.main_db)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
troo-0.0.7 lib/troo.rb
troo-0.0.6 lib/troo.rb
troo-0.0.5 lib/troo.rb
troo-0.0.4 lib/troo.rb
troo-0.0.3 lib/troo.rb