Class: Sorbet::Private::CreateConfig

Inherits:
Object
  • Object
show all
Includes:
StepInterface
Defined in:
lib/create-config.rb

Constant Summary collapse

SORBET_DIR =
'sorbet'
SORBET_CONFIG_FILE =
"#{SORBET_DIR}/config"

Class Method Summary collapse

Class Method Details

.mainObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/create-config.rb', line 16

def self.main
  FileUtils.mkdir_p(SORBET_DIR)

  if File.file?(SORBET_CONFIG_FILE)
    puts "Reusing existing config file: #{SORBET_CONFIG_FILE}"
    return
  end

  File.open(SORBET_CONFIG_FILE, 'w') do |f|
    f.puts('--dir')
    f.puts('.')
  end
end

.output_fileObject



30
31
32
# File 'lib/create-config.rb', line 30

def self.output_file
  SORBET_CONFIG_FILE
end