rubyforge 1.0.3 → 1.0.4

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.
@@ -1,57 +1,63 @@
1
- == Version History:
1
+ === 1.0.4 / 2009-07-21
2
2
 
3
- === 1.0.3 / 2009-02-26:
3
+ * Uses the passed in proxy, if provided. (Thanks sdabet, RF #24071).
4
+ * Update group_id pattern for scraping project configs you are only a member of.
5
+ * Update regexp used to validate login page to be less restrictive.
6
+ * Fixed --help to not require an argument.
7
+ * add --force flag for login command to ignore previous cookie. (or use logout)
8
+
9
+ === 1.0.3 / 2009-02-26
4
10
 
5
11
  * Fixed nil error in our Net::HTTP patches.
6
12
  * Removed password from warning if the login possibly failed.
7
13
 
8
- === 1.0.2 / 2009-01-05:
14
+ === 1.0.2 / 2009-01-05
9
15
 
10
16
  * All webby commands now login automatically.
11
17
  * Login now no-ops if it already has a session cookie.
12
18
  * Added logout command.
13
19
  * Much more of the config is self-repairing, but still not bulletproof yet.
14
20
 
15
- === 1.0.1 / 2008-10-22:
21
+ === 1.0.1 / 2008-10-22
16
22
 
17
23
  * Fixed multipart form upload so it isn't url escaping the data. DOH.
18
24
  * Affects release_notes and release_changes, but never reported for 5 months.
19
25
 
20
- === 1.0.0 / 2008-05-20:
26
+ === 1.0.0 / 2008-05-20
21
27
 
22
28
  * Removed HTTPAccess2, thanks to Aaron Patterson. Even tho he's whiny.
23
29
  * Changed initialize/configure to make testing scream. 100x faster.
24
30
 
25
- === 0.4.5 / 2008-03-11:
31
+ === 0.4.5 / 2008-03-11
26
32
 
27
33
  * Update for Ruby 1.9.0.
28
34
  * Updated History, Rakefile, and Readme for new hoe abilities.
29
35
  * Added config backup/restore rake tasks (for testing).
30
36
 
31
- === 0.4.4 / 2007-08-13:
37
+ === 0.4.4 / 2007-08-13
32
38
 
33
39
  * New type_id values will merge with extant data. (self-repairing data is Good)
34
40
  * Scrape processor_ids, merging in with extant data.
35
41
  * Default to "Other" if a file's type is unrecognized.
36
42
 
37
- === 0.4.3 / 2007-07-23:
43
+ === 0.4.3 / 2007-07-23
38
44
 
39
45
  * Set mode on .rubyforge directory to 700.
40
46
  * Fix fetching of user id when user has no releases.
41
47
 
42
- === 0.4.2 / 2007-05-21:
48
+ === 0.4.2 / 2007-05-21
43
49
 
44
50
  * Fix for windoze users (spaces in path).
45
51
  * Added check for extant release.
46
52
  * Added default hash for first-time releases.
47
53
 
48
- === 0.4.1 / 2007-03-08:
54
+ === 0.4.1 / 2007-03-08
49
55
 
50
56
  * Verify that login succeeded and warn against if not (prolly should raise).
51
57
  * Print a friendly error if you have the wrong package id.
52
58
  * Handle upload error in add_release a bit better.
53
59
 
54
- === 0.4.0 / 2007-01-09:
60
+ === 0.4.0 / 2007-01-09
55
61
 
56
62
  * config.yml split and moved to user-config.yml (up to the user to do).
57
63
  * auto-config.yml now generated via config command.
@@ -62,17 +68,17 @@
62
68
  * scrape_config no longer takes a user param. Use opts to specify.
63
69
  * scrape_project, add_project, add/remove_release now save automatically.
64
70
 
65
- === 0.3.2 / 2006-11-29:
71
+ === 0.3.2 / 2006-11-29
66
72
 
67
73
  * Fixed file uploads for windows.
68
74
  * Correctly scrape releases with funky characters.
69
75
 
70
- === 0.3.1 / 2006-10-24:
76
+ === 0.3.1 / 2006-10-24
71
77
 
72
78
  * Added SSL login.
73
79
  * Added yet more debugging output if $DEBUG.
74
80
 
75
- === 0.3.0 / 2006-09-30:
81
+ === 0.3.0 / 2006-09-30
76
82
 
77
83
  * Added more debugging output if $DEBUG
78
84
  * Added news posting.
@@ -80,11 +86,11 @@
80
86
  * add_release now returns release_id
81
87
  * Fixed config scraper to include '-' in names.
82
88
 
83
- === 0.2.1 / 2006-09-14:
89
+ === 0.2.1 / 2006-09-14
84
90
 
85
91
  * Gemspec was too loose about packaging. Now using manifest.
86
92
 
87
- === 0.2.0 / 2006-09-13:
93
+ === 0.2.0 / 2006-09-13
88
94
 
89
95
  * Split original script into script and library.
90
96
  * Added tests for library.
data/README.txt CHANGED
@@ -35,7 +35,7 @@ A script which automates a limited set of rubyforge operations.
35
35
 
36
36
  (The MIT License)
37
37
 
38
- Copyright (c) 2006-2009 Ryan Davis, Eric Hodel, Ara T Howard.
38
+ Copyright (c) Ryan Davis, Eric Hodel, Ara T Howard.
39
39
 
40
40
  Permission is hereby granted, free of charge, to any person obtaining
41
41
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -1,28 +1,20 @@
1
1
  # -*- ruby -*-
2
2
 
3
- $:.unshift 'lib'
4
- require 'rubyforge'
5
-
6
- begin
7
- require 'hoe'
8
- rescue LoadError
9
- abort "ERROR: This Rakefile is only useful with hoe installed.
10
- If you're trying to install the rubyforge library,
11
- please install it via rubygems."
12
- end
3
+ require 'rubygems'
4
+ require 'hoe'
13
5
 
14
6
  abort "you _must_ install this gem to release it" if
15
7
  ENV['VERSION'] && ENV['VERSION'] != RubyForge::VERSION
16
8
 
17
- Hoe.new("rubyforge", RubyForge::VERSION) do |rubyforge|
18
- rubyforge.rubyforge_name = "codeforpeople"
19
- rubyforge.need_tar = false
9
+ Hoe.spec "rubyforge" do
10
+ developer 'Ryan Davis', 'ryand-ruby@zenspider.com'
11
+ developer 'Eric Hodel', 'drbrain@segment7.net'
12
+ developer 'Ara T Howard', 'ara.t.howard@gmail.com'
20
13
 
21
- rubyforge.developer('Ryan Davis', 'ryand-ruby@zenspider.com')
22
- rubyforge.developer('Eric Hodel', 'drbrain@segment7.net')
23
- rubyforge.developer('Ara T Howard', 'ara.t.howard@gmail.com')
14
+ multiruby_skip << "rubinius"
24
15
 
25
- rubyforge.multiruby_skip << "rubinius"
16
+ self.rubyforge_name = "codeforpeople"
17
+ self.need_tar = false
26
18
  end
27
19
 
28
20
  task :backup do
@@ -136,7 +136,8 @@ EOL
136
136
  mode = ARGV.shift
137
137
 
138
138
  opts = GetoptLong::new(
139
- [ "--help" , "-h" , GetoptLong::REQUIRED_ARGUMENT ],
139
+ [ "--help" , "-h" , GetoptLong::NO_ARGUMENT ],
140
+ [ "--force" , "-F" , GetoptLong::NO_ARGUMENT ],
140
141
  [ "--username" , "-u" , GetoptLong::REQUIRED_ARGUMENT ],
141
142
  [ "--password" , "-p" , GetoptLong::REQUIRED_ARGUMENT ],
142
143
  [ "--cookie_jar" , "-C" , GetoptLong::REQUIRED_ARGUMENT ],
@@ -11,7 +11,7 @@ $TESTING = false unless defined? $TESTING
11
11
  class RubyForge
12
12
 
13
13
  # :stopdoc:
14
- VERSION = '1.0.3'
14
+ VERSION = '1.0.4'
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"
@@ -61,6 +61,10 @@ class RubyForge
61
61
  self
62
62
  end
63
63
 
64
+ def force
65
+ @userconfig['force']
66
+ end
67
+
64
68
  def cookie_store
65
69
  client.cookie_store
66
70
  end
@@ -120,7 +124,8 @@ class RubyForge
120
124
 
121
125
  unless data["group_ids"].has_key? project then
122
126
  html = URI.parse("http://rubyforge.org/projects/#{project}/index.html").read
123
- group_id = html[/(frs|tracker|mail)\/\?group_id=\d+/][/\d+/].to_i
127
+ group_id = html[%r/(memberlist.php|frs|tracker|mail)\/?\?group_id=\d+/][%r/\d+/].to_i
128
+
124
129
  data["group_ids"][project] = group_id
125
130
  end
126
131
 
@@ -169,7 +174,7 @@ class RubyForge
169
174
  end
170
175
 
171
176
  def login
172
- return if cookie_store['rubyforge.org']['session_ser'] rescue false
177
+ return if(!force and cookie_store['rubyforge.org']['session_ser']) rescue false
173
178
 
174
179
  page = self.uri + "/account/login.php"
175
180
  page.scheme = 'https'
@@ -187,7 +192,7 @@ class RubyForge
187
192
 
188
193
  response = run page, form
189
194
 
190
- re = %r/personal\s+page\s+for:\s+#{ Regexp.escape username }/iom
195
+ re = %r/personal\s+page/iom
191
196
  unless response =~ re
192
197
  warn("%s:%d: warning: potentially failed login using %s" %
193
198
  [__FILE__, __LINE__, username]) unless $TESTING
@@ -336,8 +341,8 @@ class RubyForge
336
341
  # package_id, and release_id
337
342
  #
338
343
  # example :
339
- # add_file("codeforpeople.com", "traits", "0.8.0", "traits-0.8.0.gem")
340
- # add_file("codeforpeople.com", "traits", "0.8.0", "traits-0.8.0.tgz")
344
+ # add_file("codeforpeople", "traits", "0.8.0", "traits-0.8.0.gem")
345
+ # add_file("codeforpeople", "traits", "0.8.0", "traits-0.8.0.tgz")
341
346
  # add_file(1024, 1242, "0.8.0", "traits-0.8.0.gem")
342
347
 
343
348
  def add_file(group_name, package_name, release_name, userfile)
@@ -436,7 +441,7 @@ __END__
436
441
  # map your group names to their rubyforge ids
437
442
  #
438
443
  group_ids :
439
- codeforpeople.com : 1024
444
+ codeforpeople : 1024
440
445
  #
441
446
  # map your package names to their rubyforge ids
442
447
  #
@@ -33,7 +33,14 @@ class RubyForge
33
33
  @debug_dev = nil
34
34
  @ssl_verify_mode = OpenSSL::SSL::VERIFY_NONE
35
35
  @cookie_manager = CookieManager.new
36
- @agent_class = Net::HTTP
36
+ if proxy
37
+ begin
38
+ proxy_uri = URI.parse(proxy)
39
+ @agent_class = Net::HTTP::Proxy(proxy_uri.host,proxy_uri.port)
40
+ rescue URI::InvalidURIError
41
+ end
42
+ end
43
+ @agent_class ||= Net::HTTP
37
44
  end
38
45
 
39
46
  def cookie_store
@@ -68,6 +68,16 @@ class TestRubyForge < Test::Unit::TestCase
68
68
  # end
69
69
  end
70
70
 
71
+ def test_new_with_proxy_uses_a_proxy_class
72
+ client = RubyForge::Client.new('http://localhost:8808/')
73
+ assert client.agent_class.proxy_class?, 'agent class should be a proxy'
74
+ end
75
+
76
+ def test_new_with_bad_proxy_uses_normal_http
77
+ client = RubyForge::Client.new('asdfkjhalksdfjh')
78
+ assert !client.agent_class.proxy_class?, 'agent class should not be a proxy'
79
+ end
80
+
71
81
  def test_initialize_bad
72
82
  @cookie_path = File.join(Dir.tmpdir, "cookie.#{$$}.dat")
73
83
  File.open(@cookie_path, 'w') {} # touch
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.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -11,11 +11,23 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2009-02-26 00:00:00 -08:00
14
+ date: 2009-07-21 00:00:00 -07:00
15
15
  default_executable:
16
16
  dependencies: []
17
17
 
18
- description: "A script which automates a limited set of rubyforge operations. * Run 'rubyforge help' for complete usage. * Setup: For first time users AND upgrades to 0.4.0: * rubyforge setup (deletes your username and password, so run sparingly!) * edit ~/.rubyforge/user-config.yml * rubyforge config * For all rubyforge upgrades, run 'rubyforge config' to ensure you have latest. * Don't forget to login! logging in will store a cookie in your .rubyforge directory which expires after a time. always run the login command before any operation that requires authentication, such as uploading a package."
18
+ description: |-
19
+ A script which automates a limited set of rubyforge operations.
20
+
21
+ * Run 'rubyforge help' for complete usage.
22
+ * Setup: For first time users AND upgrades to 0.4.0:
23
+ * rubyforge setup (deletes your username and password, so run sparingly!)
24
+ * edit ~/.rubyforge/user-config.yml
25
+ * rubyforge config
26
+ * For all rubyforge upgrades, run 'rubyforge config' to ensure you have latest.
27
+ * Don't forget to login! logging in will store a cookie in your
28
+ .rubyforge directory which expires after a time. always run the
29
+ login command before any operation that requires authentication,
30
+ such as uploading a package.
19
31
  email:
20
32
  - ryand-ruby@zenspider.com
21
33
  - drbrain@segment7.net
@@ -42,6 +54,8 @@ files:
42
54
  - test/test_rubyforge_cookie_manager.rb
43
55
  has_rdoc: true
44
56
  homepage: http://codeforpeople.rubyforge.org/rubyforge/
57
+ licenses: []
58
+
45
59
  post_install_message:
46
60
  rdoc_options:
47
61
  - --main
@@ -63,9 +77,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
77
  requirements: []
64
78
 
65
79
  rubyforge_project: codeforpeople
66
- rubygems_version: 1.3.1
80
+ rubygems_version: 1.3.4
67
81
  signing_key:
68
- specification_version: 2
82
+ specification_version: 3
69
83
  summary: A script which automates a limited set of rubyforge operations
70
84
  test_files:
71
85
  - test/test_rubyforge.rb