Class: CodeFormatter::Initializer
- Inherits:
-
Object
- Object
- CodeFormatter::Initializer
- Defined in:
- lib/src/initializer.rb
Class Method Summary collapse
Class Method Details
.init ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/src/initializer.rb', line 6 def self.init config = File.read(File.('../resources/sample_config.config', __FILE__)) if File.file? SAMPLE_CONFIG_FILE warn %(ERROR: Initialization failed. There is already exists some #{SAMPLE_CONFIG_FILE}) else Dir.mkdir(SAMPLE_CONFIG_DIR) unless Dir.exist?(SAMPLE_CONFIG_DIR) File.write(File.join(SAMPLE_CONFIG_DIR, SAMPLE_CONFIG_FILE), config) end end |
.initialized_config ⇒ Object
16 17 18 19 |
# File 'lib/src/initializer.rb', line 16 def self.initialized_config return SAMPLE_CONFIG_FILE if File.exist?(SAMPLE_CONFIG_FILE) File.join(SAMPLE_CONFIG_DIR, SAMPLE_CONFIG_FILE) end |