Module: ErrorLog

Extended by:
ClassMethods
Defined in:
lib/error_log.rb,
lib/error_log/vcs.rb,
lib/error_log/model.rb,
lib/error_log/version.rb,
lib/error_log/controller.rb,
lib/error_log/migrations.rb,
lib/error_log/class_methods.rb,
lib/error_log/migrations/base.rb,
lib/error_log/migrations/add_params_column.rb,
lib/error_log/migrations/add_vcs_revision_column.rb

Overview

Everything you find directly in this module is skel from bones Some really useful methods as for lib, but you probably are not interested in any of them

If you want to take a look at methods that you call directly on ErrorLog module, like ErrorLog.log, take a look at class_methods.rb

Defined Under Namespace

Modules: ClassMethods, Controller, Migrations, Vcs Classes: Model

Constant Summary collapse

LIBPATH =

:stopdoc:

::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
PATH =
::File.dirname(LIBPATH) + ::File::SEPARATOR
VERSION =
"0.0.7"

Class Method Summary collapse

Methods included from ClassMethods

current_revision, init, log, logger, options

Class Method Details

.libpath(*args, &block) ⇒ Object

Returns the library path for the module. If any arguments are given, they will be joined to the end of the libray path using File.join.



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/error_log.rb', line 27

def self.libpath( *args, &block )
  rv =  args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
  if block
    begin
      $LOAD_PATH.unshift LIBPATH
      rv = block.call
    ensure
      $LOAD_PATH.shift
    end
  end
  return rv
end

.path(*args, &block) ⇒ Object

Returns the lpath for the module. If any arguments are given, they will be joined to the end of the path using File.join.



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/error_log.rb', line 44

def self.path( *args, &block )
  rv = args.empty? ? PATH : ::File.join(PATH, args.flatten)
  if block
    begin
      $LOAD_PATH.unshift PATH
      rv = block.call
    ensure
      $LOAD_PATH.shift
    end
  end
  return rv
end

.require_all_libs_relative_to(fname, dir = nil) ⇒ Object

Utility method used to require all files ending in .rb that lie in the directory below this file that has the same name as the filename passed in. Optionally, a specific directory name can be passed in such that the filename does not have to be equivalent to the directory.



62
63
64
65
66
67
68
# File 'lib/error_log.rb', line 62

def self.require_all_libs_relative_to( fname, dir = nil )
  dir ||= ::File.basename(fname, '.*')
  search_me = ::File.expand_path(
      ::File.join(::File.dirname(fname), dir, '**', '*.rb'))

  Dir.glob(search_me).sort.each {|rb| require rb}
end

.versionObject

Returns the version string for the library.



19
20
21
# File 'lib/error_log.rb', line 19

def self.version
  VERSION
end