dolt 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dolt (0.7.1)
4
+ dolt (0.7.2)
5
5
  async_sinatra (~> 1.0)
6
6
  json (~> 1.5)
7
- libdolt (~> 0.8)
7
+ libdolt (~> 0.10)
8
8
  sinatra (~> 1.0)
9
9
  thin (~> 1.4)
10
10
  tiltout (~> 1.1)
@@ -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.10.0)
30
+ libdolt (0.10.1)
31
31
  em_pessimistic (~> 0.1)
32
32
  em_rugged (~> 0.3)
33
33
  eventmachine (~> 1.0)
@@ -47,7 +47,7 @@ GEM
47
47
  mocha (0.12.7)
48
48
  metaclass (~> 0.0.1)
49
49
  posix-spawn (0.3.6)
50
- pygments.rb (0.3.1)
50
+ pygments.rb (0.3.2)
51
51
  posix-spawn (~> 0.3.6)
52
52
  yajl-ruby (~> 1.1.0)
53
53
  rack (1.4.1)
@@ -66,7 +66,7 @@ GEM
66
66
  tilt (1.3.3)
67
67
  tiltout (1.2.0)
68
68
  tilt (~> 1.3)
69
- tzinfo (0.3.33)
69
+ tzinfo (0.3.35)
70
70
  when (0.1.0)
71
71
  yajl-ruby (1.1.0)
72
72
 
data/bin/dolt CHANGED
@@ -49,9 +49,9 @@ view.helper(Dolt::View::Breadcrumb)
49
49
  view.helper(Dolt::View::Tree)
50
50
  view.helper(Dolt::View::Commit)
51
51
  view.helper(Dolt::View::Gravatar)
52
- Dolt::View::TabWidth.tab_width = 4
53
52
  view.helper(Dolt::View::TabWidth)
54
53
  view.helper(Dolt::View::BinaryBlobEmbedder)
54
+ view.helper(:tab_width => 4, :maxdepth => 3)
55
55
 
56
56
  # Configure blob rendering module
57
57
 
@@ -64,14 +64,6 @@ view.helper(Dolt::View::BinaryBlobEmbedder)
64
64
  # Render supported formats as markup, syntax highlight the rest
65
65
  view.helper(Dolt::View::SmartBlobRenderer)
66
66
 
67
- module MaxDepth
68
- def maxdepth
69
- 3
70
- end
71
- end
72
-
73
- view.helper(MaxDepth)
74
-
75
67
  Sinatra::Base.set(:public_folder, File.join(base, "vendor/ui"))
76
68
  server = create_app(ARGV[0], view)
77
69
  Thin::Server.start("0.0.0.0", 3000, server)
@@ -11,7 +11,7 @@ end
11
11
 
12
12
  Gem::Specification.new do |s|
13
13
  s.name = "dolt"
14
- s.version = "0.7.1"
14
+ s.version = "0.8.0"
15
15
  s.authors = ["Christian Johansen"]
16
16
  s.email = ["christian@gitorious.org"]
17
17
  s.homepage = "http://gitorious.org/gitorious/dolt"
@@ -20,11 +20,11 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.rubyforge_project = "dolt"
22
22
 
23
- s.add_dependency "libdolt", "~>0.8"
23
+ s.add_dependency "libdolt", "~>0.11"
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"
27
- s.add_dependency "tiltout", "~>1.1"
27
+ s.add_dependency "tiltout", "~>1.4"
28
28
  s.add_dependency "json", "~>1.5"
29
29
 
30
30
  s.add_development_dependency "minitest", "~> 2.0"
@@ -15,7 +15,6 @@
15
15
  # You should have received a copy of the GNU Affero General Public License
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  #++
18
- require "em_rugged"
19
18
  require "json"
20
19
 
21
20
  module Dolt
@@ -36,6 +35,21 @@ module Dolt
36
35
  :repository_slug => repo,
37
36
  :ref => ref
38
37
  }))
38
+ rescue Exception => err
39
+ err_backtrace = err.backtrace.map { |s| "<li>#{s}</li>" }
40
+ error_backtrace = error.backtrace.map { |s| "<li>#{s}</li>" }
41
+
42
+ body(<<-HTML)
43
+ <h1>Fatal Dolt Error</h1>
44
+ <p>
45
+ Dolt encountered an exception, and additionally
46
+ triggered another exception trying to render the error.
47
+ </p>
48
+ <h2>Error: #{err.class} #{err.message}</h2>
49
+ <ul>#{err_backtrace.join()}</ul>
50
+ <h2>Original error: #{error.class} #{error.message}</h2>
51
+ <ul>#{error_backtrace.join()}</ul>
52
+ HTML
39
53
  end
40
54
 
41
55
  def raw(repo, ref, path)
@@ -50,7 +64,7 @@ module Dolt
50
64
  actions.blob(repo, ref, path) do |err, data|
51
65
  next error(err, repo, ref) if !err.nil?
52
66
  blob = data[:blob]
53
- next redirect(tree_url(repo, ref, path)) if !blob.is_a?(Rugged::Blob)
67
+ next redirect(tree_url(repo, ref, path)) if blob.class.to_s !~ /\bBlob/
54
68
  response["Content-Type"] = options[:content_type]
55
69
  tpl_options = options[:template_options] || {}
56
70
  body(renderer.render(options[:template], data, tpl_options))
@@ -59,11 +73,15 @@ module Dolt
59
73
 
60
74
  def tree(repo, ref, path)
61
75
  actions.tree(repo, ref, path) do |err, data|
62
- next error(err, repo, ref) if !err.nil?
63
- tree = data[:tree]
64
- next redirect(blob_url(repo, ref, path)) if tree.class.to_s !~ /\bTree/
65
- response["Content-Type"] = "text/html"
66
- body(renderer.render(:tree, data))
76
+ begin
77
+ next error(err, repo, ref) if !err.nil?
78
+ tree = data[:tree]
79
+ next redirect(blob_url(repo, ref, path)) if tree.class.to_s !~ /\bTree/
80
+ response["Content-Type"] = "text/html"
81
+ body(renderer.render(:tree, data))
82
+ rescue Exception => err
83
+ error(err, repo, ref)
84
+ end
67
85
  end
68
86
  end
69
87
 
@@ -16,14 +16,14 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  #++
18
18
  require "dolt/sinatra/base"
19
- require "libdolt/view/single_repository"
19
+ require "libdolt/view/multi_repository"
20
20
  require "libdolt/view/blob"
21
21
  require "libdolt/view/tree"
22
22
 
23
23
  module Dolt
24
24
  module Sinatra
25
25
  class MultiRepoBrowser < Dolt::Sinatra::Base
26
- include Dolt::View::SingleRepository
26
+ include Dolt::View::MultiRepository
27
27
  include Dolt::View::Blob
28
28
  include Dolt::View::Tree
29
29
 
metadata CHANGED
@@ -1,181 +1,184 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: dolt
3
- version: !ruby/object:Gem::Version
4
- hash: 1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 7
9
- - 1
10
- version: 0.7.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Christian Johansen
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-10-19 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-12-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: libdolt
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
18
+ requirements:
26
19
  - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 27
29
- segments:
30
- - 0
31
- - 8
32
- version: "0.8"
20
+ - !ruby/object:Gem::Version
21
+ version: '0.11'
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: thin
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '0.11'
30
+ - !ruby/object:Gem::Dependency
31
+ name: thin
32
+ requirement: !ruby/object:Gem::Requirement
39
33
  none: false
40
- requirements:
34
+ requirements:
41
35
  - - ~>
42
- - !ruby/object:Gem::Version
43
- hash: 7
44
- segments:
45
- - 1
46
- - 4
47
- version: "1.4"
36
+ - !ruby/object:Gem::Version
37
+ version: '1.4'
48
38
  type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: sinatra
52
39
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
54
41
  none: false
55
- requirements:
42
+ requirements:
56
43
  - - ~>
57
- - !ruby/object:Gem::Version
58
- hash: 15
59
- segments:
60
- - 1
61
- - 0
62
- version: "1.0"
44
+ - !ruby/object:Gem::Version
45
+ version: '1.4'
46
+ - !ruby/object:Gem::Dependency
47
+ name: sinatra
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: '1.0'
63
54
  type: :runtime
64
- version_requirements: *id003
65
- - !ruby/object:Gem::Dependency
66
- name: async_sinatra
67
55
  prerelease: false
68
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
69
57
  none: false
70
- requirements:
58
+ requirements:
71
59
  - - ~>
72
- - !ruby/object:Gem::Version
73
- hash: 15
74
- segments:
75
- - 1
76
- - 0
77
- version: "1.0"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: async_sinatra
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '1.0'
78
70
  type: :runtime
79
- version_requirements: *id004
80
- - !ruby/object:Gem::Dependency
81
- name: tiltout
82
71
  prerelease: false
83
- requirement: &id005 !ruby/object:Gem::Requirement
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '1.0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: tiltout
80
+ requirement: !ruby/object:Gem::Requirement
84
81
  none: false
85
- requirements:
82
+ requirements:
86
83
  - - ~>
87
- - !ruby/object:Gem::Version
88
- hash: 13
89
- segments:
90
- - 1
91
- - 1
92
- version: "1.1"
84
+ - !ruby/object:Gem::Version
85
+ version: '1.4'
93
86
  type: :runtime
94
- version_requirements: *id005
95
- - !ruby/object:Gem::Dependency
96
- name: json
97
87
  prerelease: false
98
- requirement: &id006 !ruby/object:Gem::Requirement
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '1.4'
94
+ - !ruby/object:Gem::Dependency
95
+ name: json
96
+ requirement: !ruby/object:Gem::Requirement
99
97
  none: false
100
- requirements:
98
+ requirements:
101
99
  - - ~>
102
- - !ruby/object:Gem::Version
103
- hash: 5
104
- segments:
105
- - 1
106
- - 5
107
- version: "1.5"
100
+ - !ruby/object:Gem::Version
101
+ version: '1.5'
108
102
  type: :runtime
109
- version_requirements: *id006
110
- - !ruby/object:Gem::Dependency
111
- name: minitest
112
103
  prerelease: false
113
- requirement: &id007 !ruby/object:Gem::Requirement
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: '1.5'
110
+ - !ruby/object:Gem::Dependency
111
+ name: minitest
112
+ requirement: !ruby/object:Gem::Requirement
114
113
  none: false
115
- requirements:
114
+ requirements:
116
115
  - - ~>
117
- - !ruby/object:Gem::Version
118
- hash: 3
119
- segments:
120
- - 2
121
- - 0
122
- version: "2.0"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.0'
123
118
  type: :development
124
- version_requirements: *id007
125
- - !ruby/object:Gem::Dependency
126
- name: em-minitest-spec
127
119
  prerelease: false
128
- requirement: &id008 !ruby/object:Gem::Requirement
120
+ version_requirements: !ruby/object:Gem::Requirement
129
121
  none: false
130
- requirements:
122
+ requirements:
131
123
  - - ~>
132
- - !ruby/object:Gem::Version
133
- hash: 13
134
- segments:
135
- - 1
136
- - 1
137
- version: "1.1"
124
+ - !ruby/object:Gem::Version
125
+ version: '2.0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: em-minitest-spec
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ~>
132
+ - !ruby/object:Gem::Version
133
+ version: '1.1'
138
134
  type: :development
139
- version_requirements: *id008
140
- - !ruby/object:Gem::Dependency
141
- name: rake
142
135
  prerelease: false
143
- requirement: &id009 !ruby/object:Gem::Requirement
136
+ version_requirements: !ruby/object:Gem::Requirement
144
137
  none: false
145
- requirements:
138
+ requirements:
146
139
  - - ~>
147
- - !ruby/object:Gem::Version
148
- hash: 25
149
- segments:
150
- - 0
151
- - 9
152
- version: "0.9"
140
+ - !ruby/object:Gem::Version
141
+ version: '1.1'
142
+ - !ruby/object:Gem::Dependency
143
+ name: rake
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ~>
148
+ - !ruby/object:Gem::Version
149
+ version: '0.9'
153
150
  type: :development
154
- version_requirements: *id009
155
- - !ruby/object:Gem::Dependency
156
- name: mocha
157
151
  prerelease: false
158
- requirement: &id010 !ruby/object:Gem::Requirement
159
- none: false
160
- requirements:
161
- - - ">="
162
- - !ruby/object:Gem::Version
163
- hash: 3
164
- segments:
165
- - 0
166
- version: "0"
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ~>
156
+ - !ruby/object:Gem::Version
157
+ version: '0.9'
158
+ - !ruby/object:Gem::Dependency
159
+ name: mocha
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
167
166
  type: :development
168
- version_requirements: *id010
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
169
174
  description: Dolt serves git trees and syntax highlighted blobs
170
- email:
175
+ email:
171
176
  - christian@gitorious.org
172
- executables:
177
+ executables:
173
178
  - dolt
174
179
  extensions: []
175
-
176
180
  extra_rdoc_files: []
177
-
178
- files:
181
+ files:
179
182
  - ./.gitmodules
180
183
  - ./Gemfile
181
184
  - ./Gemfile.lock
@@ -219,36 +222,26 @@ files:
219
222
  - bin/dolt
220
223
  homepage: http://gitorious.org/gitorious/dolt
221
224
  licenses: []
222
-
223
225
  post_install_message:
224
226
  rdoc_options: []
225
-
226
- require_paths:
227
+ require_paths:
227
228
  - lib
228
- required_ruby_version: !ruby/object:Gem::Requirement
229
+ required_ruby_version: !ruby/object:Gem::Requirement
229
230
  none: false
230
- requirements:
231
- - - ">="
232
- - !ruby/object:Gem::Version
233
- hash: 3
234
- segments:
235
- - 0
236
- version: "0"
237
- required_rubygems_version: !ruby/object:Gem::Requirement
231
+ requirements:
232
+ - - ! '>='
233
+ - !ruby/object:Gem::Version
234
+ version: '0'
235
+ required_rubygems_version: !ruby/object:Gem::Requirement
238
236
  none: false
239
- requirements:
240
- - - ">="
241
- - !ruby/object:Gem::Version
242
- hash: 3
243
- segments:
244
- - 0
245
- version: "0"
237
+ requirements:
238
+ - - ! '>='
239
+ - !ruby/object:Gem::Version
240
+ version: '0'
246
241
  requirements: []
247
-
248
242
  rubyforge_project: dolt
249
243
  rubygems_version: 1.8.24
250
244
  signing_key:
251
245
  specification_version: 3
252
246
  summary: Dolt serves git trees and syntax highlighted blobs
253
247
  test_files: []
254
-