Sha256: a78ec4504bcdbf480a7dd87d59eb08c8b0a9f5bf947ed423c61f6eeca25aaabc

Contents?: true

Size: 502 Bytes

Versions: 3

Compression:

Stored size: 502 Bytes

Contents

class Root
 
  attr_accessor :rails_root, :db

  def initialize(single, force)
    find_rails_root(single, force)
  end

  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

  def database
    @db.load
  end


end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
industrial_girl-0.0.3 lib/root.rb
industrial_girl-0.0.2 lib/root.rb
industrial_girl-0.0.1 lib/root.rb