~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to lib/rbconfig/datadir.rb

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-24 11:42:29 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080124114229-jw2f87rdxlq6gp11
Tags: 1.9.0.0-2ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env ruby
 
2
#--
 
3
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 
4
# All rights reserved.
 
5
# See LICENSE.txt for permissions.
 
6
#++
 
7
 
 
8
 
 
9
module Config
 
10
 
 
11
  # Only define datadir if it doesn't already exist.
 
12
  unless Config.respond_to?(:datadir)
 
13
    
 
14
    # Return the path to the data directory associated with the given
 
15
    # package name.  Normally this is just
 
16
    # "#{Config::CONFIG['datadir']}/#{package_name}", but may be
 
17
    # modified by packages like RubyGems to handle versioned data
 
18
    # directories.
 
19
    def Config.datadir(package_name)
 
20
      File.join(CONFIG['datadir'], package_name)
 
21
    end
 
22
 
 
23
  end
 
24
end