Sha256: 74930586ccafdc31878748baf785cd447aae4a1ad8dc8773f26754fa6e145f27

Contents?: true

Size: 231 Bytes

Versions: 11

Compression:

Stored size: 231 Bytes

Contents

module Kernel

  # Similar to __FILE__ and __LINE__, __DIR__ provides
  # the directory path to the current executing script.
  #
  # CREDIT: Trans

  def __DIR__
    (/^(.+)?:\d+/ =~ caller[0]) ? File.dirname($1) : nil
  end

end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
facets-2.6.0 lib/core/facets/kernel/__dir__.rb
facets-2.4.0 lib/facets/kernel/__dir__.rb
facets-2.4.1 lib/facets/kernel/__dir__.rb
facets-2.4.3 lib/core/facets/kernel/__dir__.rb
facets-2.4.2 lib/core/facets/kernel/__dir__.rb
facets-2.4.4 lib/core/facets/kernel/__dir__.rb
facets-2.5.1 lib/core/facets/kernel/__dir__.rb
facets-2.4.5 lib/core/facets/kernel/__dir__.rb
facets-2.5.0 lib/core/facets/kernel/__dir__.rb
facets-2.5.2 lib/core/facets/kernel/__dir__.rb
mack-facets-0.8.2 lib/gems/facets-2.4.5/lib/core/facets/kernel/__dir__.rb