Sha256: ad8a57825db88df249cecd4c18984435cb330e79593a650072a0cc227682df2b

Contents?: true

Size: 792 Bytes

Versions: 8

Compression:

Stored size: 792 Bytes

Contents

$knjpath = "knj/" if !$knjpath

module Knj
  CONFIG = {}
  
  def self.const_missing(name)
    if name == "db"
      filepath = "#{$knjpath}/knjdb/libknjdb"
    else
      filepath = "#{$knjpath}#{name.to_s.downcase}"
    end
    
    require filepath
    raise "Constant still not defined: '#{name}'." if !Knj.const_defined?(name)
    return Knj.const_get(name)
  end
  
  def self.appserver_cli(filename)
    Knj::Os.chdir_file(filename)
    require "#{$knjpath}/includes/appserver_cli.rb"
  end
  
  def self.dirname(filepath)
    raise "Filepath does not exist: #{filepath}" if !File.exists?(filepath)
    return File.realpath(File.dirname(filepath))
  end
  
  #Returns the path of the knjrbfw-framework.
  def self.knjrbfw_path
    return File.realpath(File.dirname(__FILE__))
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
knjrbfw-0.0.31 lib/knj/knj.rb
knjrbfw-0.0.30 lib/knj/knj.rb
knjrbfw-0.0.29 lib/knj/knj.rb
knjrbfw-0.0.28 lib/knj/knj.rb
knjrbfw-0.0.27 lib/knj/knj.rb
knjrbfw-0.0.26 lib/knj/knj.rb
knjrbfw-0.0.25 lib/knj/knj.rb
knjrbfw-0.0.24 lib/knj/knj.rb