Class: Proxyneitor::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/proxyneitor.rb

Instance Method Summary collapse

Instance Method Details

#create(app, port) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/proxyneitor.rb', line 10

def create(app, port)
  proxy = Proxyneitor::Base.new(app)
  proxy.create(port)

  say "All done!", :green

  say "NOTE: you have to add #{app}.dev to your /etc/hosts file", :yellow
end

#delete(app) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/proxyneitor.rb', line 20

def delete(app)

  answer = ask "Are you sure of removing app folder?", :limited_to => ['y', 'n']

  if answer =~ /(y|Y)/
    proxy = Proxyneitor::Base.new(app)
    proxy.remove

    say "All done!", :green
  else
    say "No deletes for today", :red
  end
end

#installObject



36
37
38
39
40
# File 'lib/proxyneitor.rb', line 36

def install
  proxy = Proxyneitor::Base.new
  proxy.install(options[:reinstall])
  say "All done!", :green
end

#listObject



43
44
45
46
47
48
# File 'lib/proxyneitor.rb', line 43

def list
  say "All applications: \n\n", :green
  proxy = Proxyneitor::Base.new
  proxy.list
  say "\n\n"
end