lib/dreamy/commands/domains.rb in sant0sk1-dreamy-0.2.3 vs lib/dreamy/commands/domains.rb in sant0sk1-dreamy-0.2.4
- old
+ new
@@ -2,16 +2,35 @@
module Dreamy::Command
class Domains < Base
def index
- domains = @account.domains
+ http
+ end
+
+ def http
+ domains = @account.domains.reject { |d| d.type != 'http'}
+
if domains.empty?
- display "No domains on this account"
+ 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
+
+ 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
\ No newline at end of file