30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/depec/cli.rb', line 30
def init
prompt = TTY::Prompt.new
initializer = Depec::Initializer.new
answers = {
ruby: prompt.yes?("? Do you want to know whether Ruby is used?: "),
ruby_version: prompt.yes?("? Do you want to know Ruby version?: "),
bundler_version: prompt.yes?("? Do you want to know Bundler version?: "),
gem_version: prompt.ask("? Gem name that do you want to know version: ", default: "rails, jekyll", convert: :array),
node: prompt.yes?("? Do you want to know whether Node.js is used?: "),
node_version: prompt.yes?("? Do you want to know Node.js version?: "),
npm_version: prompt.ask("? Npm package name that do you want to know version: ", default: "vue, react", convert: :array),
circle_ci: prompt.yes?("? Do you want to know whether CircleCI is used?: "),
circle_ci_images: prompt.yes?("? Do you want to know CircleCI images?: "),
github_actions: prompt.yes?("? Do you want to know whether GitHub Actions is used?: "),
}
config = initializer.processAnswers(answers)
File.open(Depec::DEFAULT_CONFIG_FILE, 'w+') do |f|
f.write(YAML.dump(config))
end
end
|