Class: ThemeJuice::Tasks::DNS

Inherits:
Entry show all
Defined in:
lib/theme-juice/tasks/dns.rb

Instance Attribute Summary

Attributes inherited from Entry

#entry

Attributes inherited from ThemeJuice::Task

#tasks

Instance Method Summary collapse

Methods inherited from ThemeJuice::Task

#runner

Constructor Details

#initialize(opts = {}) ⇒ DNS

Returns a new instance of DNS.



7
8
9
10
11
12
13
14
15
16
# File 'lib/theme-juice/tasks/dns.rb', line 7

def initialize(opts = {})
  super

  @entry = {
    :project => @project.name,
    :file    => "#{@env.vm_path}/Customfile",
    :name    => "DNS",
    :id      => "DNS"
  }
end

Instance Method Details

#executeObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/theme-juice/tasks/dns.rb', line 18

def execute
  create_entry_file
  create_entry do
%Q{case
when Vagrant.has_plugin?("landrush")
  config.landrush.host '#{@project.url}', '#{@env.vm_ip}'
when Vagrant.has_plugin?("vagrant-hostsupdater")
  config.hostsupdater.aliases << '#{@project.url}'
end}
  end
end

#unexecuteObject



30
31
32
33
# File 'lib/theme-juice/tasks/dns.rb', line 30

def unexecute
  remove_landrush_entry
  remove_entry
end