Class: Timber::CLI::Installers::ConfigFile

Inherits:
Timber::CLI::Installer
  • Object
show all
Defined in:
lib/timber/cli/installers/config_file.rb

Instance Method Summary collapse

Instance Method Details

#run(app, path) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/timber/cli/installers/config_file.rb', line 14

def run(app, path)
  config_file = Timber::CLI::ConfigFile.new(path, file_helper)

  if config_file.exists?
    io.puts ""
    io.task_complete("#{config_file.path} already created")
    return true
  end

  if logrageify?
    config_file.logrageify!
  end

  io.puts ""
  task_message = "Creating #{config_file.path}"
  io.task(task_message) { config_file.create! }
end