Class HTAuth::Specification
In: lib/htauth/specification.rb
Parent: Object

Add some additional items to Gem::Specification A HTAuth::Specification adds additional pieces of information the typical gem specification

Methods

Constants

RUBYFORGE_ROOT = "/var/www/gforge-projects/"

Attributes

local_coverage_dir  [RW]  local directory for coverage report
local_rdoc_dir  [RW]  local directory in development holding the generated rdoc default ‘doc‘
local_site_dir  [RW]  local directory for generated website, default +site/public+
need_tar  [RW]  is a .tgz to be created?, default ‘true‘
need_zip  [RW]  is a .zip to be created, default ‘true‘
rdoc_main  [RW]  name the rdoc main
remote_coverage_dir  [RW]  remote directory for storing coverage reports This defaults to ‘coverage‘
remote_host  [RW]  remote host, default ‘rubyforge.org‘
remote_rdoc_dir  [RW]  remote directory for storing rdoc, default ‘doc‘
remote_site_dir  [RW]  remote directory relative to remote_root for the website. website.
remote_user  [RW]  user that accesses remote site

Public Class methods

[Source]

    # File lib/htauth/specification.rb, line 51
51:         def initialize
52:             @remote_user = nil
53:             @remote_host = "rubyforge.org"
54: 
55:             @rdoc_main              = "README"
56:             @local_rdoc_dir         = "doc"
57:             @remote_rdoc_dir        = "doc"
58:             @local_coverage_dir     = "coverage"
59:             @remote_coverage_dir    = "coverage"
60:             @local_site_dir         = "site/public"
61:             @remote_site_dir        = "."
62:             
63:             @need_tar   = true
64:             @need_zip   = true
65: 
66:             @spec                   = Gem::Specification.new
67: 
68:             yield self if block_given?
69: 
70:             # update rdoc options to take care of the rdoc_main if it is
71:             # there, and add a default title if one is not given
72:             if not @spec.rdoc_options.include?("--main") then
73:                 @spec.rdoc_options.concat(["--main", rdoc_main])
74:             end
75: 
76:             if not @spec.rdoc_options.include?("--title") then
77:                 @spec.rdoc_options.concat(["--title","'#{name} -- #{summary}'"])
78:             end
79:         end

Public Instance methods

we delegate any other calls to spec

[Source]

     # File lib/htauth/specification.rb, line 125
125:         def method_missing(method_id,*params,&block)
126:             @spec.send method_id, *params, &block
127:         end

rdoc files is the same as what would be generated during gem installation. That is, everything in the require paths plus the rdoc_extra_files

[Source]

     # File lib/htauth/specification.rb, line 99
 99:         def rdoc_files 
100:             flist = extra_rdoc_files.dup
101:             @spec.require_paths.each do |rp|
102:                 flist << FileList["#{rp}/**/*.rb"]
103:             end
104:             flist.flatten.uniq
105:         end

[Source]

     # File lib/htauth/specification.rb, line 116
116:         def remote_coverage_location
117:             remote_root_loation + @remote_coverage_dir
118:         end

[Source]

     # File lib/htauth/specification.rb, line 112
112:         def remote_rdoc_location
113:             remote_root_location + @remote_rdoc_dir
114:         end

if this gets set then it overwrites what would be the rubyforge default. If rubyforge project is not set then use name. If rubyforge project and name are set, but they are different then assume that name is a subproject of the rubyforge project

[Source]

    # File lib/htauth/specification.rb, line 86
86:         def remote_root 
87:             if rubyforge_project.nil? or 
88:                 rubyforge_project == name then
89:                 return RUBYFORGE_ROOT + "#{name}/"
90:             else
91:                 return RUBYFORGE_ROOT + "#{rubyforge_project}/#{name}/"
92:             end
93:         end

calculate the remote directories

[Source]

     # File lib/htauth/specification.rb, line 108
108:         def remote_root_location
109:             "#{remote_user}@#{remote_host}:#{remote_root}"
110:         end

[Source]

     # File lib/htauth/specification.rb, line 120
120:         def remote_site_location
121:             remote_root_location + @remote_site_dir
122:         end

[Validate]