blastr 0.0.14 → 0.0.15

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,4 +1,8 @@
1
- == 0.0.13 2009-02-20
1
+ == 0.0.15 2009-02-21
2
+
3
+ * Added support for local Mercurial repositories.
4
+
5
+ == 0.0.14 2009-02-20
2
6
 
3
7
  * Added support for multi-line comments in Mercurial.
4
8
 
data/lib/blastr.rb CHANGED
@@ -6,7 +6,7 @@ module Blastr
6
6
  require 'tts/tts.rb'
7
7
  require 'people/people.rb'
8
8
 
9
- VERSION = '0.0.14'
9
+ VERSION = '0.0.15'
10
10
  COPYRIGHT = 'Copyright (c) 2009, Lasse Koskela. All Rights Reserved.'
11
11
  puts "Blastr #{VERSION}\n#{COPYRIGHT}\n"
12
12
 
data/lib/scm/hg.rb CHANGED
@@ -29,7 +29,7 @@ module Blastr::SourceControl
29
29
  def name; "Mercurial"; end
30
30
 
31
31
  def self.understands_url?(url)
32
- url.index("hg:http") == 0
32
+ url.index("hg:") == 0
33
33
  end
34
34
 
35
35
  def initialize(repo_url)
@@ -1,34 +1,31 @@
1
1
  require File.dirname(__FILE__) + '/test_helper.rb'
2
2
 
3
3
  class TestScmURLMatching < Test::Unit::TestCase
4
- GIT_URL = "git://foo.com/bar.git"
5
- MERCURIAL_URL = "hg:http://foo.com/svn"
6
- SVN_HTTP_URL = "http://foo.com/svn"
7
- SVN_HTTPS_URL = "https://foo.com/svn"
8
- SVN_NATIVE_URL = "svn://foo.com/svn"
9
- SVN_URLS = [ SVN_HTTP_URL, SVN_HTTPS_URL, SVN_NATIVE_URL ]
10
- ALL_URLS = [ SVN_URLS, GIT_URL, MERCURIAL_URL ].flatten
4
+
5
+ GIT_URLS = [ "git://foo.com/bar.git" ]
6
+ MERCURIAL_URLS = [ "hg:http://foo.com/hg", "hg:/tmp/hg/repo" ]
7
+ SVN_URLS = [ "http://foo.com/svn", "https://foo.com/svn", "svn://foo.com/svn" ]
8
+ ALL_URLS = [ SVN_URLS, GIT_URLS, MERCURIAL_URLS ].flatten
11
9
 
12
10
  def test_subversion
13
- SVN_URLS.each do |url|
14
- assert Blastr::SourceControl::Subversion.understands_url?(url), "#{url} should be a Subversion URL!"
15
- end
16
- ALL_URLS.reject {|url| SVN_URLS.include?(url) }.each do |url|
17
- assert Blastr::SourceControl::Subversion.understands_url?(url) == false, "#{url} should not be a Subversion URL!"
18
- end
11
+ assert_urls_are_understood_by(Blastr::SourceControl::Subversion, SVN_URLS)
19
12
  end
20
13
 
21
14
  def test_git
22
- assert Blastr::SourceControl::Git.understands_url?(GIT_URL)
23
- ALL_URLS.reject {|url| url == GIT_URL }.each do |url|
24
- assert Blastr::SourceControl::Git.understands_url?(url) == false, "#{url} should not be a Git URL!"
25
- end
15
+ assert_urls_are_understood_by(Blastr::SourceControl::Git, GIT_URLS)
26
16
  end
27
17
 
28
18
  def test_mercurial
29
- assert Blastr::SourceControl::Mercurial.understands_url?(MERCURIAL_URL)
30
- ALL_URLS.reject {|url| url == MERCURIAL_URL }.each do |url|
31
- assert Blastr::SourceControl::Mercurial.understands_url?(url) == false, "#{url} should not be a Mercurial URL!"
19
+ assert_urls_are_understood_by(Blastr::SourceControl::Mercurial, MERCURIAL_URLS)
20
+ end
21
+
22
+ private
23
+ def assert_urls_are_understood_by(scm, list_of_urls)
24
+ list_of_urls.each do |url|
25
+ assert scm.understands_url?(url), "#{url} should be understood by #{scm}!"
26
+ end
27
+ ALL_URLS.reject {|url| list_of_urls.include?(url) }.each do |url|
28
+ assert scm.understands_url?(url) == false, "#{url} should not be understood by #{scm}!"
32
29
  end
33
30
  end
34
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blastr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lasse Koskela