Class: VagrantSymfony::Config::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-symfony/config/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



6
7
8
9
10
11
12
13
14
# File 'lib/vagrant-symfony/config/config.rb', line 6

def initialize
  @web = UNSET_VALUE
  @cmd = UNSET_VALUE
  @update_nginx = UNSET_VALUE
  @nginx_hostfile = UNSET_VALUE
  @root = UNSET_VALUE
  @entry = UNSET_VALUE
  @env = UNSET_VALUE
end

Instance Attribute Details

#cmdObject

Returns the value of attribute cmd.



4
5
6
# File 'lib/vagrant-symfony/config/config.rb', line 4

def cmd
  @cmd
end

#entryObject

Returns the value of attribute entry.



4
5
6
# File 'lib/vagrant-symfony/config/config.rb', line 4

def entry
  @entry
end

#envObject

Returns the value of attribute env.



4
5
6
# File 'lib/vagrant-symfony/config/config.rb', line 4

def env
  @env
end

#nginx_hostfileObject

Returns the value of attribute nginx_hostfile.



4
5
6
# File 'lib/vagrant-symfony/config/config.rb', line 4

def nginx_hostfile
  @nginx_hostfile
end

#rootObject

Returns the value of attribute root.



4
5
6
# File 'lib/vagrant-symfony/config/config.rb', line 4

def root
  @root
end

#update_nginxObject

Returns the value of attribute update_nginx.



4
5
6
# File 'lib/vagrant-symfony/config/config.rb', line 4

def update_nginx
  @update_nginx
end

#webObject

Returns the value of attribute web.



4
5
6
# File 'lib/vagrant-symfony/config/config.rb', line 4

def web
  @web
end

Instance Method Details

#commandNameObject



35
36
37
38
# File 'lib/vagrant-symfony/config/config.rb', line 35

def commandName
  return "./app/console" if @cmd == UNSET_VALUE
  return @cmd
end

#entryPointObject



16
17
18
19
20
21
# File 'lib/vagrant-symfony/config/config.rb', line 16

def entryPoint
  return "app.php" if @entry == UNSET_VALUE
  return @entry[1..-1] if @entry[0] == '/'
  return @entry[2..-1] if @entry[0] == '.' && @entry[1] == '/'
  return @entry
end

#environmentVariablesObject



50
51
52
53
# File 'lib/vagrant-symfony/config/config.rb', line 50

def environmentVariables
  return {} unless @env.is_a?(Hash)
  return @env
end

#nginxHostfileObject



45
46
47
48
# File 'lib/vagrant-symfony/config/config.rb', line 45

def nginxHostfile
  return "/etc/nginx/sites-enabled/default" if @nginx_hostfile == UNSET_VALUE
  return @nginx_hostfile
end

#rootFolderObject



23
24
25
26
27
# File 'lib/vagrant-symfony/config/config.rb', line 23

def rootFolder
  return "/vagrant" if @root == UNSET_VALUE
  return @root[0..-2] if @root[-1] == '/'
  return @root
end

#updateNginxObject



40
41
42
43
# File 'lib/vagrant-symfony/config/config.rb', line 40

def updateNginx
  return false if @update_nginx == UNSET_VALUE
  return @update_nginx
end

#webFolderObject



29
30
31
32
33
# File 'lib/vagrant-symfony/config/config.rb', line 29

def webFolder
  return "./web" if @web == UNSET_VALUE
  return @web[0..-2] if @web[-1] == '/'
  return @web
end