aboutsummaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-26 21:02:30 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-26 21:02:30 +0000
commit8c38f206f44258bc6d0e30829a869fc474bdcb8f (patch)
tree8003b3f8dfe04a3d2caf8c869a4447000f187cdd /ruby
parentc8ac388f675660cfd7fa697bac51c4927d84dbf3 (diff)
downloadpaludis-8c38f206f44258bc6d0e30829a869fc474bdcb8f.tar.gz
paludis-8c38f206f44258bc6d0e30829a869fc474bdcb8f.tar.xz
Kill mirrors interface
Diffstat (limited to 'ruby')
-rw-r--r--ruby/repository.cc50
-rw-r--r--ruby/repository_TEST.rb29
2 files changed, 2 insertions, 77 deletions
diff --git a/ruby/repository.cc b/ruby/repository.cc
index 1c26e1605..a736bd066 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -320,14 +320,6 @@ namespace
* Returns self if the repository supports the interface, otherwise Nil.
*/
/*
- * Document-method: mirrors_interface
- *
- * call-seq:
- * mirrors_interface -> self or Nil
- *
- * Returns self if the repository supports the interface, otherwise Nil.
- */
- /*
* Document-method: environment_variable_interface
*
* call-seq:
@@ -618,43 +610,6 @@ namespace
return Qnil;
}
- /*
- * call-seq:
- * is_mirror?(mirror_name) -> true or false
- *
- * Is the named item a mirror?
- */
- VALUE
- repository_is_mirror(VALUE self, VALUE mirror)
- {
- std::tr1::shared_ptr<Repository> * self_ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<Repository>, self_ptr);
- if ((**self_ptr).mirrors_interface())
- return (**self_ptr).mirrors_interface()->is_mirror(StringValuePtr(mirror)) ? Qtrue : Qfalse;
- return Qnil;
- }
-
- /*
- * call-seq:
- * mirrors(mirror_name) -> Array
- *
- * Return the mirror URI prefixes for a named mirror.
- */
- VALUE
- repository_mirrors(VALUE self, VALUE mirror)
- {
- std::tr1::shared_ptr<Repository> * self_ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<Repository>, self_ptr);
- if (!(**self_ptr).mirrors_interface())
- return Qnil;
- VALUE result(rb_ary_new());
- for (RepositoryMirrorsInterface::MirrorsConstIterator m((**self_ptr).mirrors_interface()->begin_mirrors(StringValuePtr(mirror))),
- m_end((**self_ptr).mirrors_interface()->end_mirrors(StringValuePtr(mirror))) ;
- m != m_end ; ++m)
- rb_ary_push(result, rb_str_new2((m->second).c_str()));
- return result;
- }
-
void do_register_repository()
{
/*
@@ -675,8 +630,6 @@ namespace
rb_define_method(c_repository, "package_names", RUBY_FUNC_CAST(&repository_package_names), 1);
rb_define_method(c_repository, "package_ids", RUBY_FUNC_CAST(&repository_package_ids), 1);
- rb_define_method(c_repository, "mirrors_interface", RUBY_FUNC_CAST((&Interface<
- n::mirrors_interface, RepositoryMirrorsInterface, &Repository::mirrors_interface>::fetch)), 0);
rb_define_method(c_repository, "environment_variable_interface", RUBY_FUNC_CAST((&Interface<
n::environment_variable_interface, RepositoryEnvironmentVariableInterface, &Repository::environment_variable_interface>::fetch)), 0);
rb_define_method(c_repository, "provides_interface", RUBY_FUNC_CAST((&Interface<
@@ -695,9 +648,6 @@ namespace
RUBY_FUNC_CAST((&RepositoryKey<MetadataValueKey<FSEntry>, &Repository::installed_root_key>::fetch)), 0);
rb_define_method(c_repository, "get_environment_variable", RUBY_FUNC_CAST(&repository_get_environment_variable), 2);
- rb_define_method(c_repository, "is_mirror?", RUBY_FUNC_CAST(&repository_is_mirror), 1);
- rb_define_method(c_repository, "mirrors", RUBY_FUNC_CAST(&repository_mirrors), 1);
-
/*
* Document-class: Paludis::FakeRepositoryBase
*
diff --git a/ruby/repository_TEST.rb b/ruby/repository_TEST.rb
index 4d3f8a594..fb7934804 100644
--- a/ruby/repository_TEST.rb
+++ b/ruby/repository_TEST.rb
@@ -166,7 +166,7 @@ module Paludis
def test_responds
repo = no_config_testrepo.main_repository
[
- :mirrors_interface, :environment_variable_interface,
+ :environment_variable_interface,
:provides_interface, :virtuals_interface].each do |sym|
assert_respond_to repo, sym
end
@@ -174,7 +174,7 @@ module Paludis
def test_interfaces
assert_equal installed_repo.name, installed_repo.provides_interface.name
- assert_nil installed_repo.mirrors_interface
+ assert_nil installed_repo.virtuals_interface
end
def text_repository_environment_interface
@@ -229,31 +229,6 @@ module Paludis
end
end
- class TestCase_RepositoryMirrorsInterface < Test::Unit::TestCase
- include RepositoryTestCase
-
- def test_responds
- repo = no_config_testrepo.main_repository
- [:is_mirror?, :mirrors].each do |sym|
- assert_respond_to repo, sym
- end
- end
-
- def test_is_mirror?
- repo = no_config_testrepo.main_repository
- assert repo.is_mirror?('cat')
- assert !repo.is_mirror?('dog')
- end
-
- def test_mirrors
- cat_mirrors = repo.mirrors('cat')
- assert_equal 2, cat_mirrors.length
- assert cat_mirrors.include?('http://a')
- assert cat_mirrors.include?('http://b')
- assert repo.mirrors('dog').empty?
- end
- end
-
class TestCase_RepositorySomeIdsMightSupport < Test::Unit::TestCase
include RepositoryTestCase