meta_project 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,13 @@
1
1
  = XForge Changelog
2
2
 
3
+ == Version 0.4.3
4
+
5
+ This is a bugfix release.
6
+
7
+ * Aligned properties between TracTracker and JiraTracker with ProjectAnalyzer.
8
+ * Stripping leading and trailing whitespace from issue summaries (SF seems to have changed).
9
+ * Added name to XForge projects.
10
+
3
11
  == Version 0.4.2
4
12
 
5
13
  This is a minor release that accommodates fos some changes needed by DamageControl.
data/Rakefile CHANGED
@@ -24,7 +24,7 @@ require 'rake/rdoctask'
24
24
  #
25
25
  # REMEMBER TO KEEP PKG_VERSION IN SYNC WITH THE CHANGES FILE!
26
26
  PKG_NAME = "meta_project"
27
- PKG_VERSION = "0.4.2"
27
+ PKG_VERSION = "0.4.3"
28
28
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
29
29
  PKG_FILES = FileList[
30
30
  '[A-Z]*',
@@ -1,7 +1,7 @@
1
1
  module MetaProject
2
2
  module Project
3
3
  class Base
4
- attr_reader :scm, :scm_web, :tracker
4
+ attr_reader :scm, :scm_web, :tracker, :name, :home_page
5
5
  end
6
6
  end
7
7
  end
@@ -4,6 +4,7 @@ module MetaProject
4
4
  class CodehausProjectSvn < Base
5
5
 
6
6
  def initialize(project_id, svn_path, jira_id)
7
+ @name = project_id
7
8
  @scm = RSCM::Subversion.new("svn://svn.#{project_id}.codehaus.org/#{project_id}/scm/#{svn_path}", svn_path)
8
9
  @tracker = ::MetaProject::Tracker::Jira::JiraTracker.new("http://jira.codehaus.org", jira_id)
9
10
 
@@ -10,6 +10,7 @@ module MetaProject
10
10
  def initialize(host, unix_name, cvs_mod)
11
11
  @host = host
12
12
  @unix_name = unix_name
13
+ @name = unix_name
13
14
 
14
15
  @tracker = tracker_class.new(group_id_uri("tracker"), self)
15
16
 
@@ -45,14 +46,14 @@ module MetaProject
45
46
  def group_id
46
47
  unless(@group_id)
47
48
  regexp = /stats\/[?&]group_id=(\d+)/
48
- html = open(project_uri) { |data| data.read }
49
+ html = open(xforge_project_url) { |data| data.read }
49
50
  @group_id = html[regexp, 1]
50
51
  raise "Couldn't get group_id" unless @group_id
51
52
  end
52
53
  @group_id
53
54
  end
54
55
 
55
- def project_uri
56
+ def xforge_project_url
56
57
  "http://#{@host}/projects/#{@unix_name}/"
57
58
  end
58
59
 
@@ -63,7 +64,7 @@ module MetaProject
63
64
  # The home page of this project
64
65
  def home_page
65
66
  unless(@home_page)
66
- html = open(project_uri) { |data| data.read }
67
+ html = open(xforge_project_url) { |data| data.read }
67
68
  @home_page = html[home_page_regexp, 1]
68
69
  raise "Couldn't get home_page" unless @home_page
69
70
  end
@@ -20,14 +20,14 @@ module MetaProject
20
20
  if(url =~ /(http:\/\/.*)\/browser\/(.*)/)
21
21
  trac_base_url = $1
22
22
  svn_path = $2[-1..-1] == "/" ? $2[0..-2] : $2
23
- return Project::Trac::TracProject.new(trac_base_url, options[:svn_root_url], svn_path)
23
+ return Project::Trac::TracProject.new(trac_base_url, options[:trac_svn_root_url], svn_path)
24
24
  end
25
25
 
26
26
  # Codehaus SVN
27
27
  if(url =~ /http:\/\/svn.(.*).codehaus.org\/(.*)/)
28
28
  svn_id = $1
29
29
  svn_path = $2[-1..-1] == "/" ? $2[0..-2] : $2
30
- return Project::Codehaus::CodehausProjectSvn.new(svn_id, svn_path, options[:jira_id])
30
+ return Project::Codehaus::CodehausProjectSvn.new(svn_id, svn_path, options[:jira_project_id])
31
31
  end
32
32
 
33
33
  end
@@ -6,7 +6,7 @@ module MetaProject
6
6
  class JiraTracker < Base
7
7
  JIRA_API = "jira1"
8
8
 
9
- attr_accessor :rooturl, :identifier
9
+ attr_accessor :jira_base_url, :jira_project_id
10
10
 
11
11
  # Creates a new JiraTracker. In order to successfully get issue info (via XMLRPC),
12
12
  # two env vars must be defined. Example:
@@ -17,8 +17,8 @@ module MetaProject
17
17
  #
18
18
  # JIRA_CODEHAUS_ORG_JIRA_USER
19
19
  # JIRA_CODEHAUS_ORG_JIRA_PASSWORD
20
- def initialize(rooturl=nil, identifier=nil)
21
- @rooturl, @identifier = rooturl, identifier
20
+ def initialize(jira_base_url=nil, jira_project_id=nil)
21
+ @jira_base_url, @jira_project_id = jira_base_url, jira_project_id
22
22
  end
23
23
 
24
24
  def identifier_regexp
@@ -30,14 +30,14 @@ module MetaProject
30
30
  end
31
31
 
32
32
  def overview
33
- "#{@rooturl}/browse/#{@identifier}"
33
+ "#{@jira_base_url}/browse/#{@jira_project_id}"
34
34
  end
35
35
 
36
36
  def issue(issue_identifier)
37
37
  begin
38
38
  session = login
39
39
  issue = session.getIssue(issue_identifier)
40
- Issue.new("#{@rooturl}/browse/#{issue_identifier}", issue["summary"])
40
+ Issue.new("#{@jira_base_url}/browse/#{issue_identifier}", issue["summary"])
41
41
  rescue XMLRPC::FaultException => e
42
42
  # Probably bad issue number or failed login
43
43
  STDERR.puts("Couldn't get issue #{issue_identifier}: #{e.message}")
@@ -60,7 +60,7 @@ module MetaProject
60
60
  private
61
61
 
62
62
  def login
63
- client = XMLRPC::Client.new2("#{@rooturl}/rpc/xmlrpc")
63
+ client = XMLRPC::Client.new2("#{@jira_base_url}/rpc/xmlrpc")
64
64
  token = client.call("#{JIRA_API}.login", user, password)
65
65
  Session.new(client, token)
66
66
  end
@@ -76,10 +76,10 @@ module MetaProject
76
76
  end
77
77
 
78
78
  def login_env_var_prefix
79
- if(rooturl =~ /http:\/\/([^\/]+)/)
79
+ if(jira_base_url =~ /http:\/\/([^\/]+)/)
80
80
  $1.gsub(/\./, "_").upcase
81
81
  else
82
- raise "Bad root url: #{rooturl}"
82
+ raise "Bad jira_base_url: #{jira_base_url}"
83
83
  end
84
84
  end
85
85
 
@@ -49,7 +49,7 @@ module MetaProject
49
49
  regexp = @tracker.issue_regexp(identifier)
50
50
  if(html =~ regexp)
51
51
  issue_uri = @tracker.project.group_id_uri("tracker/index.php", "&atid=#{@atid}&func=detail&aid=#{identifier}")
52
- return Issue.new(issue_uri, $1)
52
+ return Issue.new(issue_uri, $1.strip)
53
53
  end
54
54
  nil
55
55
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: meta_project
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.4.2
7
- date: 2005-08-23 00:00:00 -04:00
6
+ version: 0.4.3
7
+ date: 2005-08-24 00:00:00 -04:00
8
8
  summary: Ruby based make-like utility.
9
9
  require_paths:
10
10
  - lib