xforge 0.3.5 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/CHANGES +34 -0
  2. data/Rakefile +5 -5
  3. data/lib/meta_project.rb +6 -0
  4. data/lib/meta_project/project.rb +4 -0
  5. data/lib/meta_project/project/base.rb +7 -0
  6. data/lib/meta_project/project/codehaus.rb +1 -0
  7. data/lib/meta_project/project/codehaus/codehaus_project_svn.rb +26 -0
  8. data/lib/meta_project/project/trac.rb +1 -0
  9. data/lib/meta_project/project/trac/trac_project.rb +26 -0
  10. data/lib/meta_project/project/xforge.rb +5 -0
  11. data/lib/meta_project/project/xforge/ruby_forge.rb +46 -0
  12. data/lib/meta_project/project/xforge/session.rb +162 -0
  13. data/lib/meta_project/project/xforge/source_forge.rb +46 -0
  14. data/lib/meta_project/project/xforge/xfile.rb +45 -0
  15. data/lib/meta_project/project/xforge/xforge_base.rb +76 -0
  16. data/lib/meta_project/project_analyzer.rb +36 -0
  17. data/lib/meta_project/scm_web.rb +53 -0
  18. data/lib/meta_project/tracker.rb +6 -0
  19. data/lib/meta_project/tracker/base.rb +18 -0
  20. data/lib/meta_project/tracker/digit_issues.rb +24 -0
  21. data/lib/meta_project/tracker/issue.rb +11 -0
  22. data/lib/meta_project/tracker/jira.rb +1 -0
  23. data/lib/meta_project/tracker/jira/jira_tracker.rb +68 -0
  24. data/lib/meta_project/tracker/trac.rb +1 -0
  25. data/lib/meta_project/tracker/trac/trac_tracker.rb +29 -0
  26. data/lib/meta_project/tracker/xforge.rb +3 -0
  27. data/lib/meta_project/tracker/xforge/ruby_forge_tracker.rb +17 -0
  28. data/lib/meta_project/tracker/xforge/source_forge_tracker.rb +17 -0
  29. data/lib/meta_project/tracker/xforge/xforge_tracker.rb +83 -0
  30. data/lib/{xforge → meta_project}/version_parser.rb +6 -6
  31. data/lib/rake/contrib/xforge/base.rb +2 -3
  32. data/lib/rake/contrib/xforge/news_publisher.rb +1 -5
  33. data/lib/rake/contrib/xforge/release.rb +3 -7
  34. data/lib/xforge.rb +0 -1
  35. metadata +30 -27
  36. data/lib/scm_web/base.rb +0 -12
  37. data/lib/scm_web/file_uri.rb +0 -21
  38. data/lib/scm_web/view_cvs.rb +0 -44
  39. data/lib/tracker/base.rb +0 -16
  40. data/lib/tracker/bugzilla/project.rb +0 -8
  41. data/lib/tracker/digit_issues.rb +0 -22
  42. data/lib/tracker/fog_bugz/project.rb +0 -8
  43. data/lib/tracker/issue.rb +0 -9
  44. data/lib/tracker/jira.rb +0 -2
  45. data/lib/tracker/jira/host.rb +0 -40
  46. data/lib/tracker/jira/project.rb +0 -43
  47. data/lib/tracker/mantis/project.rb +0 -8
  48. data/lib/tracker/scarab/project.rb +0 -8
  49. data/lib/tracker/trac.rb +0 -1
  50. data/lib/tracker/trac/project.rb +0 -35
  51. data/lib/tracker/xforge.rb +0 -2
  52. data/lib/tracker/xforge/base.rb +0 -77
  53. data/lib/tracker/xforge/rubyforge.rb +0 -7
  54. data/lib/xforge/host.rb +0 -26
  55. data/lib/xforge/project.rb +0 -87
  56. data/lib/xforge/rubyforge.rb +0 -50
  57. data/lib/xforge/session.rb +0 -158
  58. data/lib/xforge/sourceforge.rb +0 -46
  59. data/lib/xforge/xfile.rb +0 -41
@@ -1,10 +1,10 @@
1
- module XForge
1
+ module MetaProject
2
2
  class VersionParser
3
3
  def parse(changes_file, version)
4
4
  release_notes_first = nil
5
5
  changes_first = nil
6
6
  changes_last = nil
7
-
7
+
8
8
  lines = File.open(changes_file).readlines
9
9
  state = nil
10
10
  lines.each_with_index do |line, n|
@@ -24,19 +24,19 @@ module XForge
24
24
  state = :done
25
25
  end
26
26
  end
27
-
27
+
28
28
  release_notes = lines[release_notes_first..changes_first-1].join("")
29
29
  release_changes = lines[changes_first..changes_last].collect{|line| line[2..-1].chomp}
30
30
  Version.new(release_notes, release_changes)
31
31
  end
32
32
  end
33
-
33
+
34
34
  class Version
35
35
  attr_reader :release_notes # String
36
36
  attr_reader :release_changes # Array of String
37
-
37
+
38
38
  def initialize(release_notes, release_changes)
39
39
  @release_notes, @release_changes = release_notes, release_changes
40
40
  end
41
41
  end
42
- end
42
+ end
@@ -5,9 +5,8 @@ module Rake
5
5
  class Base
6
6
  attr_writer :user_name, :password
7
7
 
8
- def initialize(project_unix_name, host=::XForge::RubyForge.new)
9
- @project_unix_name = project_unix_name
10
- @host = host
8
+ def initialize(project)
9
+ @project = project
11
10
 
12
11
  set_defaults
13
12
 
@@ -1,5 +1,3 @@
1
- require 'xforge/version_parser'
2
-
3
1
  module Rake
4
2
  module XForge
5
3
 
@@ -27,9 +25,7 @@ module Rake
27
25
  end
28
26
 
29
27
  def execute
30
- project = @host.project(@project_unix_name)
31
- u = user_name
32
- session = project.login(u, password)
28
+ session = @project.login(user_name, password)
33
29
  session.publish_news(@subject, @details)
34
30
  end
35
31
 
@@ -1,5 +1,3 @@
1
- require 'xforge/version_parser'
2
-
3
1
  module Rake
4
2
  module XForge
5
3
 
@@ -27,7 +25,7 @@ module Rake
27
25
  # 'CHANGES'
28
26
  # ]
29
27
  #
30
- # Rake::XForge::Release.new('xforge') do |xf|
28
+ # Rake::XForge::Release.new(MetaProject::Project::XForge::RubyForge.new('xforge')) do |xf|
31
29
  # # Never hardcode user name and password in the Rakefile!
32
30
  # xf.user_name = ENV['RUBYFORGE_USER']
33
31
  # xf.password = ENV['RUBYFORGE_PASSWORD']
@@ -59,7 +57,7 @@ module Rake
59
57
  @release_name = "#{PKG_NAME}-#{PKG_VERSION}" if (defined? PKG_NAME && defined? PKG_VERSION)
60
58
 
61
59
  begin
62
- vp = ::XForge::VersionParser.new
60
+ vp = ::MetaProject::VersionParser.new
63
61
  version = vp.parse("CHANGES", PKG_VERSION)
64
62
  @release_notes = version.release_notes
65
63
  @release_changes = "* " + version.release_changes.join("\n* ")
@@ -71,9 +69,7 @@ module Rake
71
69
  end
72
70
 
73
71
  def execute
74
- project = @host.project(@project_unix_name)
75
- u = user_name
76
- session = project.login(u, password)
72
+ session = @project.login(user_name, password)
77
73
  session.release(@release_name, @files, @release_notes, @release_changes)
78
74
  end
79
75
 
@@ -1,4 +1,3 @@
1
- require 'scm_web/file_uri'
2
1
  require 'scm_web/base'
3
2
  require 'scm_web/view_cvs'
4
3
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: xforge
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.3.5
7
- date: 2005-08-20 00:00:00 -04:00
6
+ version: 0.4.0
7
+ date: 2005-08-22 00:00:00 -04:00
8
8
  summary: Ruby based make-like utility.
9
9
  require_paths:
10
10
  - lib
@@ -35,36 +35,39 @@ files:
35
35
  - Rakefile
36
36
  - README
37
37
  - TODO
38
+ - lib/meta_project.rb
38
39
  - lib/xforge.rb
40
+ - lib/meta_project/project.rb
41
+ - lib/meta_project/project_analyzer.rb
42
+ - lib/meta_project/scm_web.rb
43
+ - lib/meta_project/tracker.rb
44
+ - lib/meta_project/version_parser.rb
45
+ - lib/meta_project/project/base.rb
46
+ - lib/meta_project/project/codehaus.rb
47
+ - lib/meta_project/project/trac.rb
48
+ - lib/meta_project/project/xforge.rb
49
+ - lib/meta_project/project/codehaus/codehaus_project_svn.rb
50
+ - lib/meta_project/project/trac/trac_project.rb
51
+ - lib/meta_project/project/xforge/ruby_forge.rb
52
+ - lib/meta_project/project/xforge/session.rb
53
+ - lib/meta_project/project/xforge/source_forge.rb
54
+ - lib/meta_project/project/xforge/xfile.rb
55
+ - lib/meta_project/project/xforge/xforge_base.rb
56
+ - lib/meta_project/tracker/base.rb
57
+ - lib/meta_project/tracker/digit_issues.rb
58
+ - lib/meta_project/tracker/issue.rb
59
+ - lib/meta_project/tracker/jira.rb
60
+ - lib/meta_project/tracker/trac.rb
61
+ - lib/meta_project/tracker/xforge.rb
62
+ - lib/meta_project/tracker/jira/jira_tracker.rb
63
+ - lib/meta_project/tracker/trac/trac_tracker.rb
64
+ - lib/meta_project/tracker/xforge/ruby_forge_tracker.rb
65
+ - lib/meta_project/tracker/xforge/source_forge_tracker.rb
66
+ - lib/meta_project/tracker/xforge/xforge_tracker.rb
39
67
  - lib/rake/contrib/xforge.rb
40
68
  - lib/rake/contrib/xforge/base.rb
41
69
  - lib/rake/contrib/xforge/news_publisher.rb
42
70
  - lib/rake/contrib/xforge/release.rb
43
- - lib/scm_web/base.rb
44
- - lib/scm_web/file_uri.rb
45
- - lib/scm_web/view_cvs.rb
46
- - lib/tracker/base.rb
47
- - lib/tracker/digit_issues.rb
48
- - lib/tracker/issue.rb
49
- - lib/tracker/jira.rb
50
- - lib/tracker/trac.rb
51
- - lib/tracker/xforge.rb
52
- - lib/tracker/bugzilla/project.rb
53
- - lib/tracker/fog_bugz/project.rb
54
- - lib/tracker/jira/host.rb
55
- - lib/tracker/jira/project.rb
56
- - lib/tracker/mantis/project.rb
57
- - lib/tracker/scarab/project.rb
58
- - lib/tracker/trac/project.rb
59
- - lib/tracker/xforge/base.rb
60
- - lib/tracker/xforge/rubyforge.rb
61
- - lib/xforge/host.rb
62
- - lib/xforge/project.rb
63
- - lib/xforge/rubyforge.rb
64
- - lib/xforge/session.rb
65
- - lib/xforge/sourceforge.rb
66
- - lib/xforge/version_parser.rb
67
- - lib/xforge/xfile.rb
68
71
  - doc/base_attrs.rdoc
69
72
  test_files: []
70
73
  rdoc_options:
@@ -1,12 +0,0 @@
1
- module ScmWeb
2
- class Base
3
- include FileUri
4
-
5
- def self.classes
6
- [
7
- ViewCvs,
8
- ::Tracker::Trac::TracProject
9
- ]
10
- end
11
- end
12
- end
@@ -1,21 +0,0 @@
1
- module ScmWeb
2
- module FileUri
3
- # TODO: rename to file_uri to avoid the clash that is currently in Trac
4
- # Returns the URI for the file at +path+.
5
- # Options are:
6
- # :type (can be one of :overview, :raw or :html)
7
- # :revision (the revision of the file. must be specified when :type is :raw or :html)
8
- def file_uri(path="", options={:type=>"overview"})
9
- type = options[:type]
10
- raise "No :type specified" unless type
11
- uri_spec = uri_specs[type]
12
- raise "No uri_spec for #{type}" unless uri_spec
13
-
14
- project_unix_name = @project_unix_name
15
- path_prefix = options[:path_prefix]
16
- revision = options[:revision]
17
- previous_revision = options[:previous_revision]
18
- eval("\"#{uri_spec}\"", binding)
19
- end
20
- end
21
- end
@@ -1,44 +0,0 @@
1
- module ScmWeb
2
- class ViewCvs < Base
3
-
4
- attr_accessor :uri_specs, :cvs_host_name, :cvs_server_path, :project_unix_name, :module_regexp
5
-
6
- def initialize(uri_specs={}, cvs_host_name=nil, cvs_server_path=nil, project_unix_name=nil, module_regexp=nil)
7
- @uri_specs, @cvs_host_name, @cvs_server_path, @project_unix_name, @module_regexp =
8
- uri_specs, cvs_host_name, cvs_server_path, project_unix_name, module_regexp
9
- end
10
-
11
- # The variables to use in uri_specs are:
12
- #
13
- # * path
14
- # * revision
15
- # * previous_revision
16
- #
17
- def uri_specs
18
- @uri_specs ||= {}
19
- end
20
-
21
- def scms
22
- unless(@scms)
23
- require 'rscm'
24
-
25
- @scms = []
26
- cvs_root = open(file_uri) do |data|
27
- data.each_line do |line|
28
- if line =~ @module_regexp
29
- mod = $1
30
- unless(mod == "CVSROOT")
31
- scm = RSCM::Cvs.new
32
- scm.root = ":pserver:anonymous@#{cvs_host_name}:#{cvs_server_path}"
33
- scm.mod = mod
34
- @scms << scm
35
- end
36
- end
37
- end
38
- end
39
- end
40
- @scms
41
- end
42
-
43
- end
44
- end
@@ -1,16 +0,0 @@
1
- module Tracker
2
-
3
- # Tracker objects are responsible for interacting with issue trackers (bug trackers).
4
- # They know how to recognise issue identifiers in strings (typically from SCM commit
5
- # messages) and turn these into HTML links that point to the associated issue on an
6
- # issue tracker installation running somewhere else.
7
- class Base
8
- def self.classes
9
- [
10
- ::Tracker::Jira::JiraProject,
11
- ::Tracker::XForge::RubyForgeProject,
12
- ::Tracker::Trac::TracProject
13
- ]
14
- end
15
- end
16
- end
@@ -1,8 +0,0 @@
1
- module Tracker
2
- module Bugzilla
3
- class Project < Base
4
- include DigitIssues
5
-
6
- end
7
- end
8
- end
@@ -1,22 +0,0 @@
1
- module Tracker
2
- # This module should be included by trackers that follow a digit-based issue scheme
3
- module DigitIssues
4
- def identifier_regexp
5
- /#(\d+)/
6
- end
7
-
8
- def identifier_examples
9
- ["#1926", "#1446"]
10
- end
11
-
12
- # TODO: find a way to extract just the issue summaries so they can be stored in dc as an array
13
- # embedded in the revision object. that way we don't alter the original commit message
14
- def markup(text)
15
- text.gsub(identifier_regexp) do |match|
16
- issue_identifier = $1
17
- issue = issue(issue_identifier)
18
- issue ? "<a href=\"#{issue.uri}\">#{issue.summary}</a>" : "\##{issue_identifier}"
19
- end
20
- end
21
- end
22
- end
@@ -1,8 +0,0 @@
1
- module Tracker
2
- module FogBugz
3
- class Project < Base
4
- include DigitIssues
5
-
6
- end
7
- end
8
- end
@@ -1,9 +0,0 @@
1
- module Tracker
2
- class Issue
3
- attr_reader :uri, :summary
4
-
5
- def initialize(uri, summary)
6
- @uri, @summary = uri, summary
7
- end
8
- end
9
- end
@@ -1,2 +0,0 @@
1
- require 'tracker/jira/host'
2
- require 'tracker/jira/project'
@@ -1,40 +0,0 @@
1
- require 'xmlrpc/client'
2
-
3
- module Tracker
4
- module Jira
5
- class Host
6
- JIRA_API = "jira1"
7
-
8
- attr_reader :uri
9
-
10
- def initialize(uri, username, password)
11
- @uri, @username, @password = uri, username, password
12
- end
13
-
14
- def project(identifier)
15
- JiraProject.new(self, identifier)
16
- end
17
-
18
- def login
19
- client = XMLRPC::Client.new2("#{uri}/rpc/xmlrpc")
20
- token = client.call("#{JIRA_API}.login", @username, @password)
21
- Session.new(client, token)
22
- end
23
-
24
- end
25
-
26
- # This wrapper around XMLRPC::Client that allows simpler method calls
27
- # via method_missing and doesn't require to manage the token
28
- class Session
29
- def initialize(client, token)
30
- @client, @token = client, token
31
- end
32
-
33
- def method_missing(sym, args, &block)
34
- token_args = [@token] << args
35
- xmlrpc_method = "#{Host::JIRA_API}.#{sym.to_s}"
36
- @client.call(xmlrpc_method, *token_args)
37
- end
38
- end
39
- end
40
- end
@@ -1,43 +0,0 @@
1
- module Tracker
2
- module Jira
3
- class JiraProject < Base
4
- attr_accessor :host, :identifier
5
-
6
- def initialize(host=nil, identifier=nil)
7
- @host, @identifier = host, identifier
8
- end
9
-
10
- def identifier_regexp
11
- /([A-Z]+-[\d]+)/
12
- end
13
-
14
- def identifier_examples
15
- ["DC-420", "PICO-12"]
16
- end
17
-
18
- def uri
19
- "#{@host.uri}/browse/#{@identifier}"
20
- end
21
-
22
- def issue(issue_identifier)
23
- session = @host.login
24
- begin
25
- issue = session.getIssue(issue_identifier)
26
- Issue.new("#{@host.uri}/browse/#{issue_identifier}", issue["summary"])
27
- rescue XMLRPC::FaultException
28
- # Probably bad issue number
29
- nil
30
- end
31
- end
32
-
33
- def markup(text)
34
- text.gsub(identifier_regexp) do |match|
35
- issue_identifier = $1
36
- issue = issue(issue_identifier)
37
- issue ? "<a href=\"#{issue.uri}\">#{issue.summary}</a>" : issue_identifier
38
- end
39
- end
40
-
41
- end
42
- end
43
- end
@@ -1,8 +0,0 @@
1
- module Tracker
2
- module Mantis
3
- class Project < Base
4
- include DigitIssues
5
-
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Tracker
2
- module Scarab
3
- class Project < Base
4
- include DigitIssues
5
-
6
- end
7
- end
8
- end
@@ -1 +0,0 @@
1
- require 'tracker/trac/project'