Class: Valet
- Inherits:
-
Thor
- Object
- Thor
- Valet
- Defined in:
- lib/brisk.rb
Instance Method Summary collapse
- #domain(value) ⇒ Object
- #install ⇒ Object
- #kill ⇒ Object
- #restart ⇒ Object
- #secure ⇒ Object
- #set ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
- #unsecure ⇒ Object
- #unset ⇒ Object
- #update ⇒ Object
Instance Method Details
#domain(value) ⇒ Object
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/brisk.rb', line 59 def domain(value) old_domain = JSON.parse(FileSystem.read(Configuration.path))['domain'] Configuration.update_domain(value) DnsMasq.update_domain(value, old_domain) Thin.restart puts "Successfully set your domain to #{value}".colorize(:green) end |
#install ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/brisk.rb', line 14 def install Thin.install Configuration.install Caddy.install DnsMasq.install Rerun.install Thin.restart Caddy.restart puts "Ruby Valet installed Successfully. Start adding directories by using brisk set".colorize(:green) end |
#kill ⇒ Object
44 45 46 |
# File 'lib/brisk.rb', line 44 def kill Server.kill(Constants.valet_home) end |
#restart ⇒ Object
93 94 95 96 97 |
# File 'lib/brisk.rb', line 93 def restart Thin.restart puts "Server restarted".colorize(:green) end |
#secure ⇒ Object
71 72 73 74 75 76 77 78 79 |
# File 'lib/brisk.rb', line 71 def secure domain = dirname = File.basename(Dir.getwd) + '.' + JSON.parse(FileSystem.read(Configuration.path))['domain'] Site.secure(domain) Configuration.add('secured', File.basename(Dir.getwd)) Caddy.restart puts "Website successfully secured".colorize(:green) end |
#set ⇒ Object
32 33 34 35 |
# File 'lib/brisk.rb', line 32 def set Configuration.add('paths', Dir.pwd) puts "Successfully added directory".colorize(:green) end |
#unsecure ⇒ Object
82 83 84 85 86 87 88 89 90 |
# File 'lib/brisk.rb', line 82 def unsecure domain = dirname = File.basename(Dir.getwd) + '.' + JSON.parse(FileSystem.read(Configuration.path))['domain'] Site.unsecure(domain) Configuration.remove('secured', File.basename(Dir.getwd)) Caddy.restart puts "Website successfully unsecured".colorize(:green) end |
#unset ⇒ Object
38 39 40 41 |
# File 'lib/brisk.rb', line 38 def unset Configuration.remove('paths', Dir.pwd) puts "Successfully removed directory".colorize(:green) end |