Sha256: 045be3d42dd2fbc5b16458565330c194c709ece58d6383a2fbe5ee178e63a2af

Contents?: true

Size: 1.8 KB

Versions: 1

Compression:

Stored size: 1.8 KB

Contents

# = Glue
#
# Copyright (c) 2004-2006, George Moschovitis (http://www.gmosx.com)
# Copyright (c) 2004-2006, Navel Ltd (http://www.navel.gr)
#
# Glue (http://www.nitroproject.org) is copyrighted free software 
# created and maintained by George Moschovitis (mailto:gm@navel.gr) 
# and released under the standard BSD Licence. For details 
# consult the file doc/LICENCE.

require 'English'
require 'pp'

require 'facet/nullclass'
require 'facets/more/paramix' # keep this before module/is
require 'facet/module/is'

require 'glue/property'
require 'glue/attribute'

# Glue is a collection of reusable utilities and methods to 
# especially suited to Nitro and Og coding. We try to extract
# more generally useful parts of Glue into the Facets project.
# For more information about Facets have a look at:
#
# http://rubyforge.org/projects/facets/
#
# The Glue module is included by default in the TopLevel 
# for easy access to the utilities. Just use:
#
# $GLUE_DONT_INCLUDE = true
#
# before including Glue to dissable this behaviour.

module Glue

  # The version.

  Version = '0.30.0'
  
  # Library path.

  LibPath = File.dirname(__FILE__)

end

class NilClass
  # quite usefull for error tolerant apps.
  # a bit dangerous? Will have to rethink this.
  
  def empty?
    true
  end
  
  def blank?
    true
  end  
end

class Class
  #--
  # gmosx: is this really needed?
  #++
  
  def to_i
    return self.hash
  end
end

module Kernel
  # Pretty prints an exception/error object
  # usefull for helpfull debug messages
  #
  # Input:
  # The Exception/StandardError object
  #
  # Output:
  # the pretty printed string
  
  def pp_exception(ex)
    return %{#{ex.message}\n  #{ex.backtrace.join("\n  ")}\n  LOGGED FROM: #{caller[0]}}
  end
end

# Include in the top level binding for easy access.

include Glue unless $GLUE_DONT_INCLUDE

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
glue-0.30.0 lib/glue.rb