libdolt 0.33.4 → 0.33.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  coverage
2
- test/reports
2
+ test/reports
3
+ /Gemfile.lock
@@ -50,9 +50,8 @@ module Dolt
50
50
  end
51
51
 
52
52
  def tree(ref, path)
53
- object = rev_parse("#{ref}:#{path}")
54
- raise StandardError.new("Not a tree") if !object.is_a?(Rugged::Tree)
55
- annotate_tree(ref, path, object)
53
+ tree = tree_for_ref_and_path(ref, path)
54
+ annotate_tree(ref, path, tree)
56
55
  end
57
56
 
58
57
  def tree_entry(ref, path)
@@ -69,14 +68,18 @@ module Dolt
69
68
  end
70
69
 
71
70
  def tree_history(ref, path, limit = 1)
71
+ tree = tree_for_ref_and_path(ref, path)
72
+ annotate_history(path || "./", ref, tree, limit)
73
+ end
74
+
75
+ def tree_for_ref_and_path(ref, path)
72
76
  tree = rev_parse("#{ref}:#{path}")
73
77
 
74
- if tree.class != Rugged::Tree
75
- message = "#{ref}:#{path} is not a tree (#{tree.class.to_s})"
76
- raise Exception.new(message)
78
+ unless tree.is_a?(Rugged::Tree)
79
+ raise Rugged::TreeError, "#{ref}:#{path} is not a tree (#{tree.class.to_s})"
77
80
  end
78
81
 
79
- annotate_history(path || "./", ref, tree, limit)
82
+ tree
80
83
  end
81
84
 
82
85
  def readmes(ref, path="")
@@ -17,5 +17,5 @@
17
17
  #++
18
18
 
19
19
  module Dolt
20
- VERSION = "0.33.4"
20
+ VERSION = "0.33.5"
21
21
  end
@@ -108,7 +108,7 @@ describe Dolt::Git::Repository do
108
108
  begin
109
109
  tree = @repository.tree_history("master", "README.org")
110
110
  raise "Should've raised an Exception"
111
- rescue Exception => err
111
+ rescue Rugged::TreeError => err
112
112
  assert_match /not a tree/, err.message
113
113
  end
114
114
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libdolt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.4
4
+ version: 0.33.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-24 00:00:00.000000000 Z
12
+ date: 2013-10-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rugged
@@ -197,7 +197,6 @@ files:
197
197
  - .gitignore
198
198
  - .travis.yml
199
199
  - Gemfile
200
- - Gemfile.lock
201
200
  - Rakefile
202
201
  - Readme.md
203
202
  - lib/libdolt.rb
@@ -342,7 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
342
341
  version: '0'
343
342
  requirements: []
344
343
  rubyforge_project: libdolt
345
- rubygems_version: 1.8.23
344
+ rubygems_version: 1.8.25
346
345
  signing_key:
347
346
  specification_version: 3
348
347
  summary: Dolt API for serving git trees and syntax highlighted blobs
data/Gemfile.lock DELETED
@@ -1,69 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- libdolt (0.33.2)
5
- htmlentities (~> 4.3)
6
- json (~> 1.7)
7
- makeup (~> 0.4.1)
8
- mime-types (~> 1.19)
9
- rugged (= 0.18.0.gh.de28323)
10
- tzinfo (~> 0.3)
11
-
12
- GEM
13
- remote: http://rubygems.org/
14
- specs:
15
- builder (3.2.2)
16
- charlock_holmes (0.6.9.4)
17
- ci_reporter (1.9.0)
18
- builder (>= 2.1.2)
19
- escape_utils (0.3.2)
20
- github-linguist (2.9.4)
21
- charlock_holmes (~> 0.6.6)
22
- escape_utils (~> 0.3.1)
23
- mime-types (~> 1.19)
24
- pygments.rb (~> 0.5.2)
25
- github-markup (0.7.5)
26
- htmlentities (4.3.1)
27
- json (1.8.0)
28
- makeup (0.4.1)
29
- github-linguist (~> 2.8)
30
- github-markup (~> 0.7)
31
- htmlentities (~> 4.3)
32
- pygments.rb (~> 0.4)
33
- metaclass (0.0.1)
34
- mime-types (1.25)
35
- minitest (2.12.1)
36
- mocha (0.14.0)
37
- metaclass (~> 0.0.1)
38
- multi_json (1.7.7)
39
- posix-spawn (0.3.6)
40
- pygments.rb (0.5.2)
41
- posix-spawn (~> 0.3.6)
42
- yajl-ruby (~> 1.1.0)
43
- rake (0.9.6)
44
- rcov (1.0.0)
45
- redcarpet (2.2.0)
46
- rugged (0.18.0.gh.de28323)
47
- simplecov (0.7.1)
48
- multi_json (~> 1.0)
49
- simplecov-html (~> 0.7.1)
50
- simplecov-html (0.7.1)
51
- tilt (1.4.1)
52
- tiltout (1.4.0)
53
- tilt (~> 1.3)
54
- tzinfo (0.3.37)
55
- yajl-ruby (1.1.0)
56
-
57
- PLATFORMS
58
- ruby
59
-
60
- DEPENDENCIES
61
- ci_reporter
62
- libdolt!
63
- minitest (~> 2.0)
64
- mocha
65
- rake (~> 0.9)
66
- rcov
67
- redcarpet (~> 2.2)
68
- simplecov
69
- tiltout (~> 1.4)