Class: Rdm::CLI::Config
- Inherits:
-
Object
- Object
- Rdm::CLI::Config
- Defined in:
- lib/rdm/cli/config.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(current_path, config_name, config_data, stdout) ⇒ Config
constructor
A new instance of Config.
- #run ⇒ Object
Constructor Details
#initialize(current_path, config_name, config_data, stdout) ⇒ Config
Returns a new instance of Config.
6 7 8 9 10 11 |
# File 'lib/rdm/cli/config.rb', line 6 def initialize(current_path, config_name, config_data, stdout) @current_path = current_path @config_name = config_name @config_data = config_data @stdout = stdout end |
Class Method Details
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rdm/cli/config.rb', line 13 def run generated_files = Rdm::Gen::Config.generate( current_path: @current_path, config_name: @config_name, config_data: @config_data ) puts "Following files were generated:" puts generated_files rescue Errno::ENOENT => e @stdout.puts "Error occurred. Possible reasons:\n #{Rdm::SOURCE_FILENAME} not found. Please run on directory containing #{Rdm::SOURCE_FILENAME} \n#{e.inspect}" rescue NoMethodError => e @stdout.puts e. rescue Rdm::Errors::SourceFileDoesNotExist => e @stdout.puts "Rdm.packages was not found. Run 'rdm init' to create it" rescue Rdm::Errors::ConfigExists => e @stdout.puts "Config :#{e.} already exists! Use other name" end |