Lines Matching refs:options
47 def initialize(options = nil)
50 @options = UnityModuleGenerator.default_options
51 case options
52 when NilClass then @options
53 when String then @options.merge!(UnityModuleGenerator.grab_config(options))
54 when Hash then @options.merge!(options)
55 else raise 'If you specify arguments, it should be a filename or a hash of options'
59 @options[:path_src] = here + '../src/' if @options[:path_src].nil?
60 @options[:path_inc] = @options[:path_src] if @options[:path_inc].nil?
61 @options[:path_tst] = here + '../test/' if @options[:path_tst].nil?
62 @options[:path_src] += '/' unless @options[:path_src][-1] == 47
63 @options[:path_inc] += '/' unless @options[:path_inc][-1] == 47
64 @options[:path_tst] += '/' unless @options[:path_tst][-1] == 47
114 options = default_options
118 options.merge!(yaml_guts[:unity] || yaml_guts[:cmock])
119 raise "No :unity or :cmock section found in #{config_file}" unless options
121 options
131 prefix = @options[:test_prefix] || 'Test'
132 triad = [{ ext: '.c', path: @options[:path_src], prefix: '', template: TEMPLATE_SRC, inc: :src, boilerplate: @options[:boilerplates][:src] },
133 { ext: '.h', path: @options[:path_inc], prefix: '', template: TEMPLATE_INC, inc: :inc, boilerplate: @options[:boilerplates][:inc] },
134 { ext: '.c', path: @options[:path_tst], prefix: prefix, template: TEMPLATE_TST, inc: :tst, boilerplate: @options[:boilerplates][:tst] }]
137 pattern = (pattern || @options[:pattern] || 'src').downcase
156 when :src then (@options[:includes][:src] || []) | (pattern_traits[:inc].map { |f| format(f, module_name) })
157 when :inc then (@options[:includes][:inc] || [])
158 when :tst then (@options[:includes][:tst] || []) | (pattern_traits[:inc].map { |f| format("#{@options[:mock_prefix]}#{f}", module_name) })
170 case (@options[:naming])
178 case (@options[:naming])
214 if @options[:update_svn]
233 if @options[:update_svn]
252 options = {}
259 when /^-u/ then options[:update_svn] = true
260 when /^-p\"?(\w+)\"?/ then options[:pattern] = Regexp.last_match(1)
261 when /^-s\"?(.+)\"?/ then options[:path_src] = Regexp.last_match(1)
262 when /^-i\"?(.+)\"?/ then options[:path_inc] = Regexp.last_match(1)
263 when /^-t\"?(.+)\"?/ then options[:path_tst] = Regexp.last_match(1)
264 when /^-n\"?(.+)\"?/ then options[:naming] = Regexp.last_match(1)
265 when /^-y\"?(.+)\"?/ then options = UnityModuleGenerator.grab_config(Regexp.last_match(1))
278 "\nUsage: ruby generate_module [options] module_name",
303 UnityModuleGenerator.new(options).destroy(module_name)
305 UnityModuleGenerator.new(options).generate(module_name)