Class: Scatter::Commands::Init

Inherits:
Scatter::Command show all
Defined in:
lib/scatter/commands/init.rb

Instance Method Summary collapse

Methods inherited from Scatter::Command

command_name, help, inherited, #initialize, usage

Constructor Details

This class inherits a constructor from Scatter::Command

Instance Method Details

#execute!Object



11
12
13
14
15
16
# File 'lib/scatter/commands/init.rb', line 11

def execute!
  FileUtils.mkdir_p File.dirname(Scatter::Config.file_name)
  unless File.exists?(Scatter::Config.file_name)
    File.open(Scatter::Config.file_name, 'w') { |file| file.puts({}.to_yaml) }
  end
end