Commit 16b4c14105be66ca4dc88d08cd3aeb738a052c09
- Date: Wed Apr 09 05:50:20 +0000 2008
- Committer: Tim Dysinger (tim@dysinger.net)
- Author: Tim Dysinger (tim@dysinger.net)
- Commit SHA1: 16b4c14105be66ca4dc88d08cd3aeb738a052c09
- Tree SHA1: 77722b49e45b67468b361a245897cd3b23606757
Fix to use GitoriousConfig["repository_base_path"] for strainer instead of hard coded ~/repositories
Commit diff
| |   |
| 26 | 26 | attr_reader :path, :verb, :command |
| 27 | 27 | |
| 28 | 28 | def full_path |
| 29 | | File.join(File.expand_path("~"), "repositories", path) |
| 29 | File.join(GitoriousConfig["repository_base_path"], path) |
| 30 | 30 | end |
| 31 | 31 | |
| 32 | 32 | def parse! |
| toggle raw diff |
--- a/lib/gitorious/ssh/strainer.rb
+++ b/lib/gitorious/ssh/strainer.rb
@@ -26,7 +26,7 @@ module Gitorious
attr_reader :path, :verb, :command
def full_path
- File.join(File.expand_path("~"), "repositories", path)
+ File.join(GitoriousConfig["repository_base_path"], path)
end
def parse! |
| |   |
| 85 | 85 | |
| 86 | 86 | it "returns the command we can safely execute with git-shell" do |
| 87 | 87 | client = Gitorious::SSH::Client.new(@strainer, "johan") |
| 88 | | repos_path = File.join(File.expand_path("~"), "repositories", @strainer.path) |
| 88 | repos_path = File.join(GitoriousConfig["repository_base_path"], @strainer.path) |
| 89 | 89 | client.to_git_shell_argument.should == "git-upload-pack '#{repos_path}'" |
| 90 | 90 | end |
| 91 | 91 | |
| toggle raw diff |
--- a/spec/lib/gitorious/ssh/client_spec.rb
+++ b/spec/lib/gitorious/ssh/client_spec.rb
@@ -85,7 +85,7 @@ describe Gitorious::SSH::Client do
it "returns the command we can safely execute with git-shell" do
client = Gitorious::SSH::Client.new(@strainer, "johan")
- repos_path = File.join(File.expand_path("~"), "repositories", @strainer.path)
+ repos_path = File.join(GitoriousConfig["repository_base_path"], @strainer.path)
client.to_git_shell_argument.should == "git-upload-pack '#{repos_path}'"
end
|
| |   |
| 67 | 67 | strainer2.should == strainer |
| 68 | 68 | end |
| 69 | 69 | |
| 70 | | it "has the full path from the users home directory" do |
| 70 | it "has the full path prepended with the gitorious.yml file setting" do |
| 71 | 71 | strainer = Gitorious::SSH::Strainer.new("git-upload-pack 'foo/bar.git'").parse! |
| 72 | | strainer.full_path.should == File.join(File.expand_path("~"), "repositories", "foo", "bar.git") |
| 72 | strainer.full_path.should == |
| 73 | File.join(GitoriousConfig["repository_base_path"], "foo", "bar.git") |
| 73 | 74 | end |
| 74 | 75 | |
| 75 | 76 | it "sets the path of the parsed command" do |
| toggle raw diff |
--- a/spec/lib/gitorious/ssh/strainer_spec.rb
+++ b/spec/lib/gitorious/ssh/strainer_spec.rb
@@ -67,9 +67,10 @@ describe Gitorious::SSH::Strainer do
strainer2.should == strainer
end
- it "has the full path from the users home directory" do
+ it "has the full path prepended with the gitorious.yml file setting" do
strainer = Gitorious::SSH::Strainer.new("git-upload-pack 'foo/bar.git'").parse!
- strainer.full_path.should == File.join(File.expand_path("~"), "repositories", "foo", "bar.git")
+ strainer.full_path.should ==
+ File.join(GitoriousConfig["repository_base_path"], "foo", "bar.git")
end
it "sets the path of the parsed command" do |