Module: HierarchicalPageTitles
- Defined in:
- lib/hierarchical_page_titles.rb,
lib/hierarchical_page_titles/paths.rb,
lib/hierarchical_page_titles/railtie.rb,
lib/hierarchical_page_titles/version.rb,
lib/hierarchical_page_titles/view_helpers.rb,
lib/hierarchical_page_titles/controller_helpers.rb
Defined Under Namespace
Modules: ControllerHelpers, ViewHelpers Classes: Railtie
Constant Summary collapse
- LIBPATH =
::File.('../..', __FILE__) + ::File::SEPARATOR
- PATH =
::File.dirname(LIBPATH) + ::File::SEPARATOR
- VERSION =
"0.2.0"
Class Method Summary collapse
-
.libpath(*args) ⇒ Object
Returns the library path for the module.
-
.path(*args) ⇒ Object
Returns the path for the module.
- .version ⇒ Object
Class Method Details
.libpath(*args) ⇒ 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.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/hierarchical_page_titles/paths.rb', line 9 def self.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 the module. If any arguments are given, they will be joined to the end of the path using File.join.
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/hierarchical_page_titles/paths.rb', line 25 def self.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
4 |
# File 'lib/hierarchical_page_titles/version.rb', line 4 def self.version; VERSION; end |