Module: SolrMakr::Commands::AbstractCommand Private

Extended by:
ActiveSupport::Concern
Includes:
BufferInteraction, Utility
Included in:
CreateCollection, DeleteCollection, FetchCollectionList, PushConfig, ReloadCollection, SetUpLocalConfiguration, WriteYaml, SolrMakr::Configsets::LookupDependentCollections
Defined in:
lib/solr_makr/commands/abstract_command.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Constant Summary

Constants included from Utility

Utility::REQUIRED_SOLR_NODES

Instance Attribute Summary

Attributes included from BufferInteraction

#buffer

Instance Method Summary collapse

Methods included from Utility

default_table, default_table_options!, hash_to_table, looks_like_a_valid_configset?, path_to_configset

Methods included from BufferInteraction

#build_buffer, #compose_buffer

Instance Method Details

#expect_success!(response, success_message: nil, error_message: nil, halt_on_error: true, &on_failure) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/solr_makr/commands/abstract_command.rb', line 30

def expect_success!(response, success_message: nil, error_message: nil, halt_on_error: true, &on_failure)
  if response.success?
    if success_message.present?
      buffer.ok success_message
    end
  else
    errors.add '[solr]', response.failure

    buffer.exit_status = 1

    if error_message.present?
      buffer.logger.error error_message
    elsif block_given?
      yield response
    end

    throw :interrupt, response if halt_on_error
  end

  return response
end

#fetch_configset(name) ⇒ SolrMakr::Configsets::Directory

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



17
18
19
# File 'lib/solr_makr/commands/abstract_command.rb', line 17

def fetch_configset(name)
  SolrMakr.local_configuration.configsets[name]
end

#local_configurationObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



21
22
23
# File 'lib/solr_makr/commands/abstract_command.rb', line 21

def local_configuration
  SolrMakr::LocalConfiguration
end