rubyforge 2.0.2 → 2.0.3

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 +8 -5
  3. metadata +2 -2
@@ -1,3 +1,8 @@
1
+ === 2.0.3 / 2009-10-11
2
+
3
+ * Added check to ensure user-config contains 'api.rubyforge.org' (Ryan Davis)
4
+ * Removed DEBUG global
5
+
1
6
  === 2.0.2 / 2009-10-05
2
7
 
3
8
  * Switched JSON gem dependency over to json_pure.
@@ -9,12 +9,10 @@ require 'rubyforge/client'
9
9
 
10
10
  $TESTING = false unless defined? $TESTING
11
11
 
12
- $DEBUG=false
13
-
14
12
  class RubyForge
15
13
 
16
14
  # :stopdoc:
17
- VERSION = '2.0.2'
15
+ VERSION = '2.0.3'
18
16
  HOME = ENV["HOME"] || ENV["HOMEPATH"] || File::expand_path("~")
19
17
  RUBYFORGE_D = File::join HOME, ".rubyforge"
20
18
  CONFIG_F = File::join RUBYFORGE_D, "user-config.yml"
@@ -71,7 +69,12 @@ class RubyForge
71
69
  end
72
70
 
73
71
  def uri
74
- @uri ||= URI.parse @userconfig['uri']
72
+ uri = @userconfig['uri']
73
+ abort "Using new REST api, but uri isn't api.rubyforge.org.
74
+ run `rubyforge setup` and fix please" if
75
+ uri =~ /rubyforge.org/ and uri !~ /api.rubyforge.org/
76
+
77
+ @uri ||= URI.parse uri
75
78
  end
76
79
 
77
80
  def setup
@@ -110,7 +113,7 @@ class RubyForge
110
113
  end
111
114
 
112
115
  def get_via_rest_api(path)
113
- url = "#{@userconfig['uri']}#{path}"
116
+ url = "#{self.uri}#{path}"
114
117
  puts "Hitting REST API: #{url}" if $DEBUG
115
118
  JSON.parse(client.get_content(url, {}, {}, @userconfig))
116
119
  end
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: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2009-10-06 00:00:00 -04:00
15
+ date: 2009-10-11 00:00:00 -04:00
16
16
  default_executable:
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency