Class: MiGA::MiGA
- Inherits:
-
Object
- Object
- MiGA::MiGA
- Extended by:
- Common::Format, Common::Path
- Defined in:
- lib/miga/common.rb,
lib/miga/version.rb,
lib/miga/common/base.rb
Overview
Generic class used to handle system-wide information and methods, and parent of all other MiGA::* classes.
Direct Known Subclasses
Daemon, Dataset, Metadata, Project, RemoteDataset, Result, TaxIndex, TaxIndexTaxon, Taxonomy
Constant Summary
Constants included from MiGA
CITATION, VERSION, VERSION_DATE, VERSION_NAME
Class Method Summary collapse
-
.CITATION ⇒ Object
Reference of MiGA.
-
.DEBUG(*args) ⇒ Object
Send debug message.
-
.DEBUG_OFF ⇒ Object
Turn off debugging.
-
.DEBUG_ON ⇒ Object
Turn on debugging.
-
.DEBUG_TRACE_OFF ⇒ Object
Turn off debug tracing (but not debugging).
-
.DEBUG_TRACE_ON ⇒ Object
Turn on debug tracing (and debugging).
-
.FULL_VERSION ⇒ Object
Complete version as string.
-
.initialized? ⇒ Boolean
Has MiGA been initialized?.
-
.LONG_VERSION ⇒ Object
Complete version with nickname and date as string.
-
.VERSION ⇒ Object
Major.minor version as Float.
-
.VERSION_DATE ⇒ Object
Date of the current gem release.
Instance Method Summary collapse
-
#result_files_exist?(base, ext) ⇒ Boolean
Check if the result files exist with
base
name (String) followed by theext
values (Array of String).
Methods included from Common::Path
Methods included from Common::Format
clean_fasta_file, seqs_length, tabulate
Class Method Details
.CITATION ⇒ Object
Reference of MiGA.
56 |
# File 'lib/miga/version.rb', line 56 def self.CITATION ; CITATION ; end |
.DEBUG(*args) ⇒ Object
Send debug message.
29 30 31 32 33 |
# File 'lib/miga/common/base.rb', line 29 def DEBUG(*args) $stderr.puts(*args) if @@DEBUG $stderr.puts( caller.map{ |v| v.gsub(/^/,' ') }.join("\n") ) if @@DEBUG_TRACE end |
.DEBUG_OFF ⇒ Object
Turn off debugging.
12 |
# File 'lib/miga/common/base.rb', line 12 def DEBUG_OFF ; @@DEBUG=false end |
.DEBUG_ON ⇒ Object
Turn on debugging.
8 |
# File 'lib/miga/common/base.rb', line 8 def DEBUG_ON ; @@DEBUG=true end |
.DEBUG_TRACE_OFF ⇒ Object
Turn off debug tracing (but not debugging).
23 24 25 |
# File 'lib/miga/common/base.rb', line 23 def DEBUG_TRACE_OFF @@DEBUG_TRACE=false end |
.DEBUG_TRACE_ON ⇒ Object
Turn on debug tracing (and debugging).
16 17 18 19 |
# File 'lib/miga/common/base.rb', line 16 def DEBUG_TRACE_ON @@DEBUG_TRACE=true DEBUG_ON() end |
.FULL_VERSION ⇒ Object
Complete version as string.
42 |
# File 'lib/miga/version.rb', line 42 def self.FULL_VERSION ; VERSION.join(".") ; end |
.initialized? ⇒ Boolean
Has MiGA been initialized?
24 25 26 27 |
# File 'lib/miga/common.rb', line 24 def self.initialized? File.exist?(File.('.miga_rc', ENV['MIGA_HOME'])) and File.exist?(File.('.miga_daemon.json', ENV['MIGA_HOME'])) end |
.LONG_VERSION ⇒ Object
Complete version with nickname and date as string.
46 47 48 |
# File 'lib/miga/version.rb', line 46 def self.LONG_VERSION "MiGA #{VERSION.join(".")} - #{VERSION_NAME} - #{VERSION_DATE}" end |
.VERSION ⇒ Object
Major.minor version as Float.
38 |
# File 'lib/miga/version.rb', line 38 def self.VERSION ; VERSION[0] ; end |
.VERSION_DATE ⇒ Object
Date of the current gem release.
52 |
# File 'lib/miga/version.rb', line 52 def self.VERSION_DATE ; VERSION_DATE ; end |
Instance Method Details
#result_files_exist?(base, ext) ⇒ Boolean
Check if the result files exist with base
name (String) followed by the ext
values (Array of String).
32 33 34 35 36 37 |
# File 'lib/miga/common.rb', line 32 def result_files_exist?(base, ext) ext = [ext] unless ext.is_a? Array ext.all? do |f| File.exist?(base + f) or File.exist?("#{base}#{f}.gz") end end |