Module: GitHub::Config

Defined in:
lib/github_api.rb

Overview

Keeps all the configuration stuff

Constant Summary collapse

Path =

Constant with defined all the paths used in the application

{:dir => ENV['HOME'] + "/.github", :dbfile => ENV['HOME'] + "/.github/github.db", :migrations => Gem.loaded_specs['github-api-client'].full_gem_path + "/db/migrate", :secrets => ENV['HOME'] + "/.github" + "/secrets.yml"}

Class Method Summary collapse

Class Method Details

.setupnil

Sets up the database and migrates it

Returns:

  • (nil)


22
23
24
25
26
# File 'lib/github_api.rb', line 22

def self.setup
  Dir.mkdir GitHub::Config::Path[:dir] rescue nil
  ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => GitHub::Config::Path[:dbfile]
  ActiveRecord::Migrator.migrate(GitHub::Config::Path[:migrations], nil)
end