Class: Shoestring::PowDns

Inherits:
Base
  • Object
show all
Defined in:
lib/shoestring/pow_dns.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

check

Constructor Details

#initialize(port = 3000) ⇒ PowDns

Returns a new instance of PowDns.



5
6
7
# File 'lib/shoestring/pow_dns.rb', line 5

def initialize(port = 3000)
  @port = port
end

Instance Attribute Details

#portObject (readonly)

Returns the value of attribute port.



3
4
5
# File 'lib/shoestring/pow_dns.rb', line 3

def port
  @port
end

Instance Method Details

#checkObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/shoestring/pow_dns.rb', line 9

def check
  Shoestring::Generic.check('Pow DNS') do
    # config port for forman if installed
    %x(if [ -f Procfile ]; then echo "port: #{port}" > .foreman; fi)

    # Set up DNS through Pow
    %x(if [ -d ~/.pow ]
    then
      echo #{port} > ~/.pow/`basename $PWD`
    else
      echo "Pow is not set up but the team uses it for this project. Setup: http://goo.gl/RaDPO"
    fi)
  end
end