### Home Classes Methods

### In Files

- lib/amalgalite/paths.rb

### Methods

- ::config_path
- ::data_path
- ::ext_path
- ::lib_path
- ::root_dir
- ::spec_path
- ::sub_path

### Files

- HISTORY.rdoc
- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- Amalgalite
- Amalgalite::Aggregate
- Amalgalite::Blob
- Amalgalite::Blob::Error
- Amalgalite::Boolean
- Amalgalite::BusyHandler
- Amalgalite::BusyTimeout
- Amalgalite::CSVTableImporter
- Amalgalite::Column
- Amalgalite::Database
- Amalgalite::Database::AggregateError
- Amalgalite::Database::BusyHandlerError
- Amalgalite::Database::FunctionError
- Amalgalite::Database::InvalidModeError
- Amalgalite::Database::ProgressHandlerError
- Amalgalite::Database::TransactionBehavior
- Amalgalite::Error
- Amalgalite::Function
- Amalgalite::Index
- Amalgalite::MemoryDatabase
- Amalgalite::Packer
- Amalgalite::Paths
- Amalgalite::ProfileSampler
- Amalgalite::ProfileTap
- Amalgalite::ProgressHandler
- Amalgalite::Requires
- Amalgalite::SQLite3
- Amalgalite::SQLite3::Constants
- Amalgalite::SQLite3::Constants::Config
- Amalgalite::SQLite3::Constants::DBStatus
- Amalgalite::SQLite3::Constants::DataType
- Amalgalite::SQLite3::Constants::Helpers
- Amalgalite::SQLite3::Constants::Open
- Amalgalite::SQLite3::Constants::ResultCode
- Amalgalite::SQLite3::Constants::StatementStatus
- Amalgalite::SQLite3::Constants::Status
- Amalgalite::SQLite3::Database
- Amalgalite::SQLite3::Database::DBStatus
- Amalgalite::SQLite3::Database::Function
- Amalgalite::SQLite3::Database::Stat
- Amalgalite::SQLite3::Stat
- Amalgalite::SQLite3::Status
- Amalgalite::SQLite3::Version
- Amalgalite::Schema
- Amalgalite::Statement
- Amalgalite::Table
- Amalgalite::Taps
- Amalgalite::Taps::IO
- Amalgalite::Taps::Stderr
- Amalgalite::Taps::Stdout
- Amalgalite::Taps::StringIO
- Amalgalite::TraceTap
- Amalgalite::TypeMap
- Amalgalite::TypeMaps
- Amalgalite::TypeMaps::DefaultMap
- Amalgalite::TypeMaps::StorageMap
- Amalgalite::TypeMaps::TextMap
- Amalgalite::Version
- Amalgalite::View
- Kernel
- Object

No matching classes.

# Amalgalite::Paths

Paths contains helpful methods to determine paths of files inside the Amalgalite library

### Public Class Methods

config_path(*args) click to toggle source

returns

String

  The full expanded path of the `config` directory

below root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if args are not present.

    # File lib/amalgalite/paths.rb, line 33
    def self.config_path(*args)
      self.sub_path("config", *args)
    end

data_path(*args) click to toggle source

returns

String

  The full expanded path of the `data` directory below

root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if _*args_ are not present.

    # File lib/amalgalite/paths.rb, line 42
    def self.data_path(*args)
      self.sub_path("data", *args)
    end

ext_path(*args) click to toggle source

returns

String

  The full expanded path of the `ext` directory below

root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if _*args_ are not present.

    # File lib/amalgalite/paths.rb, line 60
    def self.ext_path(*args)
      self.sub_path("ext", *args)
    end

lib_path(*args) click to toggle source

returns

String

  The full expanded path of the `lib` directory below

root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if _*args_ are not present.

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

root_dir() click to toggle source

The root directory of the project is considered to be the parent directory of the 'lib' directory.

returns

String

  The full expanded path of the parent directory of 'lib'

going up the path from the current file. Trailing File::SEPARATOR is guaranteed.

    # File lib/amalgalite/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")
        path_parts[0...lib_index].join(::File::SEPARATOR) + ::File::SEPARATOR
      )
      return @root_dir
    end

spec_path(*args) click to toggle source

returns

String

  The full expanded path of the `spec` directory below

root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if _*args_ are not present.

    # File lib/amalgalite/paths.rb, line 69
    def self.spec_path(*args)
      self.sub_path("spec", *args)
    end

sub_path(sub,*args) click to toggle source

    # File lib/amalgalite/paths.rb, line 74
    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.