libdolt 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- libdolt (0.6.2)
4
+ libdolt (0.8.0)
5
5
  em_pessimistic (~> 0.1)
6
6
  em_rugged (~> 0.1.2)
7
7
  eventmachine (~> 1.0)
@@ -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 #{subject.path} #{cmd}"
151
+ "git --git-dir #{path} #{cmd}"
152
152
  end
153
153
  end
154
154
  end
@@ -60,7 +60,7 @@ module Dolt
60
60
  d.callback do |refs|
61
61
  names = refs.map(&:name)
62
62
  block.call(nil, {
63
- :repository => repo,
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
- :repository => repo,
93
+ :repository_slug => repo,
94
94
  :path => path,
95
95
  :ref => ref
96
96
  }.merge(locals)
@@ -17,5 +17,5 @@
17
17
  #++
18
18
 
19
19
  module Dolt
20
- VERSION = "0.7.0"
20
+ VERSION = "0.8.0"
21
21
  end
@@ -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
- :repository => "gitorious",
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
- :repository => "gitorious",
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
- :repository => "gitorious",
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
- :repository => "gitorious",
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
- :repository => "gitorious",
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
- :repository => "gitorious",
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
- :repository => "gitorious",
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
- :repository => "gitorious",
266
+ :repository_slug => "gitorious",
267
267
  :ref => "master",
268
268
  :path => "",
269
269
  :tree => @tree
@@ -39,7 +39,7 @@ describe "blame template" do
39
39
  renderer = prepare_renderer(options)
40
40
  renderer.render(:blame, {
41
41
  :blame => blame,
42
- :repository => @repo,
42
+ :repository_slug => @repo,
43
43
  :ref => options[:ref] || "master",
44
44
  :path => path
45
45
  })
@@ -34,7 +34,7 @@ describe "blob template" do
34
34
  renderer = prepare_renderer(options, helpers)
35
35
  renderer.render(:blob, {
36
36
  :blob => blob,
37
- :repository => @repo,
37
+ :repository_slug => @repo,
38
38
  :ref => options[:ref] || "master",
39
39
  :path => path
40
40
  })
@@ -43,7 +43,7 @@ describe "commits template" do
43
43
  renderer = prepare_renderer(options)
44
44
  renderer.render(:commits, {
45
45
  :commits => commits,
46
- :repository => @repo,
46
+ :repository_slug => @repo,
47
47
  :ref => options[:ref] || "master",
48
48
  :path => path
49
49
  })
@@ -83,7 +83,7 @@ describe "tree_history template" do
83
83
  end
84
84
 
85
85
  it "renders JSON" do
86
- data = { "tree" => @tree, "repository" => @repo, "ref" => "master", "path" => "" }
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)
@@ -34,7 +34,7 @@ describe "tree template" do
34
34
  renderer = prepare_renderer(options)
35
35
  renderer.render(:tree, {
36
36
  :tree => tree,
37
- :repository => @repo,
37
+ :repository_slug => @repo,
38
38
  :ref => options[:ref] || "master",
39
39
  :path => path
40
40
  })
@@ -19,4 +19,4 @@
19
19
  %>
20
20
  <h1><%= @title = "An error occurred" %></h1>
21
21
  <h2><%= error.respond_to?(:message) ? error.message : error %></h2>
22
- <p><a href="<%= tree_url(repository, ref, "") %>">Go back</a></p>
22
+ <p><a href="<%= tree_url(repository_slug, ref, "") %>">Go back</a></p>
@@ -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 #{repository}:master" %>
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(repository, ref, path) %>">Blob content</a></li>
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(repository, ref, path) %>">History</a></li>
28
- <li><a href="<%= raw_url(repository, ref, path) %>">Raw blob</a></li>
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(repository, ref, path) %>
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) %>
@@ -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 #{repository}:master" %>
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(repository, ref, path) %>">Blame</a></li>
26
- <li><a href="<%= history_url(repository, ref, path) %>">History</a></li>
27
- <li><a href="<%= raw_url(repository, ref, path) %>">Raw blob</a></li>
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(repository, ref, path) %>
30
- <%= format_blob(path, blob.content, repository, ref) %>
29
+ <%= breadcrumb(repository_slug, ref, path) %>
30
+ <%= format_blob(path, blob.content, repository_slug, ref) %>
31
31
  </div>
@@ -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(repository, ref, path) %>">Blob content</a></li>
6
- <li><a href="<%= blame_url(repository, ref, path) %>">Blame</a></li>
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(repository, ref, path) %>">Raw blob</a></li>
8
+ <li><a href="<%= raw_url(repository_slug, ref, path) %>">Raw blob</a></li>
9
9
  </ul>
10
- <%= breadcrumb(repository, ref, path) %>
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">
@@ -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(repository, ref, path) %>">
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(repository, ref, levels) %>
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(repository, ref, path, object) %>">
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: 3
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 7
8
+ - 8
9
9
  - 0
10
- version: 0.7.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-10 00:00:00 +02:00
18
+ date: 2012-10-12 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency