Class: Gordon::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/gordon/options.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/options.rb', line 3

def app_description
  @app_description
end

#app_homepageObject

Returns the value of attribute app_homepage.



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

def app_homepage
  @app_homepage
end

#app_nameObject

Returns the value of attribute app_name.



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

def app_name
  @app_name
end

#app_sourceObject

Returns the value of attribute app_source.



3
4
5
# File 'lib/gordon/options.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/options.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/options.rb', line 3

def app_type
  @app_type
end

#app_versionObject

Returns the value of attribute app_version.



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

def app_version
  @app_version
end

#debugObject

Returns the value of attribute debug.



11
12
13
# File 'lib/gordon/options.rb', line 11

def debug
  @debug
end

#http_server_typeObject

Returns the value of attribute http_server_type.



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

def http_server_type
  @http_server_type
end

#init_typeObject

Returns the value of attribute init_type.



8
9
10
# File 'lib/gordon/options.rb', line 8

def init_type
  @init_type
end

#output_dirObject

Returns the value of attribute output_dir.



10
11
12
# File 'lib/gordon/options.rb', line 10

def output_dir
  @output_dir
end

#package_typeObject

Returns the value of attribute package_type.



9
10
11
# File 'lib/gordon/options.rb', line 9

def package_type
  @package_type
end

#recipeObject

Returns the value of attribute recipe.



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

def recipe
  @recipe
end

#runtime_nameObject

Returns the value of attribute runtime_name.



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

def runtime_name
  @runtime_name
end

#runtime_versionObject

Returns the value of attribute runtime_version.



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

def runtime_version
  @runtime_version
end

#traceObject

Returns the value of attribute trace.



11
12
13
# File 'lib/gordon/options.rb', line 11

def trace
  @trace
end

#web_server_typeObject

Returns the value of attribute web_server_type.



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

def web_server_type
  @web_server_type
end

Class Method Details

.from(main_options, recipe) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/gordon/options.rb', line 13

def self.from(main_options, recipe)
  self.new.tap do |opt|
    opt.app_type            = main_options.app_type         || recipe['app_type']
    opt.app_name            = main_options.app_name         || recipe['app_name']
    opt.app_description     = main_options.app_description  || recipe['app_description']
    opt.app_homepage        = main_options.app_homepage     || recipe['app_homepage']
    opt.app_version         = main_options.app_version      || recipe['app_version']
    opt.app_source          = recipe['app_source']          || main_options.app_source

    opt.app_source_excludes = (main_options.app_source_excludes.to_a + recipe['app_source_excludes'].to_a).flatten

    opt.runtime_name        = main_options.runtime_name         || recipe['runtime_name']
    opt.runtime_version     = main_options.runtime_version      || recipe['runtime_version']

    opt.http_server_type    = main_options.http_server_type     || recipe['http_server_type']
    opt.web_server_type     = main_options.web_server_type      || recipe['web_server_type']
    opt.init_type           = main_options.init_type            || recipe['init_type']

    opt.package_type        = main_options.package_type         || recipe['package_type']
    opt.output_dir          = recipe['output_dir']              || main_options.output_dir

    opt.debug               = !main_options.debug.nil? ? main_options.debug : recipe['debug']
    opt.trace               = !main_options.trace.nil? ? main_options.trace : recipe['trace']
  end
end