rubyforge 1.0.0 → 1.0.1

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.
data/History.txt CHANGED
@@ -1,5 +1,10 @@
1
1
  == Version History:
2
2
 
3
+ === 1.0.1 / 2008-10-22:
4
+
5
+ * Fixed multipart form upload so it isn't url escaping the data. DOH.
6
+ * Affects release_notes and release_changes, but never reported for 5 months.
7
+
3
8
  === 1.0.0 / 2008-05-20:
4
9
 
5
10
  * Removed HTTPAccess2, thanks to Aaron Patterson. Even tho he's whiny.
data/Rakefile CHANGED
@@ -8,11 +8,8 @@ rescue LoadError
8
8
  please install it via rubygems."
9
9
  end
10
10
 
11
- Object.send :remove_const, :RubyForge if defined? RubyForge
12
-
13
- $LOAD_PATH << "./lib"
14
-
15
- require './lib/rubyforge'
11
+ abort "you _must_ install this gem to release it" if
12
+ ENV['VERSION'] && ENV['VERSION'] != RubyForge::VERSION
16
13
 
17
14
  Hoe.new("rubyforge", RubyForge::VERSION) do |rubyforge|
18
15
  rubyforge.rubyforge_name = "codeforpeople"
@@ -22,7 +19,6 @@ Hoe.new("rubyforge", RubyForge::VERSION) do |rubyforge|
22
19
  rubyforge.developer('Eric Hodel', 'drbrain@segment7.net')
23
20
  rubyforge.developer('Ara T Howard', 'ara.t.howard@gmail.com')
24
21
 
25
-
26
22
  rubyforge.multiruby_skip << "rubinius"
27
23
  end
28
24
 
@@ -14,7 +14,7 @@ class Time
14
14
  old_utc(*args)
15
15
  end
16
16
  end
17
- end
17
+ end unless Time.respond_to? :old_utc
18
18
 
19
19
  # clean up "using default DH parameters" warning for https
20
20
  class Net::HTTP
@@ -23,7 +23,7 @@ class Net::HTTP
23
23
  self.old_use_ssl = flag
24
24
  @ssl_context.tmp_dh_callback = proc {}
25
25
  end
26
- end
26
+ end unless Net::HTTP.public_instance_methods.include? "old_use_ssl="
27
27
 
28
28
  class RubyForge
29
29
  class Client
@@ -103,17 +103,17 @@ class RubyForge
103
103
  parameter = "--#{boundary}\r\nContent-Disposition: form-data; name=\"" +
104
104
  WEBrick::HTTPUtils.escape_form(k.to_s) + "\""
105
105
 
106
- if v.respond_to?(:path)
106
+ if v.respond_to? :path
107
107
  parameter += "; filename=\"#{File.basename(v.path)}\"\r\n"
108
108
  parameter += "Content-Transfer-Encoding: binary\r\n"
109
109
  parameter += "Content-Type: text/plain"
110
110
  end
111
111
  parameter += "\r\n\r\n"
112
112
 
113
- if v.respond_to?(:path)
113
+ if v.respond_to? :path
114
114
  parameter += v.read
115
115
  else
116
- parameter += WEBrick::HTTPUtils.escape_form(v.to_s)
116
+ parameter += v.to_s
117
117
  end
118
118
 
119
119
  parameter
data/lib/rubyforge.rb CHANGED
@@ -11,7 +11,7 @@ $TESTING = false unless defined? $TESTING
11
11
  class RubyForge
12
12
 
13
13
  # :stopdoc:
14
- VERSION = '1.0.0'
14
+ VERSION = '1.0.1'
15
15
  HOME = ENV["HOME"] || ENV["HOMEPATH"] || File::expand_path("~")
16
16
  RUBYFORGE_D = File::join HOME, ".rubyforge"
17
17
  CONFIG_F = File::join RUBYFORGE_D, "user-config.yml"
@@ -267,9 +267,11 @@ class RubyForge
267
267
  processor_id ||= "Any"
268
268
  processor_id = lookup "processor", processor_id
269
269
 
270
- release_notes = IO::read(release_notes) if release_notes and test(?e, release_notes)
270
+ release_notes = IO::read(release_notes) if
271
+ test(?e, release_notes) if release_notes
271
272
 
272
- release_changes = IO::read(release_changes) if release_changes and test(?e, release_changes)
273
+ release_changes = IO::read(release_changes) if
274
+ test(?e, release_changes) if release_changes
273
275
 
274
276
  preformatted = preformatted ? 1 : 0
275
277
 
@@ -46,8 +46,8 @@ class TestRubyForgeClient < Test::Unit::TestCase
46
46
  end
47
47
 
48
48
  def test_post_with_params
49
- @client.post_content('http://example.com', { :f => 'adsf'})
50
- assert_equal('f=adsf', RubyForge::FakeAgent.t_data)
49
+ @client.post_content('http://example.com', { :f => 'adsf aoeu'})
50
+ assert_equal('f=adsf+aoeu', RubyForge::FakeAgent.t_data)
51
51
 
52
52
  @client.post_content('http://example.com', { :a => 'b', :c => 'd' })
53
53
  assert_equal('a=b&c=d', RubyForge::FakeAgent.t_data)
@@ -57,18 +57,18 @@ class TestRubyForgeClient < Test::Unit::TestCase
57
57
  random = Array::new(8){ "%2.2d" % rand(42) }.join('__')
58
58
  boundary = "multipart/form-data; boundary=___#{ random }___"
59
59
 
60
- request = <<-END
60
+ expected = <<-END
61
61
  --___#{random}___\r
62
62
  Content-Disposition: form-data; name="a"\r\n\r
63
- b\r
63
+ a b c\r
64
64
  --___#{random}___--\r
65
65
  END
66
66
 
67
67
  @client.post_content( 'http://example.com',
68
- { :a => 'b' },
68
+ { :a => 'a b c' },
69
69
  { 'content-type' => boundary }
70
70
  )
71
- assert_equal(request, RubyForge::FakeAgent.t_data)
71
+ assert_equal(expected, RubyForge::FakeAgent.t_data)
72
72
  end
73
73
 
74
74
  def test_multipart_post_two_params
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyforge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2008-05-20 00:00:00 -07:00
14
+ date: 2008-10-22 00:00:00 -05:00
15
15
  default_executable:
16
16
  dependencies: []
17
17
 
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  requirements: []
64
64
 
65
65
  rubyforge_project: codeforpeople
66
- rubygems_version: 1.1.1
66
+ rubygems_version: 1.3.0
67
67
  signing_key:
68
68
  specification_version: 2
69
69
  summary: A script which automates a limited set of rubyforge operations