Class: DB
- Inherits:
-
Object
- Object
- DB
- Defined in:
- lib/db.rb
Overview
Suprails: The customizable wrapper to the rails command
Copyright 2008 Bradley Grzesiak This file is part of Suprails.
Suprails is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Suprails is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Suprails. If not, see <http://www.gnu.org/licenses/>.
Defined Under Namespace
Classes: Environment
Instance Attribute Summary collapse
-
#development ⇒ Object
readonly
Returns the value of attribute development.
-
#production ⇒ Object
readonly
Returns the value of attribute production.
-
#test ⇒ Object
readonly
Returns the value of attribute test.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(app_name) ⇒ DB
constructor
A new instance of DB.
- #migrate ⇒ Object
Constructor Details
#initialize(app_name) ⇒ DB
Returns a new instance of DB.
59 60 61 62 63 64 |
# File 'lib/db.rb', line 59 def initialize app_name @development = Environment.new 'development' @test = Environment.new 'test' @production = Environment.new 'production' @app_name = app_name end |
Instance Attribute Details
#development ⇒ Object (readonly)
Returns the value of attribute development.
22 23 24 |
# File 'lib/db.rb', line 22 def development @development end |
#production ⇒ Object (readonly)
Returns the value of attribute production.
22 23 24 |
# File 'lib/db.rb', line 22 def production @production end |
#test ⇒ Object (readonly)
Returns the value of attribute test.
22 23 24 |
# File 'lib/db.rb', line 22 def test @test end |
Instance Method Details
#create ⇒ Object
66 67 68 |
# File 'lib/db.rb', line 66 def create `cd #{@app_name}; rake db:create` end |
#migrate ⇒ Object
69 70 71 |
# File 'lib/db.rb', line 69 def migrate `cd #{@app_name}; rake db:migrate` end |