Class: Libis::RosettaChecker::FilesToIngestCleanup
- Inherits:
-
SubCommand
- Object
- SubCommand
- Libis::RosettaChecker::FilesToIngestCleanup
- Defined in:
- lib/libis/rosetta_checker/files_to_ingest_cleanup.rb
Instance Attribute Summary collapse
-
#cfg ⇒ Object
Returns the value of attribute cfg.
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#cursor ⇒ Object
Returns the value of attribute cursor.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#report ⇒ Object
Returns the value of attribute report.
Class Method Summary collapse
Instance Method Summary collapse
- #finalize ⇒ Object
-
#initialize(cfg) ⇒ FilesToIngestCleanup
constructor
A new instance of FilesToIngestCleanup.
- #run(argv) ⇒ Object
Methods inherited from SubCommand
help, options, parse_options, subcommands
Constructor Details
#initialize(cfg) ⇒ FilesToIngestCleanup
Returns a new instance of FilesToIngestCleanup.
37 38 39 40 41 42 43 |
# File 'lib/libis/rosetta_checker/files_to_ingest_cleanup.rb', line 37 def initialize(cfg) @cfg = cfg setup_logging setup_db end |
Instance Attribute Details
#cfg ⇒ Object
Returns the value of attribute cfg.
35 36 37 |
# File 'lib/libis/rosetta_checker/files_to_ingest_cleanup.rb', line 35 def cfg @cfg end |
#connection ⇒ Object
Returns the value of attribute connection.
35 36 37 |
# File 'lib/libis/rosetta_checker/files_to_ingest_cleanup.rb', line 35 def connection @connection end |
#cursor ⇒ Object
Returns the value of attribute cursor.
35 36 37 |
# File 'lib/libis/rosetta_checker/files_to_ingest_cleanup.rb', line 35 def cursor @cursor end |
#logger ⇒ Object
Returns the value of attribute logger.
35 36 37 |
# File 'lib/libis/rosetta_checker/files_to_ingest_cleanup.rb', line 35 def logger @logger end |
#report ⇒ Object
Returns the value of attribute report.
35 36 37 |
# File 'lib/libis/rosetta_checker/files_to_ingest_cleanup.rb', line 35 def report @report end |
Class Method Details
.command ⇒ Object
21 22 23 |
# File 'lib/libis/rosetta_checker/files_to_ingest_cleanup.rb', line 21 def self.command 'files2ingest'.freeze end |
.options_class ⇒ Object
25 26 27 |
# File 'lib/libis/rosetta_checker/files_to_ingest_cleanup.rb', line 25 def self. FilesToIngestCleanupOptions end |
.run ⇒ Object
29 30 31 32 33 |
# File 'lib/libis/rosetta_checker/files_to_ingest_cleanup.rb', line 29 def self.run super do |cfg| self.new(cfg).run(ARGV) end end |
.short_desc ⇒ Object
17 18 19 |
# File 'lib/libis/rosetta_checker/files_to_ingest_cleanup.rb', line 17 def self.short_desc 'Report on files that are/are not ingested'.freeze end |
Instance Method Details
#finalize ⇒ Object
45 46 47 48 |
# File 'lib/libis/rosetta_checker/files_to_ingest_cleanup.rb', line 45 def finalize cursor.close if cursor connection.logoff if connection end |
#run(argv) ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'lib/libis/rosetta_checker/files_to_ingest_cleanup.rb', line 50 def run(argv) raise ArgumentError, 'Need to specify at least a directory/file to parse' unless argv.size > 0 while (dir = argv.shift) process_dir dir next if argv.empty? self.class.(argv) setup_logging end end |