Commit a16a027f81b10945141de6e4984ba6b7af41b16d
- Date: Wed Mar 05 23:50:19 +0000 2008
- Committer: David Chelimsky (dchelimsky@gmail.com)
- Author: David Chelimsky (dchelimsky@gmail.com)
- Commit SHA1: a16a027f81b10945141de6e4984ba6b7af41b16d
- Tree SHA1: e225024a19a71df505e02f26cd6436e8acd2c4be
Use GitoriousConfig['gitorious_host'] instead of new constant.
Commit diff
| |   |
| 18 | 18 | after_create :add_user_as_committer, :create_new_repos_task |
| 19 | 19 | after_destroy :create_delete_repos_task |
| 20 | 20 | |
| 21 | | BASE_REPOSITORY_URL = "GitoriousConfig['gitorious_host']" |
| 22 | | |
| 23 | 21 | def self.new_by_cloning(other, username=nil) |
| 24 | 22 | suggested_name = username ? "#{username}s-clone" : nil |
| 25 | 23 | new(:parent => other, :project => other.project, :name => suggested_name) |
| … | … | |
| 45 | 45 | end |
| 46 | 46 | |
| 47 | 47 | def clone_url |
| 48 | | "git://#{BASE_REPOSITORY_URL}/#{gitdir}" |
| 48 | "git://#{GitoriousConfig['gitorious_host']}/#{gitdir}" |
| 49 | 49 | end |
| 50 | 50 | |
| 51 | 51 | def http_clone_url |
| 52 | | "http://git.#{BASE_REPOSITORY_URL}/#{gitdir}" |
| 52 | "http://git.#{GitoriousConfig['gitorious_host']}/#{gitdir}" |
| 53 | 53 | end |
| 54 | 54 | |
| 55 | 55 | def push_url |
| 56 | | "git@#{BASE_REPOSITORY_URL}:#{gitdir}" |
| 56 | "git@#{GitoriousConfig['gitorious_host']}:#{gitdir}" |
| 57 | 57 | end |
| 58 | 58 | |
| 59 | 59 | def full_repository_path |
| toggle raw diff |
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -18,8 +18,6 @@ class Repository < ActiveRecord::Base
after_create :add_user_as_committer, :create_new_repos_task
after_destroy :create_delete_repos_task
- BASE_REPOSITORY_URL = "GitoriousConfig['gitorious_host']"
-
def self.new_by_cloning(other, username=nil)
suggested_name = username ? "#{username}s-clone" : nil
new(:parent => other, :project => other.project, :name => suggested_name)
@@ -47,15 +45,15 @@ class Repository < ActiveRecord::Base
end
def clone_url
- "git://#{BASE_REPOSITORY_URL}/#{gitdir}"
+ "git://#{GitoriousConfig['gitorious_host']}/#{gitdir}"
end
def http_clone_url
- "http://git.#{BASE_REPOSITORY_URL}/#{gitdir}"
+ "http://git.#{GitoriousConfig['gitorious_host']}/#{gitdir}"
end
def push_url
- "git@#{BASE_REPOSITORY_URL}:#{gitdir}"
+ "git@#{GitoriousConfig['gitorious_host']}:#{gitdir}"
end
def full_repository_path |
| |   |
| 62 | 62 | end |
| 63 | 63 | |
| 64 | 64 | it "has a push url" do |
| 65 | | @repository.push_url.should == "git@GitoriousConfig['gitorious_host']:#{@repository.project.slug}/foo.git" |
| 65 | @repository.push_url.should == "git@#{GitoriousConfig['gitorious_host']}:#{@repository.project.slug}/foo.git" |
| 66 | 66 | end |
| 67 | 67 | |
| 68 | 68 | it "has a clone url" do |
| 69 | | @repository.clone_url.should == "git://GitoriousConfig['gitorious_host']/#{@repository.project.slug}/foo.git" |
| 69 | @repository.clone_url.should == "git://#{GitoriousConfig['gitorious_host']}/#{@repository.project.slug}/foo.git" |
| 70 | 70 | end |
| 71 | 71 | |
| 72 | 72 | it "has a http url" do |
| 73 | | @repository.http_clone_url.should == "http://git.GitoriousConfig['gitorious_host']/#{@repository.project.slug}/foo.git" |
| 73 | @repository.http_clone_url.should == "http://git.#{GitoriousConfig['gitorious_host']}/#{@repository.project.slug}/foo.git" |
| 74 | 74 | end |
| 75 | 75 | |
| 76 | 76 | it "should assign the creator as a comitter on create" do |
| toggle raw diff |
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -62,15 +62,15 @@ describe Repository do
end
it "has a push url" do
- @repository.push_url.should == "git@GitoriousConfig['gitorious_host']:#{@repository.project.slug}/foo.git"
+ @repository.push_url.should == "git@#{GitoriousConfig['gitorious_host']}:#{@repository.project.slug}/foo.git"
end
it "has a clone url" do
- @repository.clone_url.should == "git://GitoriousConfig['gitorious_host']/#{@repository.project.slug}/foo.git"
+ @repository.clone_url.should == "git://#{GitoriousConfig['gitorious_host']}/#{@repository.project.slug}/foo.git"
end
it "has a http url" do
- @repository.http_clone_url.should == "http://git.GitoriousConfig['gitorious_host']/#{@repository.project.slug}/foo.git"
+ @repository.http_clone_url.should == "http://git.#{GitoriousConfig['gitorious_host']}/#{@repository.project.slug}/foo.git"
end
it "should assign the creator as a comitter on create" do |