Class: Preseason::Config::Database
- Inherits:
-
Object
- Object
- Preseason::Config::Database
show all
- Includes:
- Preseason::Config
- Defined in:
- lib/preseason/config/database.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#ask, #readme, #yes?
#method_missing
Instance Attribute Details
#database ⇒ Object
Returns the value of attribute database.
6
7
8
|
# File 'lib/preseason/config/database.rb', line 6
def database
@database
end
|
#password ⇒ Object
Returns the value of attribute password.
6
7
8
|
# File 'lib/preseason/config/database.rb', line 6
def password
@password
end
|
#username ⇒ Object
Returns the value of attribute username.
7
8
9
|
# File 'lib/preseason/config/database.rb', line 7
def username
@username
end
|
Instance Method Details
#adapter_name ⇒ Object
30
31
32
|
# File 'lib/preseason/config/database.rb', line 30
def adapter_name
adapters[database]
end
|
#ask_user ⇒ Object
9
10
11
12
13
14
15
16
|
# File 'lib/preseason/config/database.rb', line 9
def ask_user
self.database ||= ask "What db will you be using?", :limited_to => gems.keys
unless database == 'sqlite'
self.username = ask "What is your #{database} database username? (leave blank for `whoami`)"
self.password = ask "What is your #{database} database password? (leave blank for none)"
end
end
|
#gem_name ⇒ Object
34
35
36
|
# File 'lib/preseason/config/database.rb', line 34
def gem_name
gems[database]
end
|
#postgres? ⇒ Boolean
22
23
24
|
# File 'lib/preseason/config/database.rb', line 22
def postgres?
database == 'postgres'
end
|
#sqlite? ⇒ Boolean
26
27
28
|
# File 'lib/preseason/config/database.rb', line 26
def sqlite?
database == 'sqlite'
end
|