class Root

Attributes

db[RW]
rails_root[RW]

Public Class Methods

new(single, force) click to toggle source
# File lib/root.rb, line 5
def initialize(single, force)
  find_rails_root(single, force)
end

Public Instance Methods

database() click to toggle source
# File lib/root.rb, line 19
def database
  @db.load
end
find_rails_root(single, force) click to toggle source
# File lib/root.rb, line 9
def find_rails_root(single, force)
  @rails_root = `pwd`.sub(/\n/, '')
  if File.directory? "#{@rails_root}/config" and File.directory? "#{@rails_root}/app"
    @db = Database.new(@rails_root, single, force)
    database
  else
    p 'Either this is not a rails app or you are not in the root of your rails app'
  end
end