Class: Yard::Lint::ConfigGenerator
- Inherits:
-
Object
- Object
- Yard::Lint::ConfigGenerator
- Defined in:
- lib/yard/lint/config_generator.rb
Overview
Generates default .yard-lint.yml configuration file
Constant Summary collapse
- TEMPLATES_DIR =
Path to templates directory
File.('templates', __dir__)
Class Method Summary collapse
-
.generate(force: false, strict: false) ⇒ Boolean
Generate .yard-lint.yml file in current directory.
Class Method Details
.generate(force: false, strict: false) ⇒ Boolean
Generate .yard-lint.yml file in current directory
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/yard/lint/config_generator.rb', line 14 def self.generate(force: false, strict: false) config_path = File.join(Dir.pwd, Config::DEFAULT_CONFIG_FILE) if File.exist?(config_path) && !force false else template_name = strict ? 'strict_config.yml' : 'default_config.yml' template_path = File.join(TEMPLATES_DIR, template_name) content = File.read(template_path) File.write(config_path, content) true end end |