xforge 0.1.9 → 0.2.0

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.2.0
4
+
5
+ First stable release of the XForge QRS.
6
+
7
+ * Renamed Project.name to Project.unix_name
8
+ * Wrote better documentation
9
+ * Included CVS tagging in the Rakefile
10
+
3
11
  == Version 0.1.9
4
12
 
5
13
  This release adds more functionality for news publishing
data/README CHANGED
@@ -1,17 +1,20 @@
1
1
  = XForge
2
2
 
3
- This package contains XForge, a simple library to interact with RubyForge,
4
- SourceForge, GForge or other SourceForge clones.
3
+ XForge is a Quick Release System (QRS) for RubyForge, SourceForge and other SourceForge clones. XForge also allows users to query SCM information and other metadata about hosted projects.
5
4
 
6
5
  XForge has the following features:
7
6
 
8
7
  * Look up projects by unix name (no need to worry about group_id or package_id).
9
8
 
10
- * Upload new releases (with multiple files if desired).
9
+ * Create/Upload new releases (with multiple files if desired).
11
10
 
12
- * Rake integration.
11
+ * Rake integration (use XForge from Rake scripts).
13
12
 
14
- * Automatically create RSCM (http://rscm.rubyforge.org) objects from projects.
13
+ * Query SCM meta information (using RSCM - http://rscm.rubyforge.org).
14
+
15
+ * Publish news items about a project.
16
+
17
+ * Query home page URLs for a project.
15
18
 
16
19
  == Download/Installation
17
20
 
@@ -27,7 +30,7 @@ Download and install XForge with the following.
27
30
 
28
31
  == Usage
29
32
 
30
- See XForge and Rake::XForge::Release.
33
+ See XForge, Rake::XForge::Release and Rake::XForge::NewsPublisher.
31
34
 
32
35
  ---
33
36
 
data/Rakefile CHANGED
@@ -24,7 +24,7 @@ require 'rake/rdoctask'
24
24
  #
25
25
  # REMEMBER TO KEEP PKG_VERSION IN SYNC WITH CHANGELOG
26
26
  PKG_NAME = "xforge"
27
- PKG_VERSION = "0.1.9"
27
+ PKG_VERSION = "0.2.0"
28
28
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
29
29
  PKG_FILES = FileList[
30
30
  '[A-Z]*',
@@ -117,7 +117,7 @@ task :todo do
117
117
  egrep /#.*(FIXME|TODO|TBD)/
118
118
  end
119
119
 
120
- task :release => [:release_files, :publish_doc, :publish_news]
120
+ task :release => [:release_files, :publish_doc, :publish_news, :tag]
121
121
 
122
122
  task :publish_doc => [:rdoc] do
123
123
  publisher = Rake::RubyForgePublisher.new(PKG_NAME, ENV['RUBYFORGE_USER'])
@@ -152,3 +152,10 @@ task :publish_news => [:gem] do
152
152
  news.password = ENV['RUBYFORGE_PASSWORD']
153
153
  end
154
154
  end
155
+
156
+ desc "Tag all the CVS files with the latest release number (REL=x.y.z)"
157
+ task :tag do
158
+ reltag = "REL_#{PKG_VERSION.gsub(/\./, '_')}"
159
+ puts "Tagging CVS with [#{reltag}]"
160
+ sh %{cvs tag #{reltag}}
161
+ end
@@ -5,8 +5,8 @@ module Rake
5
5
  class Base
6
6
  attr_writer :user_name, :password
7
7
 
8
- def initialize(project_name, host=::XForge::RubyForge.new)
9
- @project_name = project_name
8
+ def initialize(project_unix_name, host=::XForge::RubyForge.new)
9
+ @project_unix_name = project_unix_name
10
10
  @host = host
11
11
 
12
12
  set_defaults
@@ -27,7 +27,7 @@ module Rake
27
27
  end
28
28
 
29
29
  def execute
30
- project = @host.project(@project_name)
30
+ project = @host.project(@project_unix_name)
31
31
  u = user_name
32
32
  session = project.login(u, password)
33
33
  session.publish_news(@subject, @details)
@@ -71,7 +71,7 @@ module Rake
71
71
  end
72
72
 
73
73
  def execute
74
- project = @host.project(@project_name)
74
+ project = @host.project(@project_unix_name)
75
75
  u = user_name
76
76
  session = project.login(u, password)
77
77
  session.release(@release_name, @files, @release_notes, @release_changes)
@@ -20,7 +20,7 @@ module ScmWeb
20
20
  unless(mod == "CVSROOT")
21
21
  scm = RSCM::Cvs.new
22
22
  scm.root = ":pserver:anonymous@#{project.host.cvs_host_name}:#{project.host.cvs_path}/#{mod}"
23
- scm.mod = project.name
23
+ scm.mod = project.unix_name
24
24
  @scms << scm
25
25
  end
26
26
  end
@@ -40,7 +40,7 @@ module ScmWeb
40
40
  uri_spec = @uri_specs[type]
41
41
  raise "No uri_spec for #{type}" unless uri_spec
42
42
 
43
- project_name = project.name
43
+ project_unix_name = project.unix_name
44
44
  revision = options[:revision]
45
45
  eval("\"#{uri_spec}\"", binding)
46
46
  end
data/lib/xforge/host.rb CHANGED
@@ -1,16 +1,26 @@
1
1
  module XForge
2
- # A Host represents a proxy to a server
2
+ # A Host represents a proxy to a server. Most of the time
3
+ # you don't want to use this class directly, but rather one
4
+ # of its subclasses. Example:
5
+ #
6
+ # require 'xforge'
7
+ #
8
+ # rubyforge = XForge::RubyForge.new
9
+ # xforge = rubyforge.project('xforge')
10
+ # session = xforge.login(my_user, my_password)
11
+ # session.release(["pkg/xforge-0.1.gem"], "XForge-0.1")
12
+ #
3
13
  class Host
4
14
  attr_reader :name
5
15
 
6
- # Create a new Host proxy located at +name+.
16
+ # Create a new Host proxy located at IP +name+.
7
17
  def initialize(name)
8
18
  @name = name
9
19
  end
10
20
 
11
- # Get access to
12
- def project(name)
13
- Project.new(self, name)
21
+ # Returns the Project with the given +unix_name+.
22
+ def project(unix_name)
23
+ Project.new(self, unix_name)
14
24
  end
15
25
  end
16
26
  end
@@ -7,17 +7,18 @@ module XForge
7
7
  # A Project is an interface to a hosted project.
8
8
  class Project
9
9
 
10
- attr_reader :host, :name
10
+ attr_reader :host, :unix_name
11
11
 
12
- def initialize(host, name)
12
+ def initialize(host, unix_name)
13
13
  @host = host
14
- @name = name
14
+ @unix_name = unix_name
15
15
  end
16
16
 
17
17
  # Logs in and returns a Session
18
18
  def login(user_name, password)
19
19
  http = Net::HTTP.new(@host.name, host.login_port)
20
20
 
21
+ # Can't get this to work, so login doesn't work on SourceForge yet!
21
22
  # http://www.ruby-lang.org/ja/man/index.cgi?cmd=view;name=net%2Fhttps.rb
22
23
  if(host.login_port == 443)
23
24
  http.use_ssl = true
@@ -57,7 +58,7 @@ module XForge
57
58
  end
58
59
 
59
60
  def project_uri
60
- "http://#{@host.name}/projects/#{@name}/"
61
+ "http://#{@host.name}/projects/#{@unix_name}/"
61
62
  end
62
63
 
63
64
  # The home page of this project
@@ -1,7 +1,7 @@
1
1
  module XForge
2
2
  class RubyForge < Host
3
3
  VIEW_CVS = "http://rubyforge.org/cgi-bin/viewcvs.cgi/"
4
- PATH_CVSROOT = "\#{path}?cvsroot=\#{project_name}"
4
+ PATH_CVSROOT = "\#{path}?cvsroot=\#{project_unix_name}"
5
5
  PATH_CVSROOT_REV = "#{PATH_CVSROOT}&rev=\#{revision}"
6
6
 
7
7
  OVERVIEW = "#{VIEW_CVS}#{PATH_CVSROOT}"
@@ -25,7 +25,7 @@ module XForge
25
25
  end
26
26
 
27
27
  def scm_web(project)
28
- module_regexp = /href=\"(\w+)\/\?cvsroot=#{project.name}/
28
+ module_regexp = /href=\"(\w+)\/\?cvsroot=#{project.unix_name}/
29
29
  ::ScmWeb::ViewCvs.new({:overview => OVERVIEW, :raw => RAW, :html => HTML}, project, module_regexp)
30
30
  end
31
31
 
@@ -117,9 +117,16 @@ module XForge
117
117
  raise("Couldn't get release id") unless release_id
118
118
  end
119
119
  end
120
+ puts "Done!"
120
121
  end
121
122
 
122
123
  def publish_news(subject, details)
124
+ puts "About to publish news"
125
+ puts "Subject: '#{subject}'"
126
+ puts "Details:"
127
+ puts details
128
+ puts ""
129
+
123
130
  release_response = Net::HTTP.start(@host.name, 80) do |http|
124
131
  query_hash = {
125
132
  "group_id" => @project.group_id,
@@ -134,7 +141,9 @@ module XForge
134
141
  "Content-Type" => "multipart/form-data"
135
142
  )
136
143
  http.post(target + query(query_hash), "", headers)
144
+
137
145
  end
146
+ puts "Done!"
138
147
  end
139
148
 
140
149
  private
@@ -1,7 +1,7 @@
1
1
  module XForge
2
2
  class SourceForge < Host
3
3
  VIEW_CVS = "http://cvs.sourceforge.net/viewcvs.py/"
4
- PROJECT_PATH = "\#{project_name}/\#{path}"
4
+ PROJECT_PATH = "\#{project_unix_name}/\#{path}"
5
5
  REV = "rev=\#{revision}"
6
6
 
7
7
  OVERVIEW = "#{VIEW_CVS}#{PROJECT_PATH}"
@@ -25,7 +25,7 @@ module XForge
25
25
  end
26
26
 
27
27
  def scm_web(project)
28
- module_regexp = /viewcvs\.py\/#{project.name}\/(\w+)\//
28
+ module_regexp = /viewcvs\.py\/#{project.unix_name}\/(\w+)\//
29
29
  ::ScmWeb::ViewCvs.new({:overview => OVERVIEW, :raw => RAW, :html => HTML}, project, module_regexp)
30
30
  end
31
31
 
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.8.8
3
3
  specification_version: 1
4
4
  name: xforge
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.9
6
+ version: 0.2.0
7
7
  date: 2005-08-14
8
8
  summary: Ruby based make-like utility.
9
9
  require_paths: