Class: Sambot::DeveloperWorkflow::DNS
- Inherits:
-
Object
- Object
- Sambot::DeveloperWorkflow::DNS
- Defined in:
- lib/sambot/developer_workflow/dns.rb
Class Method Summary collapse
- .reset_hosts(forwards, src = '/etc/hosts', dest = nil) ⇒ Object
- .update_hosts(forwards, src = '/etc/hosts', dest = nil) ⇒ Object
Class Method Details
.reset_hosts(forwards, src = '/etc/hosts', dest = nil) ⇒ Object
17 18 19 20 |
# File 'lib/sambot/developer_workflow/dns.rb', line 17 def self.reset_hosts(forwards, src = '/etc/hosts', dest = nil) UI.info('Removing extra entries in hosts file') modify_hosts(forwards, src, dest) end |
.update_hosts(forwards, src = '/etc/hosts', dest = nil) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/sambot/developer_workflow/dns.rb', line 9 def self.update_hosts(forwards, src = '/etc/hosts', dest = nil) UI.info('Updating your hosts file to allow access to Advertising Studio services through local SSH tunnels') modify_hosts(forwards, src, dest) do |entries, key, value| UI.debug("Adding hosts entry #{key} #{value[:ip]}") entries << Hosts::Entry.new(value[:ip], key) end end |