Class: Origen::Application::Configuration
- Defined in:
- lib/origen/application/configuration.rb
Constant Summary collapse
- ATTRS_THAT_DEPEND_ON_TARGET =
Mark any attributes that are likely to depend on properties of the target here, this will raise an error if they are ever accessed before the target has been instantiated (a concern for Origen core developers only).
These attributes will also receive an enhanced accessor that accepts a block, see below for more details on this.
[ :output_directory, :reference_directory, :pattern_postfix, :pattern_prefix, :pattern_header, :release_directory, :pattern_name_translator, :pattern_directory, :pattern_output_directory, :proceed_with_pattern, :test_program_output_directory, :test_program_source_directory, :test_program_template_directory, :referenced_pattern_list, :program_prefix, :web_directory, :web_domain ]
- ATTRS_THAT_ACCEPT_A_BLOCK =
Any attributes that want to accept a block, but not necessarily require the target can be added here
ATTRS_THAT_DEPEND_ON_TARGET + [:release_instructions, :history_file, :log_directory, :copy_command, :diff_command, :imports, :imports_dev, :remotes, :external_app_dirs ]
- ATTRS_THAT_CURRENT_PLUGIN_CAN_OVERRIDE =
If a current plugin is present then its value for these attributes will be used instead of that from the current application
[ :pattern_prefix, :pattern_postfix, :program_prefix, :pattern_header, :pattern_output_directory, :output_directory, :reference_directory, :test_program_output_directory, :test_program_template_directory, :referenced_pattern_list ]
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the configuration’s application instance.
-
#compile_only_dot_erb_files ⇒ Object
Returns the value of attribute compile_only_dot_erb_files.
-
#copy_command ⇒ Object
Returns the value of attribute copy_command.
-
#default_lsf_action ⇒ Object
Returns the value of attribute default_lsf_action.
-
#diff_command ⇒ Object
Returns the value of attribute diff_command.
-
#erb_trim_mode ⇒ Object
Returns the value of attribute erb_trim_mode.
-
#external_app_dirs ⇒ Object
Returns the value of attribute external_app_dirs.
-
#gem_name ⇒ Object
Returns the value of attribute gem_name.
-
#history_file ⇒ Object
Returns the value of attribute history_file.
-
#imports ⇒ Object
Returns the value of attribute imports.
-
#imports_dev ⇒ Object
Returns the value of attribute imports_dev.
-
#initials ⇒ Object
Returns the value of attribute initials.
-
#instructions ⇒ Object
Returns the value of attribute instructions.
-
#lint_test ⇒ Object
Returns the value of attribute lint_test.
-
#log_directory ⇒ Object
Returns the value of attribute log_directory.
-
#max_required_origen_version ⇒ Object
Returns the value of attribute max_required_origen_version.
-
#min_required_origen_version ⇒ Object
Returns the value of attribute min_required_origen_version.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#name ⇒ Object
Returns the value of attribute name.
-
#output_directory ⇒ Object
Returns the value of attribute output_directory.
-
#pattern_directory ⇒ Object
Returns the value of attribute pattern_directory.
-
#pattern_header ⇒ Object
Returns the value of attribute pattern_header.
-
#pattern_name_translator(name = nil, &block) ⇒ Object
Returns the value of attribute pattern_name_translator.
-
#pattern_output_directory ⇒ Object
Returns the value of attribute pattern_output_directory.
-
#pattern_postfix ⇒ Object
Returns the value of attribute pattern_postfix.
-
#pattern_prefix ⇒ Object
Returns the value of attribute pattern_prefix.
-
#proceed_with_pattern(name = nil, &block) ⇒ Object
Returns the value of attribute proceed_with_pattern.
-
#production_targets ⇒ Object
Returns the value of attribute production_targets.
-
#program_prefix ⇒ Object
Returns the value of attribute program_prefix.
-
#rc_url ⇒ Object
Returns the value of attribute rc_url.
-
#rc_workflow ⇒ Object
Returns the value of attribute rc_workflow.
-
#reference_directory ⇒ Object
Returns the value of attribute reference_directory.
-
#referenced_pattern_list ⇒ Object
Returns the value of attribute referenced_pattern_list.
-
#release_directory ⇒ Object
Returns the value of attribute release_directory.
-
#release_email_subject ⇒ Object
Returns the value of attribute release_email_subject.
-
#release_externally ⇒ Object
Returns the value of attribute release_externally.
-
#release_instructions ⇒ Object
Returns the value of attribute release_instructions.
-
#remotes ⇒ Object
Returns the value of attribute remotes.
-
#required_origen_version ⇒ Object
Returns the value of attribute required_origen_version.
-
#semantically_version ⇒ Object
Returns the value of attribute semantically_version.
-
#shared ⇒ Object
Returns the value of attribute shared.
-
#strict_errors ⇒ Object
Returns the value of attribute strict_errors.
-
#test_program_output_directory ⇒ Object
Returns the value of attribute test_program_output_directory.
-
#test_program_source_directory ⇒ Object
Returns the value of attribute test_program_source_directory.
-
#test_program_template_directory ⇒ Object
Returns the value of attribute test_program_template_directory.
-
#unmanaged_dirs ⇒ Object
Returns the value of attribute unmanaged_dirs.
-
#unmanaged_files ⇒ Object
Returns the value of attribute unmanaged_files.
-
#user_aliases ⇒ Object
Returns the value of attribute user_aliases.
-
#vault ⇒ Object
Returns the value of attribute vault.
-
#web_directory ⇒ Object
Returns the value of attribute web_directory.
-
#web_domain ⇒ Object
Returns the value of attribute web_domain.
-
#yammer_group ⇒ Object
Returns the value of attribute yammer_group.
Instance Method Summary collapse
-
#initialize(app) ⇒ Configuration
constructor
A new instance of Configuration.
- #log_deprecations ⇒ Object
- #lsf ⇒ Object
-
#method_missing(method, *_args, &_block) ⇒ Object
Prevent a new attribute from a future version of Origen from dying before the user can be prompted to upgrade.
-
#pattern_iterator {|Origen.generator.create_iterator| ... } ⇒ Object
Add a new pattern iterator.
Constructor Details
#initialize(app) ⇒ Configuration
Returns a new instance of Configuration.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/origen/application/configuration.rb', line 73 def initialize(app) @app = app @mode = Origen::Mode.new @name = 'Unknown' @initials = 'NA' @semantically_version = false @compile_only_dot_erb_files = true # Functions used here since Origen.root is not available when this is first instantiated @output_directory = -> { "#{Origen.root}/output" } @reference_directory = -> { "#{Origen.root}/.ref" } @release_directory = -> { Origen.root } @release_email_subject = false @log_directory = -> { "#{Origen.root}/log" } @pattern_name_translator = ->(name) { name } @pattern_directory = -> { "#{Origen.root}/pattern" } @pattern_output_directory = -> { "#{Origen.root}/output/patterns" } @history_file = -> { "#{Origen.root}/doc/history" } @default_lsf_action = :clear @proceed_with_pattern = ->(_name) { true } @erb_trim_mode = '%' @referenced_pattern_list = -> { "#{Origen.root}/list/referenced.list" } @copy_command = -> { Origen.running_on_windows? ? 'copy' : 'cp' } @diff_command = -> { Origen.running_on_windows? ? 'start winmerge' : 'tkdiff' } @imports = [] @imports_dev = [] @external_app_dirs = [] @unmanaged_dirs = [] @unmanaged_files = [] @remotes = [] @lint_test = {} @user_aliases = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *_args, &_block) ⇒ Object
Prevent a new attribute from a future version of Origen from dying before the user can be prompted to upgrade
200 201 202 203 |
# File 'lib/origen/application/configuration.rb', line 200 def method_missing(method, *_args, &_block) method = method.to_s.sub('=', '') puts "WARNING - unknown configuration attribute: #{method}" end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the configuration’s application instance
7 8 9 |
# File 'lib/origen/application/configuration.rb', line 7 def app @app end |
#compile_only_dot_erb_files ⇒ Object
Returns the value of attribute compile_only_dot_erb_files.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def compile_only_dot_erb_files @compile_only_dot_erb_files end |
#copy_command ⇒ Object
Returns the value of attribute copy_command.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def copy_command @copy_command end |
#default_lsf_action ⇒ Object
Returns the value of attribute default_lsf_action.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def default_lsf_action @default_lsf_action end |
#diff_command ⇒ Object
Returns the value of attribute diff_command.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def diff_command @diff_command end |
#erb_trim_mode ⇒ Object
Returns the value of attribute erb_trim_mode.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def erb_trim_mode @erb_trim_mode end |
#external_app_dirs ⇒ Object
Returns the value of attribute external_app_dirs.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def external_app_dirs @external_app_dirs end |
#gem_name ⇒ Object
Returns the value of attribute gem_name.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def gem_name @gem_name end |
#history_file ⇒ Object
Returns the value of attribute history_file.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def history_file @history_file end |
#imports ⇒ Object
Returns the value of attribute imports.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def imports @imports end |
#imports_dev ⇒ Object
Returns the value of attribute imports_dev.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def imports_dev @imports_dev end |
#initials ⇒ Object
Returns the value of attribute initials.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def initials @initials end |
#instructions ⇒ Object
Returns the value of attribute instructions.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def instructions @instructions end |
#lint_test ⇒ Object
Returns the value of attribute lint_test.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def lint_test @lint_test end |
#log_directory ⇒ Object
Returns the value of attribute log_directory.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def log_directory @log_directory end |
#max_required_origen_version ⇒ Object
Returns the value of attribute max_required_origen_version.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def max_required_origen_version @max_required_origen_version end |
#min_required_origen_version ⇒ Object
Returns the value of attribute min_required_origen_version.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def min_required_origen_version @min_required_origen_version end |
#mode ⇒ Object
Returns the value of attribute mode.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def mode @mode end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def name @name end |
#output_directory ⇒ Object
Returns the value of attribute output_directory.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def output_directory @output_directory end |
#pattern_directory ⇒ Object
Returns the value of attribute pattern_directory.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def pattern_directory @pattern_directory end |
#pattern_header ⇒ Object
Returns the value of attribute pattern_header.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def pattern_header @pattern_header end |
#pattern_name_translator(name = nil, &block) ⇒ Object
Returns the value of attribute pattern_name_translator.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def pattern_name_translator @pattern_name_translator end |
#pattern_output_directory ⇒ Object
Returns the value of attribute pattern_output_directory.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def pattern_output_directory @pattern_output_directory end |
#pattern_postfix ⇒ Object
Returns the value of attribute pattern_postfix.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def pattern_postfix @pattern_postfix end |
#pattern_prefix ⇒ Object
Returns the value of attribute pattern_prefix.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def pattern_prefix @pattern_prefix end |
#proceed_with_pattern(name = nil, &block) ⇒ Object
Returns the value of attribute proceed_with_pattern.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def proceed_with_pattern @proceed_with_pattern end |
#production_targets ⇒ Object
Returns the value of attribute production_targets.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def production_targets @production_targets end |
#program_prefix ⇒ Object
Returns the value of attribute program_prefix.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def program_prefix @program_prefix end |
#rc_url ⇒ Object
Returns the value of attribute rc_url.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def rc_url @rc_url end |
#rc_workflow ⇒ Object
Returns the value of attribute rc_workflow.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def rc_workflow @rc_workflow end |
#reference_directory ⇒ Object
Returns the value of attribute reference_directory.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def reference_directory @reference_directory end |
#referenced_pattern_list ⇒ Object
Returns the value of attribute referenced_pattern_list.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def referenced_pattern_list @referenced_pattern_list end |
#release_directory ⇒ Object
Returns the value of attribute release_directory.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def release_directory @release_directory end |
#release_email_subject ⇒ Object
Returns the value of attribute release_email_subject.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def release_email_subject @release_email_subject end |
#release_externally ⇒ Object
Returns the value of attribute release_externally.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def release_externally @release_externally end |
#release_instructions ⇒ Object
Returns the value of attribute release_instructions.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def release_instructions @release_instructions end |
#remotes ⇒ Object
Returns the value of attribute remotes.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def remotes @remotes end |
#required_origen_version ⇒ Object
Returns the value of attribute required_origen_version.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def required_origen_version @required_origen_version end |
#semantically_version ⇒ Object
Returns the value of attribute semantically_version.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def semantically_version @semantically_version end |
#shared ⇒ Object
Returns the value of attribute shared.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def shared @shared end |
#strict_errors ⇒ Object
Returns the value of attribute strict_errors.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def strict_errors @strict_errors end |
#test_program_output_directory ⇒ Object
Returns the value of attribute test_program_output_directory.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def test_program_output_directory @test_program_output_directory end |
#test_program_source_directory ⇒ Object
Returns the value of attribute test_program_source_directory.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def test_program_source_directory @test_program_source_directory end |
#test_program_template_directory ⇒ Object
Returns the value of attribute test_program_template_directory.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def test_program_template_directory @test_program_template_directory end |
#unmanaged_dirs ⇒ Object
Returns the value of attribute unmanaged_dirs.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def unmanaged_dirs @unmanaged_dirs end |
#unmanaged_files ⇒ Object
Returns the value of attribute unmanaged_files.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def unmanaged_files @unmanaged_files end |
#user_aliases ⇒ Object
Returns the value of attribute user_aliases.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def user_aliases @user_aliases end |
#vault ⇒ Object
Returns the value of attribute vault.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def vault @vault end |
#web_directory ⇒ Object
Returns the value of attribute web_directory.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def web_directory @web_directory end |
#web_domain ⇒ Object
Returns the value of attribute web_domain.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def web_domain @web_domain end |
#yammer_group ⇒ Object
Returns the value of attribute yammer_group.
9 10 11 |
# File 'lib/origen/application/configuration.rb', line 9 def yammer_group @yammer_group end |
Instance Method Details
#log_deprecations ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/origen/application/configuration.rb', line 55 def log_deprecations unless imports.empty? Origen.deprecate "App #{app.name} uses config.imports this will be removed in Origen V3 and a Gemfile/.gemspec should be used instead" end unless imports_dev.empty? Origen.deprecate "App #{app.name} uses config.imports_dev this will be removed in Origen V3 and a Gemfile/.gemspec should be used instead" end if required_origen_version Origen.deprecate "App #{app.name} uses config.required_origen_version this will be removed in Origen V3 and a Gemfile/.gemspec should be used instead" end if min_required_origen_version Origen.deprecate "App #{app.name} uses config.min_required_origen_version this will be removed in Origen V3 and a Gemfile/.gemspec should be used instead" end if max_required_origen_version Origen.deprecate "App #{app.name} uses config.max_required_origen_version this will be removed in Origen V3 and a Gemfile/.gemspec should be used instead" end end |
#lsf ⇒ Object
194 195 196 |
# File 'lib/origen/application/configuration.rb', line 194 def lsf app.lsf.configuration end |