Class: AstroSubframeOrganizer::Commands::Organize::Base

Inherits:
Dry::CLI::Command
  • Object
show all
Includes:
EquipmentOptions, SharedOptions
Defined in:
lib/astro_subframe_organizer/commands/organize/base.rb

Direct Known Subclasses

Bias, Darks, Flats, Lights

Instance Attribute Summary

Attributes included from EquipmentOptions

#equipment_selector

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EquipmentOptions

included, #set_equipment

Methods included from SharedOptions

included, #setup

Class Method Details

.inherited(subclass) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/astro_subframe_organizer/commands/organize/base.rb', line 11

def self.inherited(subclass)
  super
  # rubocop:disable Layout/LineLength
  subclass.example [
    '# Default - interactive menu using default configuration file in the current directory',
    '--path /Volumes/Sirius/staging/ # organize files under specified directory',
    '--config ~/galaxy-season-config.yml # interactive menu using specified configuration',
    '--telescope RedCat51 --camera 183MC --filter BaaderMoon --skip-confirm # organize using the specified equipment, no confirmation prompts',
    "--telescope 'William Optics RedCat51' --camera 'ZWO ASI183MC Pro' --filter 'Baader Moon & Skyglow' --skip-confirm # equipment with spaces or special characters require quotes",
  ]
  # rubocop:enable Layout/LineLength
end

Instance Method Details

#call(dry_run: false, path: Dir.pwd, **options) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/astro_subframe_organizer/commands/organize/base.rb', line 24

def call(dry_run: false, path: Dir.pwd, **options)
  setup(**options.slice(:config, :verbose, :skip_confirm))
  set_equipment(**options.slice(:telescope, :camera, :filter))

  Organizer.new(
    type: frame_type,
    path: path,
    equipment_selector: equipment_selector,
  ).organize(dry_run: dry_run)
end