- cmock now accepts any combo of yaml and command line options, applying them in the order they appear on the command line (thanks kylebhamilton for the suggestion!)

This commit is contained in:
Mark VanderVoord
2014-05-21 15:26:43 -04:00
parent 11db2a22a3
commit 85fa655023
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ if ($0 == __FILE__)
filelist = []
ARGV.each do |arg|
if (arg =~ /^-o\"?([a-zA-Z0-9._\\\/:\s]+)\"?/)
options = arg.gsub(/^-o/,'')
options.merge CMockConfig.load_config_file_from_yaml( arg.gsub(/^-o/,'') )
elsif (arg =~ /^--([a-zA-Z0-9._\\\/:\s]+)=\"?([a-zA-Z0-9._\\\/:\s\;]+)\"?/)
options = option_maker(options, $1, $2)
else
+4
View File
@@ -67,6 +67,10 @@ class CMockConfig
end
def load_config_file_from_yaml yaml_filename
self.class.load_config_file_from_yaml yaml_filename
end
def self.load_config_file_from_yaml yaml_filename
require 'yaml'
require 'fileutils'
YAML.load_file(yaml_filename)[:cmock]