lib/activefacts/input/cql.rb in activefacts-cql-1.8.3 vs lib/activefacts/input/cql.rb in activefacts-cql-1.9.1
- old
+ new
@@ -10,12 +10,13 @@
module Input #:nodoc:
# Compile CQL to an ActiveFacts vocabulary.
# Invoke as
# afgen --<generator> <file>.cql
class CQL
+ EXTENSIONS = ['fiml', 'fidl', 'fiql', 'cql']
# Read the specified file
def self.readfile(filename)
- if File.basename(filename, '.cql') == "-"
+ if EXTENSIONS.detect { |extension| File.basename(filename, extension) == "-" }
read(STDIN, "<standard input>")
else
File.open(filename) {|file|
read(file, filename)
}