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
29
30
# 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('.')
    f.puts('--ignore=/tmp/')
    f.puts('--ignore=/vendor/bundle')
  end
end

.output_fileObject



32
33
34
# File 'lib/create-config.rb', line 32

def self.output_file
  SORBET_CONFIG_FILE
end