dolt 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +6 -6
- data/dolt.gemspec +2 -2
- data/lib/dolt/sinatra/actions.rb +12 -0
- data/test/dolt/sinatra/actions_test.rb +23 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dolt (0.
|
4
|
+
dolt (0.8.0)
|
5
5
|
async_sinatra (~> 1.0)
|
6
6
|
json (~> 1.5)
|
7
|
-
libdolt (~> 0.
|
7
|
+
libdolt (~> 0.11)
|
8
8
|
sinatra (~> 1.0)
|
9
9
|
thin (~> 1.4)
|
10
|
-
tiltout (~> 1.
|
10
|
+
tiltout (~> 1.4)
|
11
11
|
|
12
12
|
GEM
|
13
13
|
remote: http://rubygems.org/
|
@@ -27,7 +27,7 @@ GEM
|
|
27
27
|
github-markup (0.7.4)
|
28
28
|
htmlentities (4.3.1)
|
29
29
|
json (1.7.5)
|
30
|
-
libdolt (0.
|
30
|
+
libdolt (0.11)
|
31
31
|
em_pessimistic (~> 0.1)
|
32
32
|
em_rugged (~> 0.3)
|
33
33
|
eventmachine (~> 1.0)
|
@@ -37,7 +37,7 @@ GEM
|
|
37
37
|
mime-types (~> 1.19)
|
38
38
|
tzinfo (~> 0.3)
|
39
39
|
when (~> 0)
|
40
|
-
makeup (0.
|
40
|
+
makeup (0.3.0)
|
41
41
|
github-markup (~> 0.7)
|
42
42
|
htmlentities (~> 4.3)
|
43
43
|
pygments.rb (~> 0.2)
|
@@ -64,7 +64,7 @@ GEM
|
|
64
64
|
eventmachine (>= 0.12.6)
|
65
65
|
rack (>= 1.0.0)
|
66
66
|
tilt (1.3.3)
|
67
|
-
tiltout (1.
|
67
|
+
tiltout (1.4.0)
|
68
68
|
tilt (~> 1.3)
|
69
69
|
tzinfo (0.3.35)
|
70
70
|
when (0.1.0)
|
data/dolt.gemspec
CHANGED
@@ -11,7 +11,7 @@ end
|
|
11
11
|
|
12
12
|
Gem::Specification.new do |s|
|
13
13
|
s.name = "dolt"
|
14
|
-
s.version = "0.
|
14
|
+
s.version = "0.9.0"
|
15
15
|
s.authors = ["Christian Johansen"]
|
16
16
|
s.email = ["christian@gitorious.org"]
|
17
17
|
s.homepage = "http://gitorious.org/gitorious/dolt"
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
|
21
21
|
s.rubyforge_project = "dolt"
|
22
22
|
|
23
|
-
s.add_dependency "libdolt", "~>0.
|
23
|
+
s.add_dependency "libdolt", "~>0.12"
|
24
24
|
s.add_dependency "thin", "~>1.4"
|
25
25
|
s.add_dependency "sinatra", "~>1.0"
|
26
26
|
s.add_dependency "async_sinatra", "~>1.0"
|
data/lib/dolt/sinatra/actions.rb
CHANGED
@@ -85,6 +85,18 @@ module Dolt
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
+
def tree_entry(repo, ref, path)
|
89
|
+
actions.tree_entry(repo, ref, path) do |err, data|
|
90
|
+
begin
|
91
|
+
next error(err, repo, ref) if !err.nil?
|
92
|
+
response["Content-Type"] = "text/html"
|
93
|
+
body(renderer.render(data.key?(:tree) ? :tree : :blob, data))
|
94
|
+
rescue Exception => err
|
95
|
+
error(err, repo, ref)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
88
100
|
def blame(repo, ref, path)
|
89
101
|
actions.blame(repo, ref, path) do |err, data|
|
90
102
|
next error(err, repo, ref) if !err.nil?
|
@@ -87,6 +87,10 @@ class Actions
|
|
87
87
|
respond(:tree, repo, ref, path, &block)
|
88
88
|
end
|
89
89
|
|
90
|
+
def tree_entry(repo, ref, path, &block)
|
91
|
+
respond(:tree_entry, repo, ref, path, &block)
|
92
|
+
end
|
93
|
+
|
90
94
|
def raw(repo, ref, path, &block)
|
91
95
|
respond(:raw, repo, ref, path, &block)
|
92
96
|
end
|
@@ -112,7 +116,7 @@ class Actions
|
|
112
116
|
@ref = ref
|
113
117
|
@path = path
|
114
118
|
data = { :ref => ref, :repository => repo }
|
115
|
-
data[type] = @response
|
119
|
+
data[type != :tree_entry ? type : (@response.class.to_s =~ /Tree/ ? :tree : :blob)] = @response
|
116
120
|
block.call(nil, data)
|
117
121
|
end
|
118
122
|
end
|
@@ -177,6 +181,24 @@ describe Dolt::Sinatra::Actions do
|
|
177
181
|
end
|
178
182
|
end
|
179
183
|
|
184
|
+
describe "#tree_entry" do
|
185
|
+
it "renders trees with the tree template as html" do
|
186
|
+
app = DummySinatraApp.new(Actions.new(TreeStub.new), Renderer.new("Tree"))
|
187
|
+
app.tree_entry("gitorious", "master", "app/models")
|
188
|
+
|
189
|
+
assert_equal "text/html", app.response["Content-Type"]
|
190
|
+
assert_equal "tree:Tree", app.body
|
191
|
+
end
|
192
|
+
|
193
|
+
it "renders trees with the tree template as html" do
|
194
|
+
app = DummySinatraApp.new(Actions.new(BlobStub.new), Renderer.new("Blob"))
|
195
|
+
app.tree_entry("gitorious", "master", "app/models")
|
196
|
+
|
197
|
+
assert_equal "text/html", app.response["Content-Type"]
|
198
|
+
assert_equal "blob:Blob", app.body
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
180
202
|
describe "#raw" do
|
181
203
|
it "delegates to actions" do
|
182
204
|
actions = Actions.new(BlobStub.new)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dolt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.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: 2012-12-
|
12
|
+
date: 2012-12-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: libdolt
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '0.
|
21
|
+
version: '0.12'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
29
|
+
version: '0.12'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: thin
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|