Geminstaller C0 Coverage Information - RCov

spec/fixture/rubygems_dist/rubygems-trunk/lib/rubygems/defaults.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
spec/fixture/rubygems_dist/rubygems-trunk/lib/rubygems/defaults.rb 101 59
92.08%
86.44%

Key

Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.

Coverage Details

1 module Gem
2 
3   @post_install_hooks   ||= []
4   @post_uninstall_hooks ||= []
5   @pre_uninstall_hooks  ||= []
6   @pre_install_hooks    ||= []
7 
8   ##
9   # An Array of the default sources that come with RubyGems
10 
11   def self.default_sources
12     %w[http://rubygems.org/]
13   end
14 
15   ##
16   # Default home directory path to be used if an alternate value is not
17   # specified in the environment
18 
19   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
30   end
31 
32   ##
33   # Path for gems in the user's home directory
34 
35   def self.user_dir
36     File.join Gem.user_home, '.gem', ruby_engine, ConfigMap[:ruby_version]
37   end
38 
39   ##
40   # Default gem load path
41 
42   def self.default_path
43     if File.exist? Gem.user_home then
44       [user_dir, default_dir]
45     else
46       [default_dir]
47     end
48   end
49 
50   ##
51   # Deduce Ruby's --program-prefix and --program-suffix from its install name
52 
53   def self.default_exec_format
54     exec_format = ConfigMap[:ruby_install_name].sub('ruby', '%s') rescue '%s'
55 
56     unless exec_format =~ /%s/ then
57       raise Gem::Exception,
58         "[BUG] invalid exec_format #{exec_format.inspect}, no %s"
59     end
60 
61     exec_format
62   end
63 
64   ##
65   # The default directory for binaries
66 
67   def self.default_bindir
68     if defined? RUBY_FRAMEWORK_VERSION then # mac framework support
69       '/usr/bin'
70     else # generic install
71       ConfigMap[:bindir]
72     end
73   end
74 
75   ##
76   # The default system-wide source info cache directory
77 
78   def self.default_system_source_cache_dir
79     File.join Gem.dir, 'source_cache'
80   end
81 
82   ##
83   # The default user-specific source info cache directory
84 
85   def self.default_user_source_cache_dir
86     File.join Gem.user_home, '.gem', 'source_cache'
87   end
88 
89   ##
90   # A wrapper around RUBY_ENGINE const that may not be defined
91 
92   def self.ruby_engine
93     if defined? RUBY_ENGINE then
94       RUBY_ENGINE
95     else
96       'ruby'
97     end
98   end
99 
100 end
101 

Generated on Mon May 10 23:40:28 -0700 2010 with rcov 0.9.8