dolt 0.25.0 → 0.26.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,10 +28,10 @@ describe Dolt::Sinatra::MultiRepoBrowser do
28
28
  include Rack::Test::Methods
29
29
 
30
30
  def app
31
- actions = Test::Actions.new(Stub::Blob.new)
32
- def actions.repositories; []; end
31
+ lookup = Test::Lookup.new(Stub::Blob.new)
32
+ def lookup.repositories; []; end
33
33
  view = Tiltout.new(Dolt.template_dir)
34
- Dolt::Sinatra::MultiRepoBrowser.new(actions, view)
34
+ Dolt::Sinatra::MultiRepoBrowser.new(lookup, view)
35
35
  end
36
36
 
37
37
  it "serves the index" do
@@ -42,6 +42,6 @@ describe Dolt::Sinatra::MultiRepoBrowser do
42
42
  it "redirects repo requests to main tree" do
43
43
  get "/gitorious.git"
44
44
  assert_equal 302, last_response.status
45
- assert_equal "/gitorious.git/tree/HEAD:", last_response.headers["Location"]
45
+ assert_match "/gitorious.git/tree/HEAD:", last_response.headers["Location"]
46
46
  end
47
47
  end
@@ -29,9 +29,9 @@ describe Dolt::Sinatra::SingleRepoBrowser do
29
29
 
30
30
  def app
31
31
  dir = Pathname("../../../").realpath.to_s
32
- actions = Test::Actions.new(Stub::Blob.new)
32
+ lookup = Test::Lookup.new(Stub::Blob.new)
33
33
  view = Tiltout.new(Dolt.template_dir)
34
- Dolt::Sinatra::SingleRepoBrowser.new(dir, actions, view)
34
+ Dolt::Sinatra::SingleRepoBrowser.new(dir, lookup, view)
35
35
  end
36
36
 
37
37
  it "serves the index" do
data/test/test_helper.rb CHANGED
@@ -68,15 +68,7 @@ module Stub
68
68
  end
69
69
 
70
70
  module Test
71
- class SinatraApp
72
- include Dolt::Sinatra::Actions
73
- attr_reader :actions, :renderer
74
-
75
- def initialize(actions, renderer)
76
- @actions = actions
77
- @renderer = renderer
78
- end
79
-
71
+ class App
80
72
  def body(str = nil)
81
73
  @body = str if !str.nil?
82
74
  @body
@@ -118,9 +110,13 @@ module Test
118
110
  def raw_url(repo, ref, path)
119
111
  "/#{repo}/raw/#{ref}:#{path}"
120
112
  end
113
+
114
+ def method_missing(name, *args, &block)
115
+ @actions.send(name, *args, &block)
116
+ end
121
117
  end
122
118
 
123
- class RedirectingSinatraApp < SinatraApp
119
+ class RedirectingApp < App
124
120
  def redirect_refs?; true; end
125
121
  end
126
122
 
@@ -135,7 +131,7 @@ module Test
135
131
  end
136
132
  end
137
133
 
138
- class Actions
134
+ class Lookup
139
135
  attr_reader :repo, :ref, :path
140
136
 
141
137
  def initialize(response)
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.25.0
4
+ version: 0.26.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: 2013-07-12 00:00:00.000000000 Z
12
+ date: 2013-07-15 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.23'
21
+ version: '0.26'
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.23'
29
+ version: '0.26'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: thin
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -173,7 +173,6 @@ files:
173
173
  - ./bin/dolt
174
174
  - ./dolt.gemspec
175
175
  - ./lib/dolt/sinatra/actions.rb
176
- - ./lib/dolt/sinatra/base.rb
177
176
  - ./lib/dolt/sinatra/multi_repo_browser.rb
178
177
  - ./lib/dolt/sinatra/single_repo_browser.rb
179
178
  - ./test/dolt/sinatra/actions_test.rb
@@ -1,34 +0,0 @@
1
- # encoding: utf-8
2
- #--
3
- # Copyright (C) 2012-2013 Gitorious AS
4
- #
5
- # This program is free software: you can redistribute it and/or modify
6
- # it under the terms of the GNU Affero General Public License as published by
7
- # the Free Software Foundation, either version 3 of the License, or
8
- # (at your option) any later version.
9
- #
10
- # This program is distributed in the hope that it will be useful,
11
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- # GNU Affero General Public License for more details.
14
- #
15
- # You should have received a copy of the GNU Affero General Public License
16
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
- #++
18
- require "sinatra/base"
19
- require "dolt/sinatra/actions"
20
-
21
- module Dolt
22
- module Sinatra
23
- class Base < ::Sinatra::Base
24
- attr_reader :actions, :renderer
25
- include Dolt::Sinatra::Actions
26
-
27
- def initialize(actions, renderer)
28
- @actions = actions
29
- @renderer = renderer
30
- super()
31
- end
32
- end
33
- end
34
- end