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.
27 28 29 |
# File 'lib/logging/rails.rb', line 27 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.
23 24 25 |
# File 'lib/logging/rails.rb', line 23 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
.
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/logging/rails.rb', line 48 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
.
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/logging/rails.rb', line 32 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.
15 16 17 |
# File 'lib/logging/rails.rb', line 15 def version @version ||= File.read(path('version.txt')).strip end |