aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-12 16:24:35 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-12 16:24:35 +0000
commit9d56f054c5c4c66c38d6c1d0a59328516c4834e5 (patch)
treee6278b9915c1ae3a84a3da7530e1e78d6c1df4bc
parent42688dafeb432ecf7698fb38afb86bbd8b6fb5a8 (diff)
downloadpaludis-9d56f054c5c4c66c38d6c1d0a59328516c4834e5.tar.gz
paludis-9d56f054c5c4c66c38d6c1d0a59328516c4834e5.tar.xz
Remove Ruby things that've been replaced by actions
-rw-r--r--ruby/Makefile.am8
-rw-r--r--ruby/package_database.cc4
-rw-r--r--ruby/package_database_TEST.rb18
-rw-r--r--ruby/query.cc33
-rw-r--r--ruby/query_TEST.rb66
-rw-r--r--ruby/repository.cc4
-rw-r--r--ruby/repository_TEST.rb10
7 files changed, 20 insertions, 123 deletions
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index 484519b..32d864d 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -149,7 +149,8 @@ libpaludisruby_la_LIBADD = \
$(top_builddir)/paludis/environments/paludis/libpaludispaludisenvironment.la \
$(top_builddir)/paludis/environments/no_config/libpaludisnoconfigenvironment.la \
$(top_builddir)/paludis/environments/adapted/libpaludisadaptedenvironment.la \
- $(top_builddir)/paludis/environments/libpaludisenvironments.la
+ $(top_builddir)/paludis/environments/libpaludisenvironments.la \
+ $(PTHREAD_LIBS)
TESTS = $(IF_RUBY_TESTS)
@@ -163,7 +164,7 @@ rubylib_DATA = Paludis.so
mkdir -p .libs
$(CXX) -fPIC -shared $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) $(PTHREAD_LIBS) \
-I@RUBY_SITEARCHDIR@ -l@RUBY_SONAME@ \
-o $@ \
.libs/paludis_ruby_so.o \
@@ -172,7 +173,7 @@ rubylib_DATA = Paludis.so
Paludis.so : libpaludisruby.la paludis_ruby_so.o
$(CXX) -fPIC -shared $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) $(PTHREAD_LIBS) \
-I@RUBY_SITEARCHDIR@ -l@RUBY_SONAME@ \
-o $@ \
.libs/paludis_ruby_so.o \
@@ -183,4 +184,3 @@ endif
built-sources : $(BUILT_SOURCES)
for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
-
diff --git a/ruby/package_database.cc b/ruby/package_database.cc
index 5b4a6ed..2910e0f 100644
--- a/ruby/package_database.cc
+++ b/ruby/package_database.cc
@@ -113,11 +113,11 @@ namespace
switch (is)
{
case is_installed_only:
- q = q & query::RepositoryHasInstalledInterface();
+ q = q & query::SupportsAction<InstalledAction>();
break;
case is_installable_only:
- q = q & query::RepositoryHasInstallableInterface();
+ q = q & query::SupportsAction<InstallAction>();
break;
case is_any:
diff --git a/ruby/package_database_TEST.rb b/ruby/package_database_TEST.rb
index 08181ab..cb09d98 100644
--- a/ruby/package_database_TEST.rb
+++ b/ruby/package_database_TEST.rb
@@ -118,15 +118,15 @@ module Paludis
assert_equal '1.0', pid.version.to_s
assert_equal 'testrepo', pid.repository.name
- a = db.query(Query::Matches.new(pda) & Query::RepositoryHasInstallableInterface.new,
- QueryOrder::Whatever)
- assert_kind_of Array, a
- assert_equal 1, a.length
- pid = a.first
- assert_kind_of PackageID, pid
- assert_equal 'foo/bar', pid.name
- assert_equal '1.0', pid.version.to_s
- assert_equal 'testrepo', pid.repository.name
+#### a = db.query(Query::Matches.new(pda) & Query::RepositoryHasInstallableInterface.new,
+#### QueryOrder::Whatever)
+#### assert_kind_of Array, a
+#### assert_equal 1, a.length
+#### pid = a.first
+#### assert_kind_of PackageID, pid
+#### assert_equal 'foo/bar', pid.name
+#### assert_equal '1.0', pid.version.to_s
+#### assert_equal 'testrepo', pid.repository.name
a = db.query(pda, InstallState::Any, QueryOrder::Whatever)
assert_kind_of Array, a
diff --git a/ruby/query.cc b/ruby/query.cc
index 254a574..43d25b7 100644
--- a/ruby/query.cc
+++ b/ruby/query.cc
@@ -37,9 +37,6 @@ namespace
static VALUE c_repository;
static VALUE c_category;
static VALUE c_not_masked;
- static VALUE c_repository_has_installed_interface;
- static VALUE c_repository_has_installable_interface;
- static VALUE c_repository_has_uninstallable_interface;
static VALUE c_installed_at_root;
static VALUE c_all;
@@ -284,36 +281,6 @@ namespace
RUBY_FUNC_CAST(&QueryNew<query::NotMasked>::query_new), 0);
/*
- * Document-class: Paludis::Query::RepositoryHasInstalledInterface
- *
- * Fetch packages from a repository that has RepositoryHasInstalledInterface.
- */
- c_repository_has_installed_interface = rb_define_class_under(c_query_module,
- "RepositoryHasInstalledInterface", c_query);
- rb_define_singleton_method(c_repository_has_installed_interface, "new",
- RUBY_FUNC_CAST(&QueryNew<query::RepositoryHasInstalledInterface>::query_new), 0);
-
- /*
- * Document-class: Paludis::Query::RepositoryHasInstallableInterface
- *
- * Fetch packages from a repository that has RepositoryHasInstallableInterface.
- */
- c_repository_has_installable_interface = rb_define_class_under(c_query_module,
- "RepositoryHasInstallableInterface", c_query);
- rb_define_singleton_method(c_repository_has_installable_interface, "new",
- RUBY_FUNC_CAST(&QueryNew<query::RepositoryHasInstallableInterface>::query_new), 0);
-
- /*
- * Document-class: Paludis::Query::RepositoryHasUninstallableInterface
- *
- * Fetch packages from a repository that has RepositoryHasUninstallableInterface.
- */
- c_repository_has_uninstallable_interface = rb_define_class_under(c_query_module,
- "RepositoryHasUninstallableInterface", c_query);
- rb_define_singleton_method(c_repository_has_uninstallable_interface, "new",
- RUBY_FUNC_CAST(&QueryNew<query::RepositoryHasUninstallableInterface>::query_new), 0);
-
- /*
* Document-class: Paludis::Query::InstalledAtRoot
*
* Fetch packages that are installed at a particular root.
diff --git a/ruby/query_TEST.rb b/ruby/query_TEST.rb
index c29b94b..a37c229 100644
--- a/ruby/query_TEST.rb
+++ b/ruby/query_TEST.rb
@@ -31,72 +31,6 @@ module Paludis
end
end
- class TestCase_RepositoryHasInstallableInterface < Test::Unit::TestCase
- def get_query
- Query::RepositoryHasInstallableInterface.new
- end
-
- def test_create
- assert_nothing_raised do
- get_query
- end
- end
-
- def test_and
- q = get_query
- assert_respond_to q, :&
- assert_kind_of Query::Query, q & q
- end
-
- def test_kind_of
- assert_kind_of Query::Query, get_query
- end
- end
-
- class TestCase_RepositoryHasUninstallableInterface < Test::Unit::TestCase
- def get_query
- Query::RepositoryHasUninstallableInterface.new
- end
-
- def test_create
- assert_nothing_raised do
- get_query
- end
- end
-
- def test_and
- q = get_query
- assert_respond_to q, :&
- assert_kind_of Query::Query, q & q
- end
-
- def test_kind_of
- assert_kind_of Query::Query, get_query
- end
- end
-
- class TestCase_RepositoryHasInstalledInterface < Test::Unit::TestCase
- def get_query
- Query::RepositoryHasInstalledInterface.new
- end
-
- def test_create
- assert_nothing_raised do
- get_query
- end
- end
-
- def test_and
- q = get_query
- assert_respond_to q, :&
- assert_kind_of Query::Query, q & q
- end
-
- def test_kind_of
- assert_kind_of Query::Query, get_query
- end
- end
-
class TestCase_NotMasked < Test::Unit::TestCase
def get_query
Query::NotMasked.new
diff --git a/ruby/repository.cc b/ruby/repository.cc
index 16a550b..148edd5 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -965,8 +965,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, "installable_interface", RUBY_FUNC_CAST((&Interface<RepositoryInstallableInterface,
- &Repository::installable_interface>::fetch)), 0);
rb_define_method(c_repository, "installed_interface", RUBY_FUNC_CAST((&Interface<RepositoryInstalledInterface,
&Repository::installed_interface>::fetch)), 0);
rb_define_method(c_repository, "mask_interface", RUBY_FUNC_CAST((&Interface<RepositoryMaskInterface,
@@ -975,8 +973,6 @@ namespace
&Repository::sets_interface>::fetch)), 0);
rb_define_method(c_repository, "syncable_interface", RUBY_FUNC_CAST((&Interface<RepositorySyncableInterface,
&Repository::syncable_interface>::fetch)), 0);
- rb_define_method(c_repository, "uninstallable_interface", RUBY_FUNC_CAST((&Interface<RepositoryUninstallableInterface,
- &Repository::uninstallable_interface>::fetch)), 0);
rb_define_method(c_repository, "use_interface", RUBY_FUNC_CAST((&Interface<RepositoryUseInterface,
&Repository::use_interface>::fetch)), 0);
rb_define_method(c_repository, "world_interface", RUBY_FUNC_CAST((&Interface<RepositoryWorldInterface,
diff --git a/ruby/repository_TEST.rb b/ruby/repository_TEST.rb
index 22f1c92..7b9ddbf 100644
--- a/ruby/repository_TEST.rb
+++ b/ruby/repository_TEST.rb
@@ -172,8 +172,8 @@ module Paludis
def test_responds
repo = no_config_testrepo.main_repository
- [:installable_interface, :installed_interface, :mask_interface,
- :sets_interface, :syncable_interface, :uninstallable_interface, :use_interface,
+ [:installed_interface, :mask_interface,
+ :sets_interface, :syncable_interface, :use_interface,
:world_interface, :mirrors_interface, :environment_variable_interface,
:provides_interface, :virtuals_interface, :e_interface].each do |sym|
assert_respond_to repo, sym
@@ -181,11 +181,11 @@ module Paludis
end
def test_interfaces
- assert_equal repo.name, repo.installable_interface.name
+ assert_equal repo.name, repo.mask_interface.name
assert_nil repo.installed_interface
- assert_equal installed_repo.name, installed_repo.installed_interface.name
- assert_nil installed_repo.installable_interface
+ assert_equal installed_repo.name, installed_repo.provides_interface.name
+ assert_nil installed_repo.syncable_interface
end
end