Class: Webbynode::PushAnd
Instance Method Summary collapse
- #create!(app_name, dns_entry) ⇒ Object
- #io ⇒ Object
- #parse_remote_app_name ⇒ Object
- #present? ⇒ Boolean
- #remote_db_name ⇒ Object
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 |
#parse_remote_app_name ⇒ Object
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
8 9 10 |
# File 'lib/webbynode/push_and.rb', line 8 def present? io.file_exists?(".pushand") end |
#remote_db_name ⇒ Object
16 17 18 |
# File 'lib/webbynode/push_and.rb', line 16 def remote_db_name parse_remote_app_name.gsub(/[-._]/, "") end |