Class: Pure::Extractor::Commands::PureExtractorCommand

Inherits:
PureCommand
  • Object
show all
Defined in:
lib/pure/extractor/commands/pure_extractor.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/pure/extractor/commands/pure_extractor.rb', line 25

def execute
  
  puree_config = {
      url: server,
      username: username,
      password: password,
      collection: pure_collections[extract],
      chunk_size: chunk_size,
      output_directory: output_dir,
      delay: request_delay?
  }

  if interactive?

    Pure::Extractor::Extractors::InteractiveExtractor.set_config puree_config
    Pure::Extractor::Extractors::InteractiveExtractor.extract

  else

    Pure::Extractor::Extractors::LoggingExtractor.set_config puree_config
    Pure::Extractor::Extractors::LoggingExtractor.extract

  end


  
end

#pure_collectionsObject



21
22
23
# File 'lib/pure/extractor/commands/pure_extractor.rb', line 21

def pure_collections
  {organisation: :organisation, people: :person, projects: :project, publications: :publication, datasets: :dataset}
end