rubyforge 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/History.txt +5 -0
  2. data/lib/rubyforge.rb +6 -5
  3. metadata +2 -2
@@ -1,5 +1,10 @@
1
1
  Version History:
2
2
 
3
+ * 0.4.2 / 2007-05-21:
4
+ * Fix for windoze users (spaces in path).
5
+ * Added check for extant release.
6
+ * Added default hash for first-time releases.
7
+
3
8
  * 0.4.1 / 2007-03-08:
4
9
  * Verify that login succeeded and warn against if not (prolly should raise).
5
10
  * Print a friendly error if you have the wrong package id.
@@ -26,7 +26,7 @@ end
26
26
  class RubyForge
27
27
 
28
28
  # :stopdoc:
29
- VERSION = "0.4.1"
29
+ VERSION = "0.4.2"
30
30
  HOME = ENV["HOME"] || ENV["HOMEPATH"] || File::expand_path("~")
31
31
  RUBYFORGE_D = File::join HOME, ".rubyforge"
32
32
  CONFIG_F = File::join RUBYFORGE_D, "user-config.yml"
@@ -57,12 +57,12 @@ class RubyForge
57
57
 
58
58
  def setup
59
59
  FileUtils::mkdir_p RUBYFORGE_D unless test ?d, RUBYFORGE_D
60
- test ?e, CONFIG_F and FileUtils::mv CONFIG_F, "#{ CONFIG_F }.bak"
60
+ test ?e, CONFIG_F and FileUtils::mv CONFIG_F, "#{CONFIG_F}.bak"
61
61
  config = CONFIG[/\A.*(?=^\# AUTOCONFIG)/m]
62
62
  open(CONFIG_F, "w") { |f| f.write config }
63
63
  FileUtils::touch COOKIE_F
64
- edit = (ENV["EDITOR"] || ENV["EDIT"] || "vi") + " #{ CONFIG_F }"
65
- system edit or puts "edit #{ CONFIG_F }"
64
+ edit = (ENV["EDITOR"] || ENV["EDIT"] || "vi") + " '#{CONFIG_F}'"
65
+ system edit or puts "edit '#{CONFIG_F}'"
66
66
  end
67
67
 
68
68
  def save_autoconfig
@@ -259,9 +259,9 @@ class RubyForge
259
259
  boundary = Array::new(8){ "%2.2d" % rand(42) }.join('__')
260
260
  boundary = "multipart/form-data; boundary=___#{ boundary }___"
261
261
 
262
-
263
262
  html = run(page, form, 'content-type' => boundary)
264
263
  raise "Invalid package_id #{package_id}" if html[/Invalid package_id/]
264
+ raise "You have already released this version." if html[/That filename already exists in this project/]
265
265
 
266
266
  release_id = html[/release_id=\d+/][/\d+/].to_i rescue nil
267
267
 
@@ -278,6 +278,7 @@ class RubyForge
278
278
 
279
279
  package_name = @autoconfig["package_ids"].invert[package_id]
280
280
  raise "unknown package name for #{package_id}" if package_name.nil?
281
+ @autoconfig["release_ids"][package_name] ||= {}
281
282
  @autoconfig["release_ids"][package_name][release_name] = release_id
282
283
  save_autoconfig
283
284
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0.9
3
3
  specification_version: 1
4
4
  name: rubyforge
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.4.1
7
- date: 2007-03-08 00:00:00 -08:00
6
+ version: 0.4.2
7
+ date: 2007-05-21 00:00:00 -07:00
8
8
  summary: A simplistic script which automates a limited set of rubyforge operations
9
9
  require_paths:
10
10
  - lib