Class: Sneaql::Core::Commands::SneaqlRecordsetFromDirGlob

Inherits:
SneaqlCommand
  • Object
show all
Defined in:
lib/sneaql_lib/core.rb

Overview

stores all the file paths matching the dir glob into a recordset

Instance Method Summary collapse

Methods inherited from SneaqlCommand

#arg_definition, #initialize, #valid_expression?, #valid_operator?, #valid_recordset?, #valid_symbol?, #valid_variable?, #validate_args

Constructor Details

This class inherits a constructor from Sneaql::Core::SneaqlCommand

Instance Method Details

#action(recordset_name, dirglob) ⇒ Object

Parameters:

  • recordset_name (String)
  • dirglob (String)

    directory glob with optional wildcards



380
381
382
383
384
385
386
387
# File 'lib/sneaql_lib/core.rb', line 380

def action(recordset_name, dirglob)
  r = Dir.glob(dirglob)
  r.map! { |d| { 'path_name' => d.to_s } }
  @logger.debug "adding #{r.length} recs as #{recordset_name}"
  @recordset_manager.store_recordset(recordset_name, r)
rescue => e
  @exception_manager.pending_error = e
end