Class: EtnaApp::Administrate::Models::Attributes::CreateFileLinkingCsv
- Inherits:
-
Etna::Command
- Object
- Etna::Command
- EtnaApp::Administrate::Models::Attributes::CreateFileLinkingCsv
- Includes:
- WithEtnaClients
- Defined in:
- lib/commands.rb
Instance Attribute Summary
Attributes inherited from Etna::Command
Instance Method Summary collapse
Methods included from WithEtnaClients
#environment, #exit, exit, #janus_client, #magma_client, #metis_client, #polyphemus_client, #token
Methods inherited from Etna::Command
#completions, #fill_in_missing_params, #find_command, #initialize, parent_scope, #setup
Methods included from Etna::CommandOrExecutor
#command_name, #completions_for, #desc, #flag_argspec, #flag_as_parameter, included, #parse_flags, #program_name, #usage
Constructor Details
This class inherits a constructor from Etna::Command
Instance Method Details
#execute(project_name, bucket_name, attribute_name, extension, collection: false, regex: "**/*/(?<identifier>.+)\\.#{extension}$", folder: "", file: "#{project_name}_#{attribute_name}.csv") ⇒ Object
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
# File 'lib/commands.rb', line 281 def execute(project_name, bucket_name, attribute_name, extension, collection: false, regex: "**/*/(?<identifier>.+)\\.#{extension}$", folder: "", file: "#{project_name}_#{attribute_name}.csv") if folder.start_with?("/") folder = folder.slice(1..-1) end regex = Regexp.new(regex) workflow = Etna::Clients::Magma::SimpleFileLinkingWorkflow.new( metis_client: metis_client, project_name: project_name, bucket_name: bucket_name, folder: folder, extension: extension, attribute_name: attribute_name, regex: regex, file_collection: collection, ) workflow.write_csv_io(filename: file) end |