Sha256: 266d53edb288dd2bc86dd5cca36345732ebb489f8add435389595ad768ee2091

Contents?: true

Size: 581 Bytes

Versions: 2

Compression:

Stored size: 581 Bytes

Contents

module Oxidized
  class Script
    module Command
      class ListModels
        Name        = 'list-models'
        Description = 'list supported models'

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

        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

        private

        def initialize opts={}
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
oxidized-script-0.0.4 lib/oxidized/script/commands/list-models.rb
oxidized-script-0.0.3 lib/oxidized/script/commands/list-models.rb