Class: Autoproj::CLI::Versions
- Inherits:
-
InspectionTool
- Object
- Base
- InspectionTool
- Autoproj::CLI::Versions
- Defined in:
- lib/autoproj/cli/versions.rb
Constant Summary collapse
- DEFAULT_VERSIONS_FILE_BASENAME =
Ops::Snapshot::DEFAULT_VERSIONS_FILE_BASENAME
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #default_versions_file ⇒ Object
- #run(user_selection, options) ⇒ Object
- #validate_options(packages, options = Hash.new) ⇒ Object
Methods inherited from InspectionTool
#finalize_setup, #initialize_and_load
Methods inherited from Base
#export_env_sh, #initialize, #normalize_command_line_package_selection, #notify_env_sh_updated, #resolve_selection, #resolve_user_selection, validate_options, #validate_user_selection
Methods included from Ops::Tools
#common_options, #create_autobuild_package, #load_autoprojrc, #load_main_initrb
Constructor Details
This class inherits a constructor from Autoproj::CLI::Base
Instance Method Details
#default_versions_file ⇒ Object
11 12 13 |
# File 'lib/autoproj/cli/versions.rb', line 11 def default_versions_file File.join(ws.overrides_dir, DEFAULT_VERSIONS_FILE_BASENAME) end |
#run(user_selection, options) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/autoproj/cli/versions.rb', line 30 def run(user_selection, ) initialize_and_load packages, *, config_selected = finalize_setup(user_selection, recursive: [:deps]) ops = Ops::Snapshot.new(ws.manifest, keep_going: [:keep_going]) if user_selection.empty? snapshot_package_sets = ([:config] != false) snapshot_packages = ![:config] elsif config_selected snapshot_package_sets = true snapshot_packages = user_selection.size > 1 else snapshot_package_sets = [:config] snapshot_packages = true end versions = Array.new if snapshot_package_sets versions += ops.snapshot_package_sets(nil, only_local: [:only_local]) end if snapshot_packages versions += ops.snapshot_packages(packages, nil, only_local: [:only_local], fingerprint: [:fingerprint]) end if (output_file = [:save]) ops.save_versions(versions, output_file, replace: [:replace]) else versions = ops.sort_versions(versions) puts YAML.dump(versions) end end |
#validate_options(packages, options = Hash.new) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/autoproj/cli/versions.rb', line 15 def (packages, = Hash.new) packages, = super unless [:save].nil? [:save] = case [:save] when "." nil when "save" default_versions_file else [:save].to_str end end [packages, ] end |