#! /usr/bin/ruby require 'pathname' require 'optparse' $options = {} oparser = OptionParser.new oparser.banner = < b.name} end # do nothing ... def maybe_load_rails_models end # ... unless this is included # require 'clevic/rails_models_loader.rb' def load_single_model_file( pathname ) ( pathname + '.rb' ).require_if_exists pathname.require_if_exists ( pathname + '_models' ).require_if_exists ( pathname + '_models.rb' ).require_if_exists end def load_models( pathname ) if pathname.directory? maybe_load_rails_models else # assume we have a single file, and try some variations load_single_model_file( pathname ) end end begin Clevic::Browser.run( args ) rescue Exception => e puts e.message puts e.backtrace end