Class: VhostGenerator::VhostConfiguration
- Inherits:
-
Object
- Object
- VhostGenerator::VhostConfiguration
- Defined in:
- lib/vhost_generator/vhost_configuration.rb
Overview
VhostConfiguration stores all the configuration values (to read from) env
or cmdline
needed to render the configuration template.
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#cmdline ⇒ Object
Returns the value of attribute cmdline.
-
#generator ⇒ Object
Returns the value of attribute generator.
-
#generator_options ⇒ Object
Returns the value of attribute generator_options.
-
#instance_ports ⇒ Object
Returns the value of attribute instance_ports.
-
#relative_root ⇒ Object
Returns the value of attribute relative_root.
-
#server_names ⇒ Object
Returns the value of attribute server_names.
-
#server_ports ⇒ Object
Returns the value of attribute server_ports.
-
#static_folder ⇒ Object
Returns the value of attribute static_folder.
Instance Method Summary collapse
- #configure!(parser) ⇒ Object
-
#initialize(application = 'myapp', static_folder = 'public', server_ports = '80', server_names = 'localhost', instance_ports = '', relative_root = '/', generator = 'nginx', generator_options = '', cmdline = nil) ⇒ VhostConfiguration
constructor
A new instance of VhostConfiguration.
- #output ⇒ Object
Constructor Details
#initialize(application = 'myapp', static_folder = 'public', server_ports = '80', server_names = 'localhost', instance_ports = '', relative_root = '/', generator = 'nginx', generator_options = '', cmdline = nil) ⇒ VhostConfiguration
Returns a new instance of VhostConfiguration.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/vhost_generator/vhost_configuration.rb', line 17 def initialize(application='myapp', static_folder='public', server_ports='80', server_names='localhost', instance_ports='', relative_root='/', generator='nginx', ='', cmdline=nil) self.application = application self.static_folder = static_folder self.server_ports = server_ports self.server_names = server_names self.instance_ports = instance_ports self.relative_root = relative_root self.cmdline = cmdline # usually set later using attr_writer self.generator = generator self. = end |
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
12 13 14 |
# File 'lib/vhost_generator/vhost_configuration.rb', line 12 def application @application end |
#cmdline ⇒ Object
Returns the value of attribute cmdline.
15 16 17 |
# File 'lib/vhost_generator/vhost_configuration.rb', line 15 def cmdline @cmdline end |
#generator ⇒ Object
Returns the value of attribute generator.
12 13 14 |
# File 'lib/vhost_generator/vhost_configuration.rb', line 12 def generator @generator end |
#generator_options ⇒ Object
Returns the value of attribute generator_options.
12 13 14 |
# File 'lib/vhost_generator/vhost_configuration.rb', line 12 def @generator_options end |
#instance_ports ⇒ Object
Returns the value of attribute instance_ports.
12 13 14 |
# File 'lib/vhost_generator/vhost_configuration.rb', line 12 def instance_ports @instance_ports end |
#relative_root ⇒ Object
Returns the value of attribute relative_root.
12 13 14 |
# File 'lib/vhost_generator/vhost_configuration.rb', line 12 def relative_root @relative_root end |
#server_names ⇒ Object
Returns the value of attribute server_names.
12 13 14 |
# File 'lib/vhost_generator/vhost_configuration.rb', line 12 def server_names @server_names end |
#server_ports ⇒ Object
Returns the value of attribute server_ports.
12 13 14 |
# File 'lib/vhost_generator/vhost_configuration.rb', line 12 def server_ports @server_ports end |
#static_folder ⇒ Object
Returns the value of attribute static_folder.
12 13 14 |
# File 'lib/vhost_generator/vhost_configuration.rb', line 12 def static_folder @static_folder end |
Instance Method Details
#configure!(parser) ⇒ Object
67 68 69 |
# File 'lib/vhost_generator/vhost_configuration.rb', line 67 def configure!(parser) parser.parse(self) end |
#output ⇒ Object
71 72 73 |
# File 'lib/vhost_generator/vhost_configuration.rb', line 71 def output generator_for(self.generator).new(self, self.).render end |