Class: Oxidized::Script::Command::ListModels

Inherits:
Base
  • Object
show all
Defined in:
lib/oxidized/script/commands/list-models.rb

Constant Summary collapse

Name =
'list-models'
Description =
'list supported models'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(opts = {}) ⇒ Object



8
9
10
# File 'lib/oxidized/script/commands/list-models.rb', line 8

def self.run opts={}
  puts new(opts).models
end

Instance Method Details

#modelsObject



12
13
14
15
16
17
18
19
# File 'lib/oxidized/script/commands/list-models.rb', line 12

def models
  out = ''
  models = Dir.glob File.join Config::ModelDir, '*.rb'
  models.each do |model|
    out += "%15s - %s\n" % [File.basename(model, '.rb'), model]
  end
  out
end