Class: Semverve::ResolvedConfiguration
- Inherits:
-
Object
- Object
- Semverve::ResolvedConfiguration
- Defined in:
- lib/semverve/configuration.rb
Overview
Immutable configuration with all project defaults resolved.
Instance Attribute Summary collapse
-
#bundle_lock ⇒ Boolean
readonly
Whether increments should run
bundle lockafter writing a version. -
#command_runner ⇒ #call
readonly
Callable used to run shell commands such as
bundle lock. -
#format ⇒ Symbol
readonly
Resolved version-file format.
-
#gem_name ⇒ String
readonly
Resolved gem name.
-
#module_name ⇒ String
readonly
Resolved Ruby module name.
-
#root ⇒ String
readonly
Absolute project root.
-
#version_checks ⇒ Array<Symbol>
readonly
Resolved version-maintenance surfaces run by umbrella tasks.
-
#version_code_reference_files ⇒ Rake::FileList
readonly
Resolved code files to scan for safe version literals.
-
#version_code_reference_pattern ⇒ Regexp
readonly
Resolved code pattern used to scan safe version literals.
-
#version_doc_reference_files ⇒ Rake::FileList
readonly
Resolved documentation files to scan for version references.
-
#version_file ⇒ String
readonly
Resolved version-file path relative to the project root.
-
#version_reference_mode ⇒ Symbol
readonly
Resolved version-reference comparison mode.
Instance Method Summary collapse
-
#absolute_version_file ⇒ String
Absolute path to the resolved version file.
-
#initialize(bundle_lock:, command_runner:, format:, gem_name:, module_name:, root:, version_file:, version_checks:, version_code_reference_files:, version_code_reference_pattern:, version_doc_reference_files:, version_reference_mode:) ⇒ Semverve::ResolvedConfiguration
constructor
Initializes a resolved configuration.
Constructor Details
#initialize(bundle_lock:, command_runner:, format:, gem_name:, module_name:, root:, version_file:, version_checks:, version_code_reference_files:, version_code_reference_pattern:, version_doc_reference_files:, version_reference_mode:) ⇒ Semverve::ResolvedConfiguration
Initializes a resolved configuration.
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 |
# File 'lib/semverve/configuration.rb', line 435 def initialize( bundle_lock:, command_runner:, format:, gem_name:, module_name:, root:, version_file:, version_checks:, version_code_reference_files:, version_code_reference_pattern:, version_doc_reference_files:, version_reference_mode: ) @bundle_lock = bundle_lock @command_runner = command_runner @format = format @gem_name = gem_name @module_name = module_name @root = root @version_file = version_file @version_checks = version_checks @version_code_reference_files = version_code_reference_files @version_code_reference_pattern = version_code_reference_pattern @version_doc_reference_files = version_doc_reference_files @version_reference_mode = version_reference_mode end |
Instance Attribute Details
#bundle_lock ⇒ Boolean (readonly)
Whether increments should run bundle lock after writing a version.
350 351 352 |
# File 'lib/semverve/configuration.rb', line 350 def bundle_lock @bundle_lock end |
#command_runner ⇒ #call (readonly)
Callable used to run shell commands such as bundle lock.
356 357 358 |
# File 'lib/semverve/configuration.rb', line 356 def command_runner @command_runner end |
#format ⇒ Symbol (readonly)
Resolved version-file format.
362 363 364 |
# File 'lib/semverve/configuration.rb', line 362 def format @format end |
#gem_name ⇒ String (readonly)
Resolved gem name.
368 369 370 |
# File 'lib/semverve/configuration.rb', line 368 def gem_name @gem_name end |
#module_name ⇒ String (readonly)
Resolved Ruby module name.
374 375 376 |
# File 'lib/semverve/configuration.rb', line 374 def module_name @module_name end |
#root ⇒ String (readonly)
Absolute project root.
380 381 382 |
# File 'lib/semverve/configuration.rb', line 380 def root @root end |
#version_checks ⇒ Array<Symbol> (readonly)
Resolved version-maintenance surfaces run by umbrella tasks.
392 393 394 |
# File 'lib/semverve/configuration.rb', line 392 def version_checks @version_checks end |
#version_code_reference_files ⇒ Rake::FileList (readonly)
Resolved code files to scan for safe version literals.
398 399 400 |
# File 'lib/semverve/configuration.rb', line 398 def version_code_reference_files @version_code_reference_files end |
#version_code_reference_pattern ⇒ Regexp (readonly)
Resolved code pattern used to scan safe version literals.
404 405 406 |
# File 'lib/semverve/configuration.rb', line 404 def version_code_reference_pattern @version_code_reference_pattern end |
#version_doc_reference_files ⇒ Rake::FileList (readonly)
Resolved documentation files to scan for version references.
410 411 412 |
# File 'lib/semverve/configuration.rb', line 410 def version_doc_reference_files @version_doc_reference_files end |
#version_file ⇒ String (readonly)
Resolved version-file path relative to the project root.
386 387 388 |
# File 'lib/semverve/configuration.rb', line 386 def version_file @version_file end |
#version_reference_mode ⇒ Symbol (readonly)
Resolved version-reference comparison mode.
416 417 418 |
# File 'lib/semverve/configuration.rb', line 416 def version_reference_mode @version_reference_mode end |
Instance Method Details
#absolute_version_file ⇒ String
Absolute path to the resolved version file.
467 468 469 |
# File 'lib/semverve/configuration.rb', line 467 def absolute_version_file File.(version_file, root) end |