libdolt 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/libdolt/git/repository.rb +2 -2
- data/lib/libdolt/repo_actions.rb +2 -2
- data/lib/libdolt/version.rb +1 -1
- data/test/libdolt/git/repository_test.rb +8 -0
- data/test/libdolt/repo_actions_test.rb +8 -8
- data/test/libdolt/templates/blame_test.rb +1 -1
- data/test/libdolt/templates/blob_test.rb +1 -1
- data/test/libdolt/templates/commits_test.rb +1 -1
- data/test/libdolt/templates/tree_history_test.rb +1 -1
- data/test/libdolt/templates/tree_test.rb +1 -1
- data/views/500.erb +1 -1
- data/views/blame.erb +5 -5
- data/views/blob.erb +6 -6
- data/views/commits.erb +4 -4
- data/views/tree.erb +3 -3
- metadata +4 -4
data/Gemfile.lock
CHANGED
@@ -59,7 +59,7 @@ module Dolt
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def blame(ref, path)
|
62
|
-
deferred_method("blame -l -t -p #{ref} #{path}") do |output, s|
|
62
|
+
deferred_method("blame -l -t -p #{ref} -- #{path}") do |output, s|
|
63
63
|
Dolt::Git::Blame.parse_porcelain(output)
|
64
64
|
end
|
65
65
|
end
|
@@ -148,7 +148,7 @@ module Dolt
|
|
148
148
|
end
|
149
149
|
|
150
150
|
def git(cmd)
|
151
|
-
"git --git-dir #{
|
151
|
+
"git --git-dir #{path} #{cmd}"
|
152
152
|
end
|
153
153
|
end
|
154
154
|
end
|
data/lib/libdolt/repo_actions.rb
CHANGED
@@ -60,7 +60,7 @@ module Dolt
|
|
60
60
|
d.callback do |refs|
|
61
61
|
names = refs.map(&:name)
|
62
62
|
block.call(nil, {
|
63
|
-
:
|
63
|
+
:repository_slug => repo,
|
64
64
|
:tags => stripped_ref_names(names, :tags),
|
65
65
|
:heads => stripped_ref_names(names, :heads)
|
66
66
|
})
|
@@ -90,7 +90,7 @@ module Dolt
|
|
90
90
|
|
91
91
|
def tpl_data(repo, ref, path, locals = {})
|
92
92
|
{
|
93
|
-
:
|
93
|
+
:repository_slug => repo,
|
94
94
|
:path => path,
|
95
95
|
:ref => ref
|
96
96
|
}.merge(locals)
|
data/lib/libdolt/version.rb
CHANGED
@@ -103,6 +103,14 @@ describe Dolt::Git::Repository do
|
|
103
103
|
end
|
104
104
|
wait!
|
105
105
|
end
|
106
|
+
|
107
|
+
it "separates tree-like and path" do
|
108
|
+
def @repository.git(cmd); @cmd = cmd; end
|
109
|
+
def @repository.cmd; @cmd; end
|
110
|
+
@repository.blame("master", "Gemfile").callback
|
111
|
+
|
112
|
+
assert_equal "blame -l -t -p master -- Gemfile", @repository.cmd
|
113
|
+
end
|
106
114
|
end
|
107
115
|
|
108
116
|
describe "#log" do
|
@@ -78,7 +78,7 @@ describe Dolt::RepoActions do
|
|
78
78
|
|
79
79
|
assert_equal({
|
80
80
|
:blob => "Blob",
|
81
|
-
:
|
81
|
+
:repository_slug => "gitorious",
|
82
82
|
:ref => "babd120",
|
83
83
|
:path => "app"
|
84
84
|
}, data)
|
@@ -103,7 +103,7 @@ describe Dolt::RepoActions do
|
|
103
103
|
|
104
104
|
expected = {
|
105
105
|
:tree => "Tree",
|
106
|
-
:
|
106
|
+
:repository_slug => "gitorious",
|
107
107
|
:ref => "babd120",
|
108
108
|
:path => "app"
|
109
109
|
}
|
@@ -120,7 +120,7 @@ describe Dolt::RepoActions do
|
|
120
120
|
|
121
121
|
expected = {
|
122
122
|
:tree => "Tree",
|
123
|
-
:
|
123
|
+
:repository_slug => "gitorious",
|
124
124
|
:ref => "babd120",
|
125
125
|
:path => "",
|
126
126
|
:type => :tree
|
@@ -137,7 +137,7 @@ describe Dolt::RepoActions do
|
|
137
137
|
|
138
138
|
expected = {
|
139
139
|
:blob => blob,
|
140
|
-
:
|
140
|
+
:repository_slug => "gitorious",
|
141
141
|
:ref => "babd120",
|
142
142
|
:path => "Gemfile",
|
143
143
|
:type => :blob
|
@@ -164,7 +164,7 @@ describe Dolt::RepoActions do
|
|
164
164
|
|
165
165
|
expected = {
|
166
166
|
:blame => "Blame",
|
167
|
-
:
|
167
|
+
:repository_slug => "gitorious",
|
168
168
|
:ref => "babd120",
|
169
169
|
:path => "app"
|
170
170
|
}
|
@@ -190,7 +190,7 @@ describe Dolt::RepoActions do
|
|
190
190
|
|
191
191
|
expected = {
|
192
192
|
:commits => "History",
|
193
|
-
:
|
193
|
+
:repository_slug => "gitorious",
|
194
194
|
:ref => "babd120",
|
195
195
|
:path => "app"
|
196
196
|
}
|
@@ -216,7 +216,7 @@ describe Dolt::RepoActions do
|
|
216
216
|
repo.resolve_promise(@refs)
|
217
217
|
|
218
218
|
expected = {
|
219
|
-
:
|
219
|
+
:repository_slug => "gitorious",
|
220
220
|
:heads => ["libgit2", "master"],
|
221
221
|
:tags => ["v0.2.1", "v0.2.0"]
|
222
222
|
}
|
@@ -263,7 +263,7 @@ describe Dolt::RepoActions do
|
|
263
263
|
repo.resolve_promise(@tree)
|
264
264
|
|
265
265
|
expected = {
|
266
|
-
:
|
266
|
+
:repository_slug => "gitorious",
|
267
267
|
:ref => "master",
|
268
268
|
:path => "",
|
269
269
|
:tree => @tree
|
@@ -83,7 +83,7 @@ describe "tree_history template" do
|
|
83
83
|
end
|
84
84
|
|
85
85
|
it "renders JSON" do
|
86
|
-
data = { "tree" => @tree, "
|
86
|
+
data = { "tree" => @tree, "repository_slug" => @repo, "ref" => "master", "path" => "" }
|
87
87
|
json = @renderer.render(:tree_history, data)
|
88
88
|
|
89
89
|
assert_equal @tree_array, JSON.parse(json)
|
data/views/500.erb
CHANGED
data/views/blame.erb
CHANGED
@@ -17,17 +17,17 @@
|
|
17
17
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
18
|
#++
|
19
19
|
%>
|
20
|
-
<% @title = "Blame #{path} in #{
|
20
|
+
<% @title = "Blame #{path} in #{repository_slug}:master" %>
|
21
21
|
|
22
22
|
<div class="gts-file gts-browser">
|
23
23
|
<div id="gts-ref-selector-ph"></div>
|
24
24
|
<ul class="pull-right gts-blob-view">
|
25
|
-
<li><a href="<%= blob_url(
|
25
|
+
<li><a href="<%= blob_url(repository_slug, ref, path) %>">Blob content</a></li>
|
26
26
|
<li class="active">Blame</li>
|
27
|
-
<li><a href="<%= history_url(
|
28
|
-
<li><a href="<%= raw_url(
|
27
|
+
<li><a href="<%= history_url(repository_slug, ref, path) %>">History</a></li>
|
28
|
+
<li><a href="<%= raw_url(repository_slug, ref, path) %>">Raw blob</a></li>
|
29
29
|
</ul>
|
30
|
-
<%= breadcrumb(
|
30
|
+
<%= breadcrumb(repository_slug, ref, path) %>
|
31
31
|
<table class="gts-code-listing">
|
32
32
|
<% annotations = blame_annotations(blame) %>
|
33
33
|
<% lines = blame_lines(path, blame) %>
|
data/views/blob.erb
CHANGED
@@ -17,15 +17,15 @@
|
|
17
17
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
18
|
#++
|
19
19
|
%>
|
20
|
-
<% @title = "#{path} in #{
|
20
|
+
<% @title = "#{path} in #{repository_slug}:master" %>
|
21
21
|
<div class="gts-file gts-browser">
|
22
22
|
<div id="gts-ref-selector-ph"></div>
|
23
23
|
<ul class="pull-right gts-blob-view">
|
24
24
|
<li class="active">Blob content</li>
|
25
|
-
<li><a href="<%= blame_url(
|
26
|
-
<li><a href="<%= history_url(
|
27
|
-
<li><a href="<%= raw_url(
|
25
|
+
<li><a href="<%= blame_url(repository_slug, ref, path) %>">Blame</a></li>
|
26
|
+
<li><a href="<%= history_url(repository_slug, ref, path) %>">History</a></li>
|
27
|
+
<li><a href="<%= raw_url(repository_slug, ref, path) %>">Raw blob</a></li>
|
28
28
|
</ul>
|
29
|
-
<%= breadcrumb(
|
30
|
-
<%= format_blob(path, blob.content,
|
29
|
+
<%= breadcrumb(repository_slug, ref, path) %>
|
30
|
+
<%= format_blob(path, blob.content, repository_slug, ref) %>
|
31
31
|
</div>
|
data/views/commits.erb
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
<div class="gts-browser">
|
3
3
|
<div id="gts-ref-selector-ph"></div>
|
4
4
|
<ul class="pull-right gts-blob-view">
|
5
|
-
<li><a href="<%= blob_url(
|
6
|
-
<li><a href="<%= blame_url(
|
5
|
+
<li><a href="<%= blob_url(repository_slug, ref, path) %>">Blob content</a></li>
|
6
|
+
<li><a href="<%= blame_url(repository_slug, ref, path) %>">Blame</a></li>
|
7
7
|
<li class="active">History</li>
|
8
|
-
<li><a href="<%= raw_url(
|
8
|
+
<li><a href="<%= raw_url(repository_slug, ref, path) %>">Raw blob</a></li>
|
9
9
|
</ul>
|
10
|
-
<%= breadcrumb(
|
10
|
+
<%= breadcrumb(repository_slug, ref, path) %>
|
11
11
|
<% commits.each do |commit| %>
|
12
12
|
<div class="gts-commit">
|
13
13
|
<p class="gts-log-message">
|
data/views/tree.erb
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
levels = accumulate_path(partition_path(path, respond_to?(:maxdepth) ? maxdepth : nil))
|
23
23
|
%>
|
24
24
|
<div id="gts-ref-selector-ph"></div>
|
25
|
-
<table class="table table-striped gts-tree-explorer" data-gts-tree-history="<%= tree_history_url(
|
25
|
+
<table class="table table-striped gts-tree-explorer" data-gts-tree-history="<%= tree_history_url(repository_slug, ref, path) %>">
|
26
26
|
<thead>
|
27
27
|
<tr>
|
28
28
|
<th colspan="<%= tree_table_padding_width(levels) + 1 %>">File</th>
|
@@ -31,12 +31,12 @@ levels = accumulate_path(partition_path(path, respond_to?(:maxdepth) ? maxdepth
|
|
31
31
|
</tr>
|
32
32
|
</thead>
|
33
33
|
<tbody>
|
34
|
-
<%= tree_context(
|
34
|
+
<%= tree_context(repository_slug, ref, levels) %>
|
35
35
|
<% tree_entries(tree).each do |object| %>
|
36
36
|
<tr>
|
37
37
|
<%= tree_table_padding_td(levels) %>
|
38
38
|
<td class="gts-name">
|
39
|
-
<a href="<%= object_url(
|
39
|
+
<a href="<%= object_url(repository_slug, ref, path, object) %>">
|
40
40
|
<i class="icon <%= object_icon_class(object) %>"></i>
|
41
41
|
<%= object[:name] %>
|
42
42
|
</a>
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libdolt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 63
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 8
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.8.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christian Johansen
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-10-
|
18
|
+
date: 2012-10-12 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|