Module: RutemaWeb

Defined in:
lib/rutemaweb/main.rb

Overview

This is the web frontend for Rutema databases.

Defined Under Namespace

Modules: Version

Class Method Summary collapse

Class Method Details

.parse_command_line(args) ⇒ Object

Parses the command line arguments



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/rutemaweb/main.rb', line 25

def self.parse_command_line args
  args.options do |opt|
    opt.on("Usage:")
    opt.on("rutemaweb [options] database_file")
    opt.on("Options:")
    opt.on("--debug", "-d","Turns on debug messages") { $DEBUG=true }
    opt.on("-v", "--version","Displays the version") { $stdout.puts("v#{Version::STRING}");exit 0 }
    opt.on("--help", "-h", "-?", "This text") { $stdout.puts opt; exit 0 }
    opt.parse!
    #and now the rest
    if args.empty?
      $stdout.puts opt 
      exit 0
    else
      return args.shift
    end
  end
end

.start_ramazeObject

Starts Ramaze



16
17
18
19
20
21
22
23
# File 'lib/rutemaweb/main.rb', line 16

def self.start_ramaze
  logger=Patir.setup_logger
  db_file=parse_command_line(ARGV)
  db_file=File.expand_path(db_file)
  Rutema.connect_to_ar(db_file,logger)  
  Rutema::UI.ramaze_settings
  Ramaze.start :force=>true
end