lib/origen/generator/job.rb in origen-0.55.3 vs lib/origen/generator/job.rb in origen-0.55.4

- old
+ new

@@ -1,11 +1,11 @@ module Origen class Generator # A job is responsible for executing a single pattern source class Job # :nodoc: all attr_accessor :output_file_body, :pattern - attr_reader :split_counter + attr_reader :split_counter, :split_names attr_reader :options def initialize(pattern, options) @testing = options[:testing] @options = options @@ -21,13 +21,15 @@ def no_comments? @no_comments end - def inc_split_counter + def inc_split_counter(name = '') @split_counter ||= 0 + @split_names ||= [''] @split_counter += 1 + @split_names << name end def requested_pattern @requested_pattern end @@ -113,10 +115,14 @@ nil end def split_number if split_counter - "_part#{split_counter}" + if split_names[split_counter] != '' + "_#{split_names[split_counter]}" + else + "_part#{split_counter}" + end else '' end end