gitauth 0.0.5.1 → 0.0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/config.ru CHANGED
@@ -1,15 +1,9 @@
1
- vendor_dir = File.join(File.dirname(__FILE__), "vendor")
2
-
3
- require File.join(vendor_dir, "rack", "lib", "rack")
4
- require File.join(vendor_dir, "sinatra", "lib", "sinatra")
5
-
6
1
  require File.join(File.dirname(__FILE__), "lib", "gitauth")
7
2
  require GitAuth::BASE_DIR.join("lib", "gitauth", "web_app")
8
3
 
9
4
  GitAuth::Settings.setup!
10
5
 
11
6
  output = File.open(GitAuth::Logger.default_logger_path, "a+")
12
-
13
7
  STDOUT.reopen(output)
14
8
  STDERR.reopen(output)
15
9
 
@@ -28,7 +28,7 @@ module GitAuth
28
28
  include Perennial
29
29
  include Loggable
30
30
 
31
- VERSION = [0, 0, 5, 1]
31
+ VERSION = [0, 0, 5, 2]
32
32
  BASE_DIR = Pathname(__FILE__).dirname.join("..").expand_path
33
33
  GITAUTH_DIR = Pathname("~/.gitauth/").expand_path
34
34
 
@@ -29,16 +29,25 @@ module GitAuth
29
29
  end
30
30
 
31
31
  def _call(env)
32
+ @request = Rack::Request.new(env)
32
33
  if GitAuth::WebApp.has_auth?
33
34
  @app.call(env)
34
35
  elsif env["PATH_INFO"].include?("/gitauth.css")
35
36
  @files.call(env)
36
37
  else
37
- content = ERB.new(File.read(GitAuth::BASE_DIR.join("views", "auth_setup.erb"))).result
38
+ content = ERB.new(File.read(GitAuth::BASE_DIR.join("views", "auth_setup.erb"))).result(binding)
38
39
  headers = {"Content-Type" => "text/html", "Content-Length" => Rack::Utils.bytesize(content).to_s}
39
40
  [403, headers, [content]]
40
41
  end
41
42
  end
42
43
 
44
+ def u(path)
45
+ "#{@request.script_name}#{path}"
46
+ end
47
+
48
+ def request
49
+ @request
50
+ end
51
+
43
52
  end
44
53
  end
@@ -7,7 +7,7 @@
7
7
  <body>
8
8
  <div id="container">
9
9
  <div id="header">
10
- <h1><%= link-to "GitAuth Admin Area", "/ "%></h1>
10
+ <h1><a href="<%=u "/" %>">GitAuth Admin Area</a></h1>
11
11
  </div>
12
12
  <div id="contents">
13
13
  <div id='error-container'>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5.1
4
+ version: 0.0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darcy Laycock
@@ -120,7 +120,7 @@ files:
120
120
  - views/layout.erb
121
121
  - views/repo.erb
122
122
  - views/user.erb
123
- has_rdoc: true
123
+ has_rdoc: false
124
124
  homepage: http://brownbeagle.com.au/
125
125
  licenses: []
126
126
 
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements: []
145
145
 
146
146
  rubyforge_project:
147
- rubygems_version: 1.3.5
147
+ rubygems_version: 1.3.2
148
148
  signing_key:
149
149
  specification_version: 3
150
150
  summary: An authentication manager for Git repositories served over SSH