dolt 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dolt (0.6.2)
5
- async_sinatra (~> 1)
6
- json (~> 1)
7
- libdolt (~> 0)
8
- sinatra (~> 1)
4
+ dolt (0.7.1)
5
+ async_sinatra (~> 1.0)
6
+ json (~> 1.5)
7
+ libdolt (~> 0.8)
8
+ sinatra (~> 1.0)
9
9
  thin (~> 1.4)
10
- tiltout (~> 1)
10
+ tiltout (~> 1.1)
11
11
 
12
12
  GEM
13
13
  remote: http://rubygems.org/
@@ -20,30 +20,31 @@ GEM
20
20
  eventmachine
21
21
  em_pessimistic (0.1.2)
22
22
  eventmachine (~> 1.0)
23
- em_rugged (0.1.3)
23
+ em_rugged (0.3.0)
24
24
  eventmachine (~> 1.0)
25
25
  rugged (= 0.17.0.b6)
26
26
  eventmachine (1.0.0)
27
27
  github-markup (0.7.4)
28
28
  htmlentities (4.3.1)
29
29
  json (1.7.5)
30
- libdolt (0.6.0)
30
+ libdolt (0.10.0)
31
31
  em_pessimistic (~> 0.1)
32
- em_rugged (~> 0.1.2)
32
+ em_rugged (~> 0.3)
33
33
  eventmachine (~> 1.0)
34
34
  htmlentities (~> 4.3)
35
35
  json (~> 1.7)
36
- makeup (~> 0)
36
+ makeup (~> 0.2)
37
37
  mime-types (~> 1.19)
38
38
  tzinfo (~> 0.3)
39
- makeup (0.1.1)
39
+ when (~> 0)
40
+ makeup (0.2.0)
40
41
  github-markup (~> 0.7)
41
42
  htmlentities (~> 4.3)
42
43
  pygments.rb (~> 0.2)
43
44
  metaclass (0.0.1)
44
45
  mime-types (1.19)
45
46
  minitest (2.12.1)
46
- mocha (0.12.6)
47
+ mocha (0.12.7)
47
48
  metaclass (~> 0.0.1)
48
49
  posix-spawn (0.3.6)
49
50
  pygments.rb (0.3.1)
@@ -63,9 +64,10 @@ GEM
63
64
  eventmachine (>= 0.12.6)
64
65
  rack (>= 1.0.0)
65
66
  tilt (1.3.3)
66
- tiltout (1.0.0)
67
+ tiltout (1.2.0)
67
68
  tilt (~> 1.3)
68
69
  tzinfo (0.3.33)
70
+ when (0.1.0)
69
71
  yajl-ruby (1.1.0)
70
72
 
71
73
  PLATFORMS
@@ -11,7 +11,7 @@ end
11
11
 
12
12
  Gem::Specification.new do |s|
13
13
  s.name = "dolt"
14
- s.version = "0.7.0"
14
+ s.version = "0.7.1"
15
15
  s.authors = ["Christian Johansen"]
16
16
  s.email = ["christian@gitorious.org"]
17
17
  s.homepage = "http://gitorious.org/gitorious/dolt"
@@ -13,3 +13,6 @@
13
13
  [submodule "lib/spin.js"]
14
14
  path = lib/spin.js
15
15
  url = https://github.com/fgnass/spin.js.git
16
+ [submodule "lib/showdown"]
17
+ path = lib/showdown
18
+ url = https://github.com/coreyti/showdown.git
@@ -332,7 +332,7 @@ input[type=url].gts-current-repo-url {
332
332
  border-color: #222;
333
333
  }
334
334
 
335
- .gts-com-plug {
335
+ .gts-footer-blurb {
336
336
  border-top: 1px solid #f5f5f5;
337
337
  margin-top: 12px;
338
338
  padding-top: 12px;
@@ -533,8 +533,9 @@ input[type=url].gts-current-repo-url {
533
533
  width: auto;
534
534
  }
535
535
 
536
- .gts-mr-status,
537
- .gts-mr-age {
536
+ .gts-item-author,
537
+ .gts-item-status,
538
+ .gts-item-age {
538
539
  white-space: nowrap;
539
540
  }
540
541
 
@@ -8,26 +8,37 @@ this.gts.refSelector = (function () {
8
8
  return (template || "#{ref}").replace(/#\{ref\}/g, ref);
9
9
  }
10
10
 
11
- function isType(type, refName, refs) {
12
- return cull.some(function (ref) {
13
- return ref === refName;
14
- }, refs[type] || []);
11
+ function getCurrent(type, refName, refs) {
12
+ return cull.select(function (ref) {
13
+ return ref[0] === refName || ref[1] === refName;
14
+ }, refs[type] || [])[0];
15
15
  }
16
16
 
17
17
  function currentRefLink(refs, current) {
18
- var type = isType("heads", current, refs) ? "branch" :
19
- (isType("tags", current, refs) ? "tag" : "ref");
18
+ var currentRef = getCurrent("heads", current, refs);
19
+ var type = "branch";
20
+
21
+ if (!currentRef) {
22
+ currentRef = getCurrent("tags", current, refs);
23
+ type = "tag";
24
+ }
25
+
26
+ if (!currentRef) {
27
+ type = "ref";
28
+ }
29
+
20
30
  return e.a({
21
31
  href: "#",
22
32
  className: "dropdown-toggle",
23
33
  innerHTML: "<span class=\"caret\"></span> <em>" +
24
- type + ":</em> " + current
34
+ type + ":</em> " + (currentRef && currentRef[0] || current)
25
35
  });
26
36
  }
27
37
 
28
38
  function refInput(url) {
29
39
  var input = e.input({ type: "text", className: "gts-ref-input" });
30
40
  var form = e.form({
41
+ className: "gts-ref-input",
31
42
  events: {
32
43
  submit: function (e) {
33
44
  e.preventDefault();
@@ -43,10 +54,11 @@ this.gts.refSelector = (function () {
43
54
  }
44
55
 
45
56
  function refItems(label, refs, urlTemplate) {
57
+ var initial = [e.li({ className: "dropdown-label" }, [e.strong(label)])];
46
58
  return cull.reduce(function (elements, ref) {
47
- elements.push(e.li(e.a({ href: tpl(urlTemplate, ref) }, ref)));
59
+ elements.push(e.li(e.a({ href: tpl(urlTemplate, ref[1]) }, ref[0])));
48
60
  return elements;
49
- }, [e.li({ className: "dropdown-label" }, [e.strong(label)])], refs);
61
+ }, initial, refs.sort());
50
62
  }
51
63
 
52
64
  function refsList(refs, urlTemplate) {
@@ -20,7 +20,7 @@ this.gts.url = (function () {
20
20
  }
21
21
 
22
22
  function currentRef(url) {
23
- var refPath = url.split(/(blame|blob|tree|history|raw)\//)[2];
23
+ var refPath = url.split(/(blame|blob|tree|history|raw|source|readme)\//)[2];
24
24
  return refPath && refPath.split(":")[0] || null;
25
25
  }
26
26
 
@@ -2,14 +2,14 @@
2
2
  // this.select();
3
3
  // });
4
4
 
5
- // $(".gts-repo-url").click(function (e) {
6
- // e.preventDefault();
7
- // var btn = $(this);
8
- // var parent = btn.parent();
9
- // parent.find(".gts-repo-url").removeClass("active");
10
- // btn.addClass("active");
11
- // parent.find(".gts-current-repo-url").val(btn.attr("href")).focus();
12
- // });
5
+ $(".gts-repo-url").click(function (e) {
6
+ e.preventDefault();
7
+ var btn = $(this);
8
+ var parent = btn.parent();
9
+ parent.find(".gts-repo-url").removeClass("active");
10
+ btn.addClass("active");
11
+ parent.find(".gts-current-repo-url").val(btn.attr("href")).focus();
12
+ });
13
13
 
14
14
  // $(".linenums li").mouseenter(function () {
15
15
  // $(this).addClass("focus");
@@ -31,47 +31,47 @@
31
31
  // }
32
32
  // }());
33
33
 
34
- // jQuery("[rel=tooltip]").tooltip();
34
+ jQuery("[rel=tooltip]").tooltip();
35
35
 
36
- // jQuery("[data-preview-target]").each(function () {
37
- // var textarea = this;
38
- // var target = document.getElementById(this.getAttribute("data-preview-target"));
39
- // if (!target || !Showdown) { return; }
40
- // var converter = new Showdown.converter();
41
- // var previous, content;
36
+ jQuery("[data-preview-target]").each(function () {
37
+ var textarea = this;
38
+ var target = document.getElementById(this.getAttribute("data-preview-target"));
39
+ if (!target || !Showdown) { return; }
40
+ var converter = new Showdown.converter();
41
+ var previous, content;
42
42
 
43
- // var cageSeed = new Date().getTime();
43
+ var cageSeed = new Date().getTime();
44
44
 
45
- // function zeroPad(num) {
46
- // return num < 10 ? "0" + num : num;
47
- // }
45
+ function zeroPad(num) {
46
+ return num < 10 ? "0" + num : num;
47
+ }
48
48
 
49
- // function signature() {
50
- // var now = new Date();
51
- // return "<p>" +
52
- // "<img width=\"24\" height=\"24\" class=\"gts-avatar\" alt=\"avatar\" src=\"http://cageme.herokuapp.com/24/24?" +
53
- // cageSeed + "\">" +
54
- // "<a href=\"/~zmalltalker\">Marius Mathiesen</a>" +
55
- // zeroPad(now.getHours()) + ":" + zeroPad(now.getMinutes()) +
56
- // ". <a href=\"#\">Edit comment</a></p>";
57
- // }
49
+ function signature() {
50
+ var now = new Date();
51
+ return "<p>" +
52
+ "<img width=\"24\" height=\"24\" class=\"gts-avatar\" alt=\"avatar\" src=\"http://cageme.herokuapp.com/24/24?" +
53
+ cageSeed + "\">" +
54
+ "<a href=\"/~zmalltalker\">Marius Mathiesen</a>" +
55
+ zeroPad(now.getHours()) + ":" + zeroPad(now.getMinutes()) +
56
+ ". <a href=\"#\">Edit comment</a></p>";
57
+ }
58
58
 
59
- // function setPreview(preview) {
60
- // target.style.display = preview ? "block" : "none";
61
- // target.getElementsByTagName("div")[0].innerHTML = preview;
62
- // }
59
+ function setPreview(preview) {
60
+ target.style.display = preview ? "block" : "none";
61
+ target.getElementsByTagName("div")[0].innerHTML = preview;
62
+ }
63
63
 
64
- // function updatePreview() {
65
- // content = textarea.value;
66
- // if (content !== previous) {
67
- // previous = content;
68
- // setPreview(converter.makeHtml(content));
69
- // }
70
- // setTimeout(updatePreview, 20);
71
- // }
64
+ function updatePreview() {
65
+ content = textarea.value;
66
+ if (content !== previous) {
67
+ previous = content;
68
+ setPreview(converter.makeHtml(content));
69
+ }
70
+ setTimeout(updatePreview, 20);
71
+ }
72
72
 
73
- // updatePreview();
74
- // });
73
+ updatePreview();
74
+ });
75
75
 
76
76
  // Lest ye forget
77
77
  /*
@@ -123,7 +123,7 @@ gts.run = function (env) {
123
123
  var ref = gts.url.currentRef(window.location.href);
124
124
 
125
125
  gts.run({
126
- repository: "",
126
+ repository: gts.repository || "",
127
127
  ref: ref,
128
128
  refUrlTemplate: gts.url.templatize(window.location.href, { ref: ref })
129
129
  });
@@ -7,8 +7,23 @@ buster.testCase("Ref selector", {
7
7
  assert.className(element, "gts-branch-selector");
8
8
  },
9
9
 
10
- "includes link to current branch": function () {
11
- var element = gts.refSelector({ heads: ["master"] }, "master");
10
+ "includes link to current branch by ref": function () {
11
+ var element = gts.refSelector({
12
+ heads: [["master", "0123456"]]
13
+ }, "0123456");
14
+ var a = element.firstChild;
15
+
16
+ assert.tagName(a, "a");
17
+ assert.className(a, "dropdown-toggle");
18
+ assert.match(a.innerHTML, "caret");
19
+ assert.match(a.innerHTML, "branch:");
20
+ assert.match(a.innerHTML, "master");
21
+ },
22
+
23
+ "includes link to current branch by name": function () {
24
+ var element = gts.refSelector({
25
+ heads: [["master", "0123456"]]
26
+ }, "master");
12
27
  var a = element.firstChild;
13
28
 
14
29
  assert.tagName(a, "a");
@@ -19,13 +34,17 @@ buster.testCase("Ref selector", {
19
34
  },
20
35
 
21
36
  "includes link to current tag": function () {
22
- var element = gts.refSelector({ tags: ["v2.1.0"] }, "v2.1.0");
37
+ var element = gts.refSelector({
38
+ tags: [["v2.1.0", "1234567"]]
39
+ }, "1234567");
23
40
 
24
41
  assert.match(element.firstChild.innerHTML, "tag:");
25
42
  },
26
43
 
27
44
  "includes link to current ref": function () {
28
- var element = gts.refSelector({ tags: ["v2.1.0"] }, "aabbcc4");
45
+ var element = gts.refSelector({
46
+ tags: [["v2.1.0", "1234567"]]
47
+ }, "aabbcc4");
29
48
 
30
49
  assert.match(element.firstChild.innerHTML, "ref:");
31
50
  },
@@ -46,9 +65,9 @@ buster.testCase("Ref selector", {
46
65
 
47
66
  "links all heads": function () {
48
67
  var element = gts.refSelector({
49
- heads: ["libgit2", "master"],
50
- tags: ["v2.1.0", "v2.1.1"]
51
- }, "master");
68
+ heads: [["libgit2", "1234567"], ["master", "2345678"]],
69
+ tags: [["v2.1.0", "34565789"], ["v2.1.1", "45657890"]]
70
+ }, "2345678");
52
71
 
53
72
  var list = element.childNodes[1];
54
73
  assert.className(list.childNodes[1], "dropdown-label");
@@ -60,8 +79,8 @@ buster.testCase("Ref selector", {
60
79
  "links all tags": function () {
61
80
  var element = gts.refSelector({
62
81
  heads: ["libgit2", "master"],
63
- tags: ["v2.1.0", "v2.1.1"]
64
- }, "master");
82
+ tags: [["v2.1.0", "1234567"], ["v2.1.1", "2345678"]]
83
+ }, "2345678");
65
84
 
66
85
  var list = element.childNodes[1];
67
86
  assert.className(list.childNodes[4], "dropdown-label");
@@ -70,11 +89,32 @@ buster.testCase("Ref selector", {
70
89
  assert.match(list.childNodes[6].innerHTML, "v2.1.1");
71
90
  },
72
91
 
92
+ "sorts refs alpha-numerically": function () {
93
+ var element = gts.refSelector({
94
+ "heads": [["feature-B", "1234567"],
95
+ ["master", "2345678"],
96
+ ["feature-A", "3456789"]],
97
+ "tags": [["0.7.0", "4567890"],
98
+ ["0.7.1", "5678901"],
99
+ ["1.3.1", "6789012"],
100
+ ["1.0.0", "7890123"]]
101
+ });
102
+
103
+ var list = element.childNodes[1];
104
+ assert.match(list.childNodes[2].innerHTML, "feature-A");
105
+ assert.match(list.childNodes[3].innerHTML, "feature-B");
106
+ assert.match(list.childNodes[4].innerHTML, "master");
107
+ assert.match(list.childNodes[6].innerHTML, "0.7.0");
108
+ assert.match(list.childNodes[7].innerHTML, "0.7.1");
109
+ assert.match(list.childNodes[8].innerHTML, "1.0.0");
110
+ assert.match(list.childNodes[9].innerHTML, "1.3.1");
111
+ },
112
+
73
113
  "does not propagate clicks on input": function () {
74
114
  var element = gts.refSelector({
75
- heads: ["libgit2", "master"],
76
- tags: ["v2.1.0", "v2.1.1"]
77
- }, "master");
115
+ heads: [["libgit2", "1234567"], ["master", "2345678"]],
116
+ tags: [["v2.1.0", "34565789"], ["v2.1.1", "45657890"]]
117
+ }, "2345678");
78
118
 
79
119
  var event = jQuery.Event("click");
80
120
  event.stopPropagation = this.spy();
@@ -85,11 +125,12 @@ buster.testCase("Ref selector", {
85
125
 
86
126
  "uses URL template to generate links": function () {
87
127
  var element = gts.refSelector({
88
- heads: ["libgit2", "master"],
89
- tags: ["v2.1.0", "v2.1.1"]
90
- }, "master", "/dolt/#{ref}:");
128
+ heads: [["libgit2", "1234567"], ["master", "2345678"]],
129
+ tags: [["v2.1.0", "34565789"], ["v2.1.1", "45657890"]]
130
+ }, "2345678", "/dolt/#{ref}:");
91
131
 
92
132
  var list = element.childNodes[1];
93
- assert.match(list.childNodes[2].firstChild.href, "/dolt/libgit2:");
133
+ assert.match(list.childNodes[2].firstChild.href, "/dolt/1234567:");
134
+ assert.equals(list.childNodes[2].firstChild.innerHTML, "libgit2");
94
135
  }
95
136
  });
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dolt
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 0
10
- version: 0.7.0
9
+ - 1
10
+ version: 0.7.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Christian Johansen
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-10-12 00:00:00 +02:00
19
- default_executable:
18
+ date: 2012-10-19 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: libdolt
@@ -218,7 +217,6 @@ files:
218
217
  - vendor/ui/test/tree-history-test.js
219
218
  - vendor/ui/test/url-template-test.js
220
219
  - bin/dolt
221
- has_rdoc: true
222
220
  homepage: http://gitorious.org/gitorious/dolt
223
221
  licenses: []
224
222
 
@@ -248,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
246
  requirements: []
249
247
 
250
248
  rubyforge_project: dolt
251
- rubygems_version: 1.4.2
249
+ rubygems_version: 1.8.24
252
250
  signing_key:
253
251
  specification_version: 3
254
252
  summary: Dolt serves git trees and syntax highlighted blobs