~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to .pc/20100829-rubygems_default_dir.diff/lib/rubygems/defaults.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
module Gem
2
2
 
 
3
  # TODO: move this whole file back into rubygems.rb
 
4
 
3
5
  @post_install_hooks   ||= []
4
6
  @post_uninstall_hooks ||= []
5
7
  @pre_uninstall_hooks  ||= []
17
19
  # specified in the environment
18
20
 
19
21
  def self.default_dir
20
 
    if defined? RUBY_FRAMEWORK_VERSION then
21
 
      File.join File.dirname(ConfigMap[:sitedir]), 'Gems',
22
 
                ConfigMap[:ruby_version]
23
 
    elsif ConfigMap[:rubylibprefix] then
24
 
      File.join(ConfigMap[:rubylibprefix], 'gems',
25
 
                ConfigMap[:ruby_version])
26
 
    else
27
 
      File.join(ConfigMap[:libdir], ruby_engine, 'gems',
28
 
                ConfigMap[:ruby_version])
29
 
    end
 
22
    path = if defined? RUBY_FRAMEWORK_VERSION then
 
23
             [
 
24
               File.dirname(ConfigMap[:sitedir]),
 
25
               'Gems',
 
26
               ConfigMap[:ruby_version]
 
27
             ]
 
28
           elsif ConfigMap[:rubylibprefix] then
 
29
             [
 
30
              ConfigMap[:rubylibprefix],
 
31
              'gems',
 
32
              ConfigMap[:ruby_version]
 
33
             ]
 
34
           else
 
35
             [
 
36
               ConfigMap[:libdir],
 
37
               ruby_engine,
 
38
               'gems',
 
39
               ConfigMap[:ruby_version]
 
40
             ]
 
41
           end
 
42
 
 
43
    @default_dir ||= File.join(*path)
30
44
  end
31
45
 
32
46
  ##
76
90
  # The default system-wide source info cache directory
77
91
 
78
92
  def self.default_system_source_cache_dir
79
 
    File.join Gem.dir, 'source_cache'
 
93
    File.join(Gem.dir, 'source_cache')
80
94
  end
81
95
 
82
96
  ##
83
97
  # The default user-specific source info cache directory
84
98
 
85
99
  def self.default_user_source_cache_dir
86
 
    File.join Gem.user_home, '.gem', 'source_cache'
 
100
    #
 
101
    # NOTE Probably an argument for moving this to per-ruby supported dirs like
 
102
    # user_dir
 
103
    #
 
104
    File.join(Gem.user_home, '.gem', 'source_cache')
87
105
  end
88
106
 
89
107
  ##
96
114
      'ruby'
97
115
    end
98
116
  end
99
 
 
100
117
end
101