Class: Nginx::Runner
- Inherits:
-
Thor
- Object
- Thor
- Nginx::Runner
- Defined in:
- lib/nginx_config.rb
Instance Method Summary collapse
Instance Method Details
#add(dir, opts) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/nginx_config.rb', line 21 def add(dir,opts) if File.directory?(dir) dir = File.(dir) setup(opts) site_name = File.basename( dir ) `mkdir #{dir}/config` unless File.directory?(dir+'/config') if !File.exists?(dir+'/config/nginx.yml') || opts['force'] open(dir + '/config/nginx.yml', 'w+').write(ERB.new(File.read(Nginx::Template['site.yml']), nil, '>').result(binding)) # add site to system wide config. end end end |
#generate(opts) ⇒ Object
45 46 |
# File 'lib/nginx_config.rb', line 45 def generate(opts) end |