Module: Hitimes::Paths

### Home Classes Methods

### In Files

- lib/hitimes/paths.rb

### Methods

- ::lib_path
- ::root_dir
- ::sub_path

### Files

- Manifest.txt

### Class/Module Index

Quicksearch

- Hitimes
- Hitimes::Error
- Hitimes::Metric
- Hitimes::MutexedStats
- Hitimes::Paths
- Hitimes::Stats
- Hitimes::TimedMetric
- Hitimes::TimedValueMetric
- Hitimes::ValueMetric

No matching classes.

# Hitimes::Paths

Access to various paths inside the project programatically

### Public Class Methods

Hitimes::Paths.lib_path( *args ) → String click to toggle source

Returns The full expanded path of the `lib` directory below root_dir. All parameters passed in are joined onto the result. A trailing File::SEPARATOR is guaranteed if args are not present.

    # File lib/hitimes/paths.rb, line 36
    def self.lib_path(*args)
      self.sub_path("lib", *args)
    end

Hitimes::Paths.root_dir → String click to toggle source

Returns The full expanded path of the parent directory of `lib` going up the path from the current file. A trailing File::SEPARATOR is guaranteed.

    # File lib/hitimes/paths.rb, line 19
    def self.root_dir
      @root_dir ||=(
        path_parts = ::File.expand_path(__FILE__).split(::File::SEPARATOR)
        lib_index  = path_parts.rindex("lib")
        @root_dir = path_parts[0...lib_index].join(::File::SEPARATOR) + ::File::SEPARATOR
      )
    end

Hitimes::Paths.sub_path( sub, *args ) → String click to toggle source

Returns the full expanded path of the `sub` directory below _root_dir. All arg parameters passed in are joined onto the result. A trailing File::SEPARATOR is guaranteed if args are not present.

    # File lib/hitimes/paths.rb, line 48
    def self.sub_path(sub,*args)
      sp = ::File.join(root_dir, sub) + File::SEPARATOR
      sp = ::File.join(sp, *args) if args
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.