Module: SolrMakr::Commands::Shared Private

Extended by:
ActiveSupport::Concern
Included in:
CreateCore, DestroyCore, ListCores, WriteYaml
Defined in:
lib/solr_makr/commands/shared.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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#args<String> (readonly)

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.

Returns:

  • (<String>)


20
21
22
# File 'lib/solr_makr/commands/shared.rb', line 20

def args
  @args
end

#coreSolrMakr::Core (readonly)

Returns:



58
59
60
61
62
63
64
# File 'lib/solr_makr/commands/shared.rb', line 58

attr_lazy_reader :core do
  core_name = args[config.core_name_index]

  if core_name.present? || config.acts_on_single_core
    solr_config.core(name: core_name)
  end
end

#optionsStruct (readonly)

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.

Returns:

  • (Struct)


24
25
26
# File 'lib/solr_makr/commands/shared.rb', line 24

def options
  @options
end

#solr_configSolrMakr::SolrConfiguration (readonly)



16
17
18
# File 'lib/solr_makr/commands/shared.rb', line 16

def solr_config
  @solr_config
end

Instance Method Details

#runvoid

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.

This method is abstract.

This method returns an undefined value.

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/solr_makr/commands/shared.rb', line 32

def run
  raise NotImplementedError, "Must implement #run"
end

#run!(args, options) ⇒ void

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.

This method returns an undefined value.



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/solr_makr/commands/shared.rb', line 37

def run!(args, options)
  @args     = args
  @options  = options

  options.default shared_options

  solr_config.home = options.solr_home
  solr_config.host = options.solr_host
  solr_config.port = options.solr_port

  run
end

#with_message(message, &block) ⇒ 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.



66
67
68
69
70
71
72
# File 'lib/solr_makr/commands/shared.rb', line 66

def with_message(message, &block)
  retval = yield

  if retval != false && options.verbose
    say message
  end
end