lib/ctioga2/data/backends/backends/text.rb in ctioga2-0.6.1 vs lib/ctioga2/data/backends/backends/text.rb in ctioga2-0.7

- old
+ new

@@ -23,11 +23,11 @@ # For separated sets require 'stringio' module CTioga2 - Version::register_svn_info('$Revision: 493 $', '$Date: 2013-09-03 22:11:38 +0200 (Tue, 03 Sep 2013) $') + Version::register_svn_info('$Revision: 524 $', '$Date: 2013-09-22 16:18:39 +0200 (Sun, 22 Sep 2013) $') module Data # A module for easy use of NaN in operations @@ -148,11 +148,16 @@ a.upto(b) do |i| ret << m.pre_match + i.to_s + trail + m.post_match end return ret else - return super + m = Dir::glob(spec) + if m.size > 0 + return m + else + return super + end end end protected @@ -378,11 +383,15 @@ debug { "Using formula #{formula} for column spec: #{column}" } return Dvector.compute_formula(formula, @current_data, @included_modules) else - return @current_data[column.to_i].dup + if @current_data[column.to_i] + return @current_data[column.to_i].dup + else + raise "Cannot find column number #{column.to_i} -- maybe you got the column separator wrong ?" + end end end # # Turns a target => values specification into something usable as # # error bars, that is :xmin, :xmax and the like hashes. The rules @@ -423,9 +432,10 @@ # end # return target # end end + end end end