libdolt 0.27.0 → 0.28.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -2
- data/Readme.md +14 -10
- data/lib/libdolt/controller_actions.rb +15 -3
- data/lib/libdolt/version.rb +1 -1
- data/lib/libdolt/view/blame.rb +1 -1
- data/test/libdolt/view/blame_test.rb +6 -0
- data/views/non_existent.erb +25 -0
- metadata +3 -2
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
libdolt (0.
|
4
|
+
libdolt (0.28.0)
|
5
5
|
htmlentities (~> 4.3)
|
6
6
|
json (~> 1.7)
|
7
7
|
makeup (~> 0.4)
|
@@ -17,7 +17,7 @@ GEM
|
|
17
17
|
ci_reporter (1.9.0)
|
18
18
|
builder (>= 2.1.2)
|
19
19
|
escape_utils (0.3.2)
|
20
|
-
github-linguist (2.8.
|
20
|
+
github-linguist (2.8.6)
|
21
21
|
charlock_holmes (~> 0.6.6)
|
22
22
|
escape_utils (~> 0.3.1)
|
23
23
|
mime-types (~> 1.19)
|
data/Readme.md
CHANGED
@@ -20,21 +20,25 @@ libdolt depends on two system packages to do its job.
|
|
20
20
|
|
21
21
|
### Systems using apt (Debian/Ubuntu, others)
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
```sh
|
24
|
+
# 1) Install Python development files
|
25
|
+
sudo apt-get install -y python-dev libicu-dev
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
27
|
+
# 2) Install dolt. This may or may not require the use of sudo, depending on
|
28
|
+
# how you installed Ruby.
|
29
|
+
gem install libdolt
|
30
|
+
```
|
29
31
|
|
30
32
|
### Systems using yum (Fedora/CentOS/RedHat, others)
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
+
```sh
|
35
|
+
# 1) Install Python development files
|
36
|
+
sudo yum install -y python-devel libicu-devel
|
34
37
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
+
# 2) Install dolt. This may or may not require the use of sudo, depending on
|
39
|
+
# how you installed Ruby.
|
40
|
+
gem install dolt
|
41
|
+
```
|
38
42
|
|
39
43
|
## API
|
40
44
|
|
@@ -33,17 +33,29 @@ module Dolt
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def render_error(error, repo, ref, data = {})
|
36
|
-
$stderr.puts(error.message)
|
36
|
+
$stderr.puts("#{error.class.to_s}: #{error.message}")
|
37
37
|
$stderr.puts(error.backtrace)
|
38
38
|
|
39
39
|
if error.class.to_s == "Rugged::ReferenceError" && ref == "HEAD"
|
40
|
-
|
40
|
+
template = "empty"
|
41
|
+
return [200, headers, [renderer.render(template, {
|
41
42
|
:repository => repo,
|
42
43
|
:ref => ref
|
43
44
|
}.merge(data))]]
|
44
45
|
end
|
45
46
|
|
46
|
-
|
47
|
+
if error.class.to_s == "Rugged::ReferenceError"
|
48
|
+
template = "non_existent"
|
49
|
+
return [404, headers, [renderer.render(template, {
|
50
|
+
:repository => repo,
|
51
|
+
:ref => ref,
|
52
|
+
:error => error
|
53
|
+
}.merge(data))]]
|
54
|
+
end
|
55
|
+
|
56
|
+
response = error.class.to_s == "Rugged::IndexerError" ? 404 : 500
|
57
|
+
template = response.to_s.to_sym
|
58
|
+
[response, headers, [renderer.render(template, {
|
47
59
|
:error => error,
|
48
60
|
:repository_slug => repo,
|
49
61
|
:ref => ref
|
data/lib/libdolt/version.rb
CHANGED
data/lib/libdolt/view/blame.rb
CHANGED
@@ -42,7 +42,7 @@ module Dolt
|
|
42
42
|
|
43
43
|
<<-HTML
|
44
44
|
<td class="#{class_name}">
|
45
|
-
<span class="gts-commit-oid" data-gts-commit-oid="#{annotation[:oid]}">#{annotation[:oid][0..6]}</span>
|
45
|
+
<span class="gts-commit-oid" data-gts-commit-oid="#{annotation[:oid]}" title="#{annotation[:summary]}">#{annotation[:oid][0..6]}</span>
|
46
46
|
#{annotation[:committer][:time].strftime("%Y-%m-%d")}
|
47
47
|
#{annotation[:committer][:name]}
|
48
48
|
</td>
|
@@ -107,6 +107,12 @@ describe Dolt::View::Blame do
|
|
107
107
|
|
108
108
|
assert_match /2012-01-01/, html
|
109
109
|
end
|
110
|
+
|
111
|
+
it "includes the commit summary" do
|
112
|
+
html = blame_annotation_cell({ :committer => @committer, :oid => @oid, :summary => "Doing it" })
|
113
|
+
|
114
|
+
assert_match "Doing it", html
|
115
|
+
end
|
110
116
|
end
|
111
117
|
|
112
118
|
describe "#blame_code_cell" do
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%#
|
2
|
+
# encoding: utf-8
|
3
|
+
#--
|
4
|
+
# Copyright (C) 2013 Gitorious AS
|
5
|
+
#
|
6
|
+
# This program is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU Affero General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU Affero General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
17
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
%>
|
20
|
+
<div class="container gts-body">
|
21
|
+
<h1><%= @title = "No such ref '#{ref}'" %></h1>
|
22
|
+
<p>
|
23
|
+
<%= error.message %>
|
24
|
+
</p>
|
25
|
+
</div>
|
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.
|
4
|
+
version: 0.28.0
|
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-07-
|
12
|
+
date: 2013-07-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rugged
|
@@ -287,6 +287,7 @@ files:
|
|
287
287
|
- views/empty.erb
|
288
288
|
- views/index.erb
|
289
289
|
- views/layout.erb
|
290
|
+
- views/non_existent.erb
|
290
291
|
- views/raw.erb
|
291
292
|
- views/refs.erb
|
292
293
|
- views/tree.erb
|