Class: Webbynode::PushAnd

Inherits:
Object show all
Defined in:
lib/webbynode/push_and.rb

Instance Method Summary collapse

Instance Method Details

#create!(app_name, dns_entry) ⇒ Object



20
21
22
# File 'lib/webbynode/push_and.rb', line 20

def create!(app_name, dns_entry)
  io.create_file(".pushand", "#! /bin/bash\nphd $0 #{app_name} #{dns_entry}\n", true)
end

#ioObject



6
# File 'lib/webbynode/push_and.rb', line 6

def io; @io ||= Webbynode::Io.new; end

#parse_remote_app_nameObject



12
13
14
# File 'lib/webbynode/push_and.rb', line 12

def parse_remote_app_name
  io.read_file(".pushand")[/^phd \$0 ([^ ]+)/, 1]
end

#present?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/webbynode/push_and.rb', line 8

def present?
  io.file_exists?(".pushand")
end

#remote_db_nameObject



16
17
18
# File 'lib/webbynode/push_and.rb', line 16

def remote_db_name
  parse_remote_app_name.gsub(/[-._]/, "")      
end