first_github_commit 0.1.2 → 0.1.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{first_github_commit}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Christoph Olszowka"]
@@ -6,6 +6,7 @@ require 'yaml'
6
6
 
7
7
  class FirstGithubCommit
8
8
  class TooManyRequests < StandardError; end;
9
+ class RepoNotFound < StandardError; end;
9
10
 
10
11
  attr_reader :user, :repo, :requests_made, :page
11
12
 
@@ -16,6 +17,10 @@ class FirstGithubCommit
16
17
  @user, @repo = user, repo
17
18
  @requests_made = 0
18
19
  @range = (1..130)
20
+
21
+ # Make sure the repo even exists!
22
+ raise RepoNotFound if RedirectFollower.new(url_for_page(1)).response.kind_of?(Net::HTTPNotFound)
23
+
19
24
  find_upper_limit
20
25
  find_page_number
21
26
  end
@@ -31,4 +31,11 @@ class TestFirstGithubCommit < Test::Unit::TestCase
31
31
  end
32
32
  end
33
33
 
34
+ context "finding a non-existing repo" do
35
+ should "raise FirstGithubCommit::RepoNotFound" do
36
+ assert_raise FirstGithubCommit::RepoNotFound do
37
+ FirstGithubCommit.find('colszowka', 'missing')
38
+ end
39
+ end
40
+ end
34
41
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Christoph Olszowka