diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/opentox.rb | 3 | ||||
-rw-r--r-- | lib/overwrite.rb | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/opentox.rb b/lib/opentox.rb index 9564e9c..ad18e60 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -1,7 +1,8 @@ # defaults to stderr, may be changed to file output (e.g in opentox-service) $logger = OTLogger.new(STDERR) $logger.level = Logger::DEBUG - +#$logger.level = ENV['RACK_ENV'] == 'production' ? Logger::ERROR : Logger::DEBUG + module OpenTox #include RDF CH: leads to namespace clashes with URI class diff --git a/lib/overwrite.rb b/lib/overwrite.rb index c96c2d8..6e95165 100644 --- a/lib/overwrite.rb +++ b/lib/overwrite.rb @@ -6,6 +6,11 @@ class Object respond_to?(:empty?) ? empty? : !self end + # Returns dimension of nested arrays + def dimension + self.class == Array ? 1 + self[0].dimension : 0 + end + def numeric? true if Float(self) rescue false end |