Class: Dreamy::Command::Domains
- Inherits:
-
Base
- Object
- Base
- Dreamy::Command::Domains
show all
- Defined in:
- lib/dreamy/commands/domains.rb
Instance Attribute Summary
Attributes inherited from Base
#args
Instance Method Summary
collapse
Methods inherited from Base
#ask, #display, #extract_option, #home_directory, #initialize, #running_on_windows?, #shell
Instance Method Details
#http ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/dreamy/commands/domains.rb', line 10
def http
domains = @account.domains.reject { |d| d.type != 'http'}
if domains.empty?
display "No HTTP domains on this account"
else
domain_table = table do |t|
t.headings = 'Domain Name', 'Server', 'Type', 'User', 'WWW or Not'
domains.each { |d| t << [d.domain,d.short_home,d.hosting_type,d.user,d.www_or_not]}
end
display domain_table
end
end
|
#index ⇒ Object
6
7
8
|
# File 'lib/dreamy/commands/domains.rb', line 6
def index
http
end
|
#mysql ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/dreamy/commands/domains.rb', line 24
def mysql
domains = @account.domains.reject { |d| d.type != 'mysqldns'}
if domains.empty?
display "No MySQL domains on this account"
else
domain_table = table do |t|
t.headings = 'Domain Name', 'Server'
domains.each { |d| t << [d.domain,d.short_home]}
end
display domain_table
end
end
|
#status ⇒ Object
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/dreamy/commands/domains.rb', line 38
def status
domains = @account.domains
domains.each do |d|
if host_available?(d.domain)
display "#{d.domain} is up"
else
display "#{d.domain} is down!"
if host_available?(d.home)
display " But its host server (#{d.home}) is up"
else
display " And its host server (#{d.home}) is down"
end
end
end
end
|