class SolrMakr::Commands::WriteYaml

Constants

STDOUT_OUTPUTS

Public Instance Methods

execute() click to toggle source
# File lib/solr_makr/commands/write_yaml.rb, line 13
def execute
  if output_to_stdout?
    buffer.write sunspot_configuration.to_yaml
  else
    File.open(output, 'w') do |f|
      YAML.dump sunspot_configuration, f
    end

    buffer.ok "Wrote configuration to #{output}"
  end
end
output_to_stdout?() click to toggle source
# File lib/solr_makr/commands/write_yaml.rb, line 25
def output_to_stdout?
  if given?(:output)
    output.in?(STDOUT_OUTPUTS)
  else
    true
  end
end