File: version.rb

package info (click to toggle)
ruby-ansi 1.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 404 kB
  • sloc: ruby: 1,880; makefile: 5
file content (15 lines) | stat: -rw-r--r-- 325 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module ANSI
  # Returns Hash table of project metadata.
  def self.metadata
    @spec ||= (
      require 'yaml'
      YAML.load(File.new(File.dirname(__FILE__) + '/../ansi.yml'))
    )
  end

  # Check metadata for missing constants.
  def self.const_missing(name)
    metadata[name.to_s.downcase] || super(name)
  end
end