Class: Gordon::EnvVars

Inherits:
Object
  • Object
show all
Defined in:
lib/gordon/env_vars.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#app_descriptionObject

Returns the value of attribute app_description.



3
4
5
# File 'lib/gordon/env_vars.rb', line 3

def app_description
  @app_description
end

#app_homepageObject

Returns the value of attribute app_homepage.



3
4
5
# File 'lib/gordon/env_vars.rb', line 3

def app_homepage
  @app_homepage
end

#app_nameObject

Returns the value of attribute app_name.



3
4
5
# File 'lib/gordon/env_vars.rb', line 3

def app_name
  @app_name
end

#app_sourceObject

Returns the value of attribute app_source.



3
4
5
# File 'lib/gordon/env_vars.rb', line 3

def app_source
  @app_source
end

#app_source_excludesObject

Returns the value of attribute app_source_excludes.



3
4
5
# File 'lib/gordon/env_vars.rb', line 3

def app_source_excludes
  @app_source_excludes
end

#app_typeObject

Returns the value of attribute app_type.



3
4
5
# File 'lib/gordon/env_vars.rb', line 3

def app_type
  @app_type
end

#app_versionObject

Returns the value of attribute app_version.



3
4
5
# File 'lib/gordon/env_vars.rb', line 3

def app_version
  @app_version
end

#http_server_typeObject

Returns the value of attribute http_server_type.



5
6
7
# File 'lib/gordon/env_vars.rb', line 5

def http_server_type
  @http_server_type
end

#init_typeObject

Returns the value of attribute init_type.



7
8
9
# File 'lib/gordon/env_vars.rb', line 7

def init_type
  @init_type
end

#runtime_nameObject

Returns the value of attribute runtime_name.



4
5
6
# File 'lib/gordon/env_vars.rb', line 4

def runtime_name
  @runtime_name
end

#runtime_versionObject

Returns the value of attribute runtime_version.



4
5
6
# File 'lib/gordon/env_vars.rb', line 4

def runtime_version
  @runtime_version
end

#web_server_typeObject

Returns the value of attribute web_server_type.



6
7
8
# File 'lib/gordon/env_vars.rb', line 6

def web_server_type
  @web_server_type
end

Class Method Details

.from_cook(options) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/gordon/env_vars.rb', line 9

def self.from_cook(options)
  env_vars = []
  env_vars << "GORDON_APP_TYPE='#{options.app_type}'"
  env_vars << "GORDON_APP_NAME='#{options.app_name}'"
  env_vars << "GORDON_APP_DESCRIPTION='#{options.app_description}'"
  env_vars << "GORDON_APP_HOMEPAGE='#{options.app_homepage}'"
  env_vars << "GORDON_APP_VERSION='#{options.app_version}'"
  env_vars << "GORDON_APP_SOURCE='#{File.expand_path(options.app_source)}'"
  env_vars << "GORDON_APP_SOURCE_EXCLUDES='#{options.app_source_excludes.to_a.join(",") }'"
  env_vars << "GORDON_RUNTIME_NAME='#{options.runtime_name}'"
  env_vars << "GORDON_RUNTIME_VERSION='#{options.runtime_version}'"
  env_vars << "GORDON_HTTP_SERVER_TYPE='#{options.http_server_type}'"
  env_vars << "GORDON_WEB_SERVER_TYPE='#{options.web_server_type}'"
  env_vars << "GORDON_INIT_TYPE='#{options.init_type}'"

  env_vars
end

.loadObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/gordon/env_vars.rb', line 27

def self.load
  env_vars = self.new

  env_vars.app_type             = ENV['GORDON_APP_TYPE']
  env_vars.app_name             = ENV['GORDON_APP_NAME']
  env_vars.app_description      = ENV['GORDON_APP_DESCRIPTION']
  env_vars.app_homepage         = ENV['GORDON_APP_HOMEPAGE']
  env_vars.app_version          = ENV['GORDON_APP_VERSION']
  env_vars.app_source           = ENV['GORDON_APP_SOURCE']
  env_vars.app_source_excludes  = ENV['GORDON_APP_SOURCE_EXCLUDES'].to_s.split(",")
  env_vars.runtime_name         = ENV['GORDON_RUNTIME_NAME']
  env_vars.runtime_version      = ENV['GORDON_RUNTIME_VERSION']
  env_vars.http_server_type     = ENV['GORDON_HTTP_SERVER_TYPE']
  env_vars.web_server_type      = ENV['GORDON_WEB_SERVER_TYPE']
  env_vars.init_type            = ENV['GORDON_INIT_TYPE']

  env_vars
end