Module: Logging::Rails
- Defined in:
- lib/logging/rails/generators/install_generator.rb,
lib/logging/rails/railtie.rb,
lib/logging/rails/mixin.rb,
lib/logging/rails.rb
Defined Under Namespace
Modules: Generators, Mixin Classes: Railtie
Constant Summary collapse
- LIBPATH =
:stopdoc:
::File.('../..', __FILE__) + ::File::SEPARATOR
- PATH =
::File.dirname(LIBPATH) + ::File::SEPARATOR
Class Attribute Summary collapse
-
.configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Class Method Summary collapse
-
.configure(&block) ⇒ Object
Stores the given Logging configuration block for later evalution by the Railtie.
-
.libpath(*args) ⇒ Object
Returns the lib path for Mr Bones.
-
.path(*args) ⇒ Object
Returns the path for Mr Bones.
-
.version ⇒ Object
Returns the version string for the library.
Class Attribute Details
.configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
32 33 34 |
# File 'lib/logging/rails.rb', line 32 def configuration @configuration end |
Class Method Details
.configure(&block) ⇒ Object
Stores the given Logging configuration block for later evalution by the Railtie. This method is used in the ‘config/logging.rb’ configuration file.
28 29 30 |
# File 'lib/logging/rails.rb', line 28 def configure( &block ) @configuration = block end |
.libpath(*args) ⇒ Object
Returns the lib path for Mr Bones. If any arguments are given, they will be joined to the end of the path using File.join.
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/logging/rails.rb', line 53 def libpath( *args ) rv = args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten) if block_given? begin $LOAD_PATH.unshift LIBPATH rv = yield ensure $LOAD_PATH.shift end end return rv end |
.path(*args) ⇒ Object
Returns the path for Mr Bones. If any arguments are given, they will be joined to the end of the path using File.join.
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/logging/rails.rb', line 37 def path( *args ) rv = args.empty? ? PATH : ::File.join(PATH, args.flatten) if block_given? begin $LOAD_PATH.unshift PATH rv = yield ensure $LOAD_PATH.shift end end return rv end |
.version ⇒ Object
Returns the version string for the library.
20 21 22 |
# File 'lib/logging/rails.rb', line 20 def version @version ||= File.read(path('version.txt')).strip end |