meta_project 0.4.6 → 0.4.7

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/CHANGES CHANGED
@@ -1,7 +1,18 @@
1
1
  = MetaProject Changelog
2
2
 
3
+ == Version 0.4.7
4
+
5
+ This release makes HTTP access more robust and improves the Pathname API.
6
+
7
+ * More robust HTTP GET with retries and better error messages.
8
+ * Added Pathname.basename and Pathname.parent
9
+ * Small improvements to ScmWeb API.
10
+ * More robust detection of XForge package_id.
11
+
3
12
  == Version 0.4.6
4
13
 
14
+ This release updates documentaion, adds iteration support to Pathname and fixes some minor bugs.
15
+
5
16
  * Updated README.
6
17
  * Added PathnameIterator mixin that can be used to iterate over Pathname and MetaProject::ScmWeb::Pathname to
7
18
  do e.g. egrep or other operations.
data/README CHANGED
@@ -1,4 +1,4 @@
1
- = MetaProject
1
+ = MetaProject 0.4.7
2
2
 
3
3
  MetaProject (formerly XForge) is a library that allows interaction with various project hosting servers, issue trackers, SCMs and SCM browsers through a common API.
4
4
 
data/Rakefile CHANGED
@@ -6,7 +6,7 @@
6
6
  # This file is may be distributed under an MIT style license. See
7
7
  # MIT-LICENSE for details.
8
8
 
9
- $:.unshift('lib')
9
+ # $:.unshift('lib')
10
10
  require 'meta_project'
11
11
  require 'rake/gempackagetask'
12
12
  require 'rake/contrib/rubyforgepublisher'
@@ -24,7 +24,7 @@ require 'rake/rdoctask'
24
24
  #
25
25
  # REMEMBER TO KEEP PKG_VERSION IN SYNC WITH THE CHANGES FILE!
26
26
  PKG_NAME = "meta_project"
27
- PKG_VERSION = "0.4.6"
27
+ PKG_VERSION = "0.4.7"
28
28
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
29
29
  PKG_FILES = FileList[
30
30
  '[A-Z]*',
@@ -34,10 +34,8 @@ PKG_FILES = FileList[
34
34
 
35
35
  task :default => [:gem]
36
36
 
37
- Rake::TestTask.new do |t|
38
- t.libs << "test"
39
- t.test_files = FileList['**/*_test.rb']
40
- t.verbose = true
37
+ task :spec do
38
+ ruby 'behaviours/suite.rb'
41
39
  end
42
40
 
43
41
  # Create a task to build the RDOC documentation tree.
@@ -94,7 +92,6 @@ Rake::GemPackageTask.new(spec) do |pkg|
94
92
  pkg.need_zip = true
95
93
  pkg.need_tar = true
96
94
  end
97
- task :gem => [:test]
98
95
 
99
96
  # Support Tasks ------------------------------------------------------
100
97
 
@@ -0,0 +1,22 @@
1
+ require 'open-uri'
2
+
3
+ # Wrapper around Kernel.open from open-uri
4
+ # that can retry and report better errors
5
+ def better_open(url, retries=2, &block)
6
+ begin
7
+ # open-uri's open
8
+ Kernel.open(url, &block)
9
+ rescue Errno::ECONNREFUSED, EOFError => e
10
+ if(retries > 0)
11
+ STDERR.puts "Connection refused to #{url} - retrying in 1 sec."
12
+ sleep 1
13
+ better_open(url, retries-1, &block)
14
+ else
15
+ e.message << " (URL:#{url})"
16
+ raise e
17
+ end
18
+ rescue OpenURI::HTTPError => e
19
+ e.message << " (URL:#{url})"
20
+ raise e
21
+ end
22
+ end
@@ -3,5 +3,7 @@ module MetaProject
3
3
  class Base
4
4
  attr_reader :scm, :scm_web, :tracker, :name, :home_page
5
5
  end
6
+
7
+ class ProjectException < Exception; end
6
8
  end
7
9
  end
@@ -5,19 +5,20 @@ module MetaProject
5
5
 
6
6
  def initialize(unix_name, svn_path, jira_id)
7
7
  @unix_name = unix_name
8
+ @name = unix_name
8
9
  @scm = RSCM::Subversion.new("svn://svn.#{unix_name}.codehaus.org/#{unix_name}/scm/#{svn_path}", svn_path)
9
10
  @tracker = ::MetaProject::Tracker::Jira::JiraTracker.new("http://jira.codehaus.org", jira_id)
10
11
 
11
- overview = "http://svn.#{unix_name}.codehaus.org/#{svn_path}/"
12
- history = "#{overview}\#{path}"
12
+ dir = "http://svn.#{unix_name}.codehaus.org/#{svn_path}/\#{path}"
13
+ history = dir
13
14
  raw = "#{history}?rev=\#{revision}"
14
- html = "#{raw}&view=markup"
15
+ html = "#{raw}&view=markup"
15
16
  # http://svn.picocontainer.codehaus.org/java/picocontainer/trunk/container/project.xml?r1=2220&r2=2234&p1=java/picocontainer/trunk/container/project.xml&p2=java/picocontainer/trunk/container/project.xml
16
17
  diff = "#{history}?r1=\#{previous_revision}&r2=\#{revision}&p1=#{svn_path}/\#{path}&p2=#{svn_path}/\#{path}"
17
18
  child_dirs_pattern = /<a name="([^"]+)" href="([^"]+)">[\r\n\s]+<img src="\/icons\/small\/dir.gif"/
18
19
  child_files_pattern = /<a href="[^"]+\/([^\?]+)\?rev=([\d]+)&view=auto">/
19
20
 
20
- @scm_web = ScmWeb::Browser.new(overview, history, raw, html, diff, child_dirs_pattern, child_files_pattern)
21
+ @scm_web = ScmWeb::Browser.new(dir, history, raw, html, diff, child_dirs_pattern, child_files_pattern)
21
22
  end
22
23
 
23
24
  def home_page
@@ -10,31 +10,34 @@ module MetaProject
10
10
  @tracker = ::MetaProject::Tracker::Trac::TracTracker.new(@trac_base_url)
11
11
  end
12
12
 
13
+ TRAC_VERSION_PATTERN = /<strong>Trac ([\d\.]+)\w*<\/strong>/
14
+
13
15
  def scm_web
14
16
  unless @scm_web
15
- overview = "#{@trac_base_url}/browser/#{@svn_path}/"
16
- diff = "#{@trac_base_url}/changeset/\#{revision}"
17
17
 
18
- front_page = open(@trac_base_url).read
19
- if(front_page =~ /<strong>Trac ([\d\.]+)\w*<\/strong>/)
20
-
18
+ front_page = better_open(@trac_base_url).read
19
+ if(front_page =~ TRAC_VERSION_PATTERN)
21
20
  version = $1
22
21
  version = "#{version}.0" if version =~ /[\d]+\.[\d]+\.$/
23
22
  version = version.gsub(/\./, "").to_i
24
23
 
25
24
  if(version >= 90)
26
- history = "#{@trac_base_url}/browser/#{@svn_path}/\#{path}"
27
25
  html = "#{@trac_base_url}/browser/#{@svn_path}/\#{path}?rev=\#{revision}"
28
26
  raw = "#{@trac_base_url}/browser/#{@svn_path}/\#{path}?rev=\#{revision}&format=txt"
29
27
  else
30
- history = "#{@trac_base_url}/log/#{@svn_path}/\#{path}"
31
28
  html = "#{@trac_base_url}/file/#{@svn_path}/\#{path}?rev=\#{revision}"
32
29
  raw = "#{@trac_base_url}/file/#{@svn_path}/\#{path}?rev=\#{revision}&format=txt"
33
30
  end
34
- child_dirs_pattern = /title="Browse Directory" href="[^"]+">([^<]+)<\/a>/
31
+
32
+ dir = "#{@trac_base_url}/browser/#{@svn_path}/\#{path}"
33
+ history = "#{@trac_base_url}/log/#{@svn_path}/\#{path}"
34
+ diff = "#{@trac_base_url}/changeset/\#{revision}"
35
+ child_dirs_pattern = /title="Browse Directory" href="[^"]+">([^<]+)<\/a>/
35
36
  child_files_pattern = /title="View File" href="[^"]+">([^<]+)<\/a>/
36
37
 
37
- @scm_web = ScmWeb::Browser.new(overview, history, raw, html, diff, child_dirs_pattern, child_files_pattern)
38
+ @scm_web = ScmWeb::Browser.new(dir, history, raw, html, diff, child_dirs_pattern, child_files_pattern)
39
+ else
40
+ raise ProjectException.new("Couldn't determine the Trac version. Is the URL '#{@trac_base_url}' correct? I was looking for the regexp /#{TRAC_VERSION_PATTERN.source}/ on the page, but couldn't find it.")
38
41
  end
39
42
  end
40
43
 
@@ -25,16 +25,16 @@ module MetaProject
25
25
  path_cvs_root = "#{mod}/\#{path}#{cvsroot}"
26
26
  path_cvs_root_rev = "#{path_cvs_root}&rev=\#{revision}"
27
27
 
28
- overview = "#{view_cvs}#{mod}/#{cvsroot}"
28
+ dir = "#{view_cvs}#{path_cvs_root}"
29
29
  history = "#{view_cvs}#{path_cvs_root}"
30
30
  raw = "#{view_cvs}*checkout*/#{path_cvs_root_rev}"
31
31
  html = "#{view_cvs}#{path_cvs_root_rev}&content-type=text/vnd.viewcvs-markup"
32
32
  diff = "#{view_cvs}#{mod}/\#{path}.diff#{cvsroot}&r1=\#{previous_revision}&r2=\#{revision}"
33
33
 
34
- child_dirs_pattern = /href="([^\?]*\/)\?cvsroot=#{unix_name}">/
34
+ child_dirs_pattern = /href="([^\?]*)\/\?cvsroot=#{unix_name}">/
35
35
  child_files_pattern = /href="([^\?^\/]*)\?cvsroot=#{unix_name}">/
36
36
 
37
- ScmWeb::Browser.new(overview, history, raw, html, diff, child_dirs_pattern, child_files_pattern)
37
+ ScmWeb::Browser.new(dir, history, raw, html, diff, child_dirs_pattern, child_files_pattern)
38
38
  end
39
39
 
40
40
  # Regexp used to find projects' home page
@@ -1,6 +1,3 @@
1
- require 'net/http'
2
- require 'open-uri'
3
-
4
1
  module MetaProject
5
2
  module Project
6
3
  module XForge
@@ -36,9 +33,13 @@ module MetaProject
36
33
  def package_id
37
34
  unless(@package_id)
38
35
  release_uri = "http://#{@host}/frs/admin/?group_id=#{@project.group_id}"
39
- release_data = open(release_uri, @headers) { |data| data.read }
40
- @package_id = release_data[/[?&]package_id=(\d+)/, 1]
41
- raise "Couldn't get package_id" unless @package_id
36
+ release_data = better_open(release_uri, @headers).read
37
+ package_id_pattern = /name="package_id" value="(\d+)"/
38
+ @package_id = release_data[package_id_pattern, 1]
39
+ unless @package_id
40
+ File.open("package_id.html", "w") {|io| io.write(release_data)}
41
+ raise "Couldn't get package_id from #{release_uri}. I was looking for /#{package_id_pattern.source}/. HTML saved to package_id.html for debugging."
42
+ end
42
43
  end
43
44
  @package_id
44
45
  end
@@ -25,7 +25,7 @@ module MetaProject
25
25
  project_path = "#{unix_name_mod}/\#{path}"
26
26
  rev = "rev=\#{revision}"
27
27
 
28
- overview = "#{view_cvs}#{unix_name_mod}/"
28
+ dir = "#{view_cvs}#{project_path}"
29
29
  history = "#{view_cvs}#{project_path}"
30
30
  raw = "#{view_cvs}*checkout*/#{project_path}?#{rev}"
31
31
  html = "#{history}?#{rev}&view=markup"
@@ -35,7 +35,7 @@ module MetaProject
35
35
  child_dirs_pattern = /<img src="\/icons\/small\/dir.gif"\s+alt="\(dir\)"\s+border=0\s+width=16\s+height=16>[\r\n\s]*([^\/]+)\/<\/a>/
36
36
  child_files_pattern = /href="[^\?]+\/([^\?]+)\?rev=([^&]+)&view=log">/
37
37
 
38
- ScmWeb::Browser.new(overview, history, raw, html, diff, child_dirs_pattern, child_files_pattern)
38
+ ScmWeb::Browser.new(dir, history, raw, html, diff, child_dirs_pattern, child_files_pattern)
39
39
  end
40
40
 
41
41
  # Regexp used to find projects' home page
@@ -1,7 +1,3 @@
1
- require 'net/http'
2
- require 'net/https'
3
- require 'open-uri'
4
-
5
1
  module MetaProject
6
2
  module Project
7
3
  module XForge
@@ -45,10 +41,10 @@ module MetaProject
45
41
  # The group_id of this project
46
42
  def group_id
47
43
  unless(@group_id)
48
- regexp = /project\/memberlist.php\?group_id=(\d+)/
49
- html = open(xforge_project_url).read
50
- @group_id = html[regexp, 1]
51
- raise "Couldn't get group_id from #{xforge_project_url}" unless @group_id
44
+ html = better_open(xforge_project_url).read
45
+ group_id_pattern = /project\/memberlist.php\?group_id=(\d+)/
46
+ @group_id = html[group_id_pattern, 1]
47
+ raise "Couldn't get group_id from #{xforge_project_url}. I was looking for /#{group_id_pattern.source}/" unless @group_id
52
48
  end
53
49
  @group_id
54
50
  end
@@ -64,9 +60,13 @@ module MetaProject
64
60
  # The home page of this project
65
61
  def home_page
66
62
  unless(@home_page)
67
- html = open(xforge_project_url).read
63
+ html = better_open(xforge_project_url).read
68
64
  @home_page = html[home_page_regexp, 1]
69
- raise "Couldn't get home_page" unless @home_page
65
+ unless @home_page
66
+ STDERR.puts "WARNING: Couldn't get home_page from #{xforge_project_url}. I was looking for /#{home_page_regexp.source}/"
67
+ STDERR.puts "Will use #{xforge_project_url} as home page instead."
68
+ @home_page = xforge_project_url
69
+ end
70
70
  end
71
71
  @home_page
72
72
  end
@@ -25,9 +25,9 @@ module MetaProject
25
25
 
26
26
  # Codehaus SVN
27
27
  if(url =~ /http:\/\/svn.(.*).codehaus.org\/(.*)/)
28
- svn_id = $1
28
+ unix_name = $1
29
29
  svn_path = $2[-1..-1] == "/" ? $2[0..-2] : $2
30
- return Project::Codehaus::CodehausProjectSvn.new(svn_id, svn_path, options[:jira_project_id])
30
+ return Project::Codehaus::CodehausProjectSvn.new(unix_name, svn_path, options[:jira_project_id])
31
31
  end
32
32
 
33
33
  end
@@ -6,7 +6,7 @@ module MetaProject
6
6
  #
7
7
  class Browser
8
8
 
9
- attr_accessor :overview_spec, :history_spec, :raw_spec, :html_spec, :diff_spec
9
+ attr_accessor :dir_spec, :history_spec, :raw_spec, :html_spec, :diff_spec
10
10
 
11
11
  # The variables to use in +uri_specs+ are:
12
12
  #
@@ -14,25 +14,35 @@ module MetaProject
14
14
  # * revision
15
15
  # * previous_revision
16
16
  #
17
- def initialize(overview_spec=nil, history_spec=nil, raw_spec=nil, html_spec=nil, diff_spec=nil, child_dirs_pattern=nil, child_files_pattern=nil)
18
- @overview_spec, @history_spec, @raw_spec, @html_spec, @diff_spec, @child_dirs_pattern, @child_files_pattern = overview_spec, history_spec, raw_spec, html_spec, diff_spec, child_dirs_pattern, child_files_pattern
17
+ def initialize(dir_spec=nil, history_spec=nil, raw_spec=nil, html_spec=nil, diff_spec=nil, child_dirs_pattern=nil, child_files_pattern=nil)
18
+ @dir_spec, @history_spec, @raw_spec, @html_spec, @diff_spec, @child_dirs_pattern, @child_files_pattern = dir_spec, history_spec, raw_spec, html_spec, diff_spec, child_dirs_pattern, child_files_pattern
19
+
20
+ # TODO: move to setters. maybe create a spec class?
21
+ validate_presence_of("dir_spec", @dir_spec, "path")
22
+ validate_presence_of("history_spec", @history_spec, "path")
23
+ validate_presence_of("raw_spec", @raw_spec, "path")
24
+ validate_presence_of("raw_spec", @raw_spec, "revision")
25
+ validate_presence_of("html_spec", @html_spec, "path")
26
+ validate_presence_of("html_spec", @html_spec, "revision")
27
+ #validate_presence_of("diff_spec", @diff_spec, "path")
28
+ validate_presence_of("diff_spec", @diff_spec, "revision")
29
+ #validate_presence_of("diff_spec", @diff_spec, "previous_revision")
19
30
  end
20
-
21
- # TODO: deprecate this and use root.cleanpath instead
22
- def overview
23
- file_uri(nil, nil, @overview_spec)
31
+
32
+ def dir(path)
33
+ file_uri(path, nil, @dir_spec, nil)
24
34
  end
25
35
 
26
36
  def history(path)
27
- file_uri(path, nil, @history_spec)
37
+ file_uri(path, nil, @history_spec, nil)
28
38
  end
29
39
 
30
40
  def raw(path, revision)
31
- file_uri(path, revision, @raw_spec)
41
+ file_uri(path, revision, @raw_spec, nil)
32
42
  end
33
43
 
34
44
  def html(path, revision)
35
- file_uri(path, revision, @html_spec)
45
+ file_uri(path, revision, @html_spec, nil)
36
46
  end
37
47
 
38
48
  def diff(path, revision, previous_revision)
@@ -52,19 +62,23 @@ module MetaProject
52
62
  # Returns a Pathname representing the root directory of this browser.
53
63
  # NOTE: The root of the browser may be at a lower level than
54
64
  # the toplevel of the online scm web interface; It depends
55
- # on the configuration of this instance (overview).
65
+ # on the configuration of this instance.
56
66
  def root
57
- Pathname.new(self, "", nil, true)
67
+ Pathname.new(self, nil, "", nil, true)
58
68
  end
59
69
 
60
70
  private
61
71
 
72
+ def validate_presence_of(spec_name, spec, var)
73
+ raise "Missing \#{#{var}} in #{spec_name}: '#{spec}'" unless spec =~ /\#\{#{var}\}/
74
+ end
75
+
62
76
  # Returns the file URI for +path+. Valid options are:
63
77
  #
64
- # * :type => ["overview"|"html"|"diff"|"raw"]
78
+ # * :type => ["dir"|"html"|"diff"|"raw"]
65
79
  # * :revision
66
80
  # * :previous_revision
67
- def file_uri(path="", revision=nil, spec=@overview_spec, previous_revision=nil)
81
+ def file_uri(path, revision, spec, previous_revision)
68
82
  begin
69
83
  eval("\"#{spec}\"", binding)
70
84
  rescue NameError
@@ -1,5 +1,3 @@
1
- require 'open-uri'
2
-
3
1
  module MetaProject
4
2
  module ScmWeb
5
3
  # A subset of the
@@ -8,13 +6,18 @@ module MetaProject
8
6
  #
9
7
  class Pathname
10
8
 
11
- def initialize(browser, path_from_root, revision_identifier, directory)
12
- @browser, @path_from_root, @revision_identifier, @directory = browser, path_from_root, revision_identifier, directory
9
+ def initialize(browser, parent, basename, revision_identifier, directory)
10
+ @browser, @parent, @basename, @revision_identifier, @directory = browser, parent, basename, revision_identifier, directory
13
11
  end
14
12
 
15
13
  # The relative path from the root of the browser instance
14
+ #
15
+ # ""
16
+ # "var"
17
+ # "var/spool"
16
18
  def path_from_root
17
- @path_from_root
19
+ parent_path_from_root = @parent ? @parent.path_from_root : ""
20
+ parent_path_from_root == "" ? @basename : "#{parent_path_from_root}/#{@basename}"
18
21
  end
19
22
 
20
23
  # The revision of this file or nil if this is a directory
@@ -24,47 +27,63 @@ module MetaProject
24
27
 
25
28
  # Returns a Pathname at the +relative_path+ from this directory.
26
29
  # Note: This only works if this instance is a +directory?+
27
- def pathname(relative_path, revision_identifier, directory)
28
- child_path_from_root = (@path_from_root == "") ? relative_path : "#{@path_from_root}#{relative_path}"
29
- Pathname.new(@browser, child_path_from_root, revision_identifier, directory)
30
+ def child(basename, revision_identifier=nil, directory=true)
31
+ raise "Can't create children for files" unless @directory
32
+ Pathname.new(@browser, self, basename, revision_identifier, directory)
30
33
  end
31
34
 
32
35
  # Stlib Pathname methods
36
+
37
+ # The parent of this instance
38
+ def parent
39
+ @parent
40
+ end
33
41
 
34
- # Returns the full path on the web (to the history page)
42
+ # The basename of this instance
43
+ def basename
44
+ @basename
45
+ end
46
+
47
+ # Returns the full path on the web (to the dir page for directories, history page for files)
35
48
  def cleanpath
36
- @browser.history(@path_from_root)
49
+ directory? ? @browser.dir(path_from_root) : @browser.history(path_from_root)
37
50
  end
38
51
 
39
52
  def children
40
53
  result = []
41
- html = Kernel.open(cleanpath).read
54
+ html = better_open(cleanpath).read
42
55
 
43
- html.scan(@browser.child_dirs_pattern) do |child_path_rev_array|
44
- relative_child_path = child_path_rev_array[0]
45
- child_revision_identifier = child_path_rev_array[1] # nil for most browsers
46
- #puts "DIR:#{relative_child_path}:#{child_revision_identifier}"
47
- result << pathname(relative_child_path, child_revision_identifier, true)
56
+ html.scan(@browser.child_dirs_pattern) do |child_basename_rev_array|
57
+ child_basename = child_basename_rev_array[0]
58
+ child_revision_identifier = child_basename_rev_array[1] # nil for most browsers
59
+ #puts "DIR:#{child_basename}:#{child_revision_identifier}"
60
+ result << child(child_basename, child_revision_identifier, true)
48
61
  end
49
62
 
50
- html.scan(@browser.child_files_pattern) do |child_path_rev_array|
51
- relative_child_path = child_path_rev_array[0]
52
- child_revision_identifier = child_path_rev_array[1]
53
- #puts "FILE:#{relative_child_path}:#{child_revision_identifier}"
54
- result << pathname(relative_child_path, child_revision_identifier, false)
63
+ html.scan(@browser.child_files_pattern) do |child_basename_rev_array|
64
+ child_basename = child_basename_rev_array[0]
65
+ child_revision_identifier = child_basename_rev_array[1]
66
+ #puts "FILE:#{child_basename}:#{child_revision_identifier}"
67
+ result << child(child_basename, child_revision_identifier, false)
55
68
  end
56
69
  result
57
70
  end
58
71
 
59
72
  def open(&block)
60
- url = @browser.raw(@path_from_root, revision_identifier)
61
- # open-uri's open
62
- Kernel.open(url, &block)
73
+ url = @browser.raw(path_from_root, revision_identifier)
74
+ begin
75
+ better_open(url, &block)
76
+ rescue Errno::ECONNREFUSED => e
77
+ # TODO: retry 2-3 times
78
+ e.message += "(URL:#{url})"
79
+ raise e
80
+ end
63
81
  end
64
82
 
65
83
  def directory?
66
84
  @directory
67
85
  end
86
+
68
87
  end
69
88
  end
70
89
  end
@@ -17,7 +17,7 @@ module MetaProject
17
17
  def materialize(issue)
18
18
  begin
19
19
  url = "#{@trac_base_url}/ticket/#{issue.identifier}"
20
- html = open(url).read
20
+ html = better_open(url).read
21
21
  summary = html[/Ticket ##{issue.identifier}\s*<\/h1>\s*<h2>([^<]*)<\/h2>/n, 1]
22
22
  issue.attributes[:summary] = summary
23
23
  issue.attributes[:url] = url
@@ -26,19 +26,6 @@ module MetaProject
26
26
  end
27
27
  end
28
28
 
29
- private
30
-
31
- def XXissue(issue_identifier)
32
- issue_uri = "#{@trac_base_url}/ticket/#{issue_identifier}"
33
- begin
34
- html = open(issue_uri) { |data| data.read }
35
- summary = html[/Ticket ##{issue_identifier}\s*<\/h1>\s*<h2>([^<]*)<\/h2>/n, 1]
36
- ::MetaProject::Tracker::Issue.new(issue_uri, summary)
37
- rescue OpenURI::HTTPError
38
- nil
39
- end
40
- end
41
-
42
29
  end
43
30
  end
44
31
  end
@@ -38,7 +38,7 @@ module MetaProject
38
38
  end
39
39
 
40
40
  def issue(identifier)
41
- html = open(@uri) { |data| data.read }
41
+ html = better_open(@uri).read
42
42
 
43
43
  issue_summary_regexp = @tracker.issue_summary_regexp(identifier)
44
44
  if(html =~ issue_summary_regexp)
@@ -54,7 +54,7 @@ module MetaProject
54
54
 
55
55
  # The ids of the subtrackers
56
56
  def atids
57
- html = open(overview) { |data| data.read }
57
+ html = better_open(overview).read
58
58
 
59
59
  # TODO: there has to be a better way to extract the atids from the HTML!
60
60
  atids = []
data/lib/meta_project.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'meta_project/core_ext/string'
2
2
  require 'meta_project/core_ext/pathname'
3
+ require 'meta_project/core_ext/open_uri'
3
4
  require 'meta_project/project_analyzer'
4
5
  require 'meta_project/patois'
5
6
  require 'meta_project/project'
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: meta_project
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.4.6
7
- date: 2005-09-01 00:00:00 -04:00
6
+ version: 0.4.7
7
+ date: 2005-09-06 00:00:00 -04:00
8
8
  summary: Ruby based make-like utility.
9
9
  require_paths:
10
10
  - lib
@@ -42,6 +42,7 @@ files:
42
42
  - lib/meta_project/scm_web.rb
43
43
  - lib/meta_project/tracker.rb
44
44
  - lib/meta_project/version_parser.rb
45
+ - lib/meta_project/core_ext/open_uri.rb
45
46
  - lib/meta_project/core_ext/pathname.rb
46
47
  - lib/meta_project/core_ext/string.rb
47
48
  - lib/meta_project/patois/parser.rb