Class: MaskSQL::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/mask_sql/cli.rb

Instance Method Summary collapse

Instance Method Details

#initObject



36
37
38
# File 'lib/mask_sql/cli.rb', line 36

def init
  puts Initializer.copy_template
end

#maskObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/mask_sql/cli.rb', line 17

def mask
  return unless validate_options

  converter_options = options.dup

  if options[:config]
    converter_options[:config] = File.expand_path(options[:config])
  else
    default_config = File.expand_path('.mask.yml')
    converter_options[:config] = default_config if File.exist?(default_config)
  end

  converter = Converter.new(converter_options)
  converter.mask
  puts "\e[32mDone.\e[0m"
end

#versionObject



43
44
45
# File 'lib/mask_sql/cli.rb', line 43

def version
  puts "mask_sql #{MaskSQL::VERSION}"
end