aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-06-01 17:50:52 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-06-01 17:50:52 +0000
commit35afe63e87d06e51e807fea3a3aa0a782f3dbd36 (patch)
tree0dfd3dea5bf4a47bf34b78ef96ca3af0b9640bef
parenta80150dec9d6558a9940e6c2e89fe27ef273933b (diff)
downloadpaludis-35afe63e87d06e51e807fea3a3aa0a782f3dbd36.tar.gz
paludis-35afe63e87d06e51e807fea3a3aa0a782f3dbd36.tar.xz
(ruby) Remove Generator::SomeIDsMightSupportAction, since it's only for use by DepList.
-rw-r--r--ruby/generator.cc40
-rw-r--r--ruby/generator_TEST.rb30
2 files changed, 6 insertions, 64 deletions
diff --git a/ruby/generator.cc b/ruby/generator.cc
index 2e680c4..a3ae830 100644
--- a/ruby/generator.cc
+++ b/ruby/generator.cc
@@ -34,7 +34,6 @@ namespace
static VALUE c_generator_repository;
static VALUE c_generator_category;
static VALUE c_generator_intersection;
- static VALUE c_generator_some_ids_might_support_action;
VALUE
generator_init(int, VALUE *, VALUE self)
@@ -206,42 +205,6 @@ namespace
}
}
- VALUE
- generator_some_ids_might_support_action_new(VALUE self, VALUE action_class)
- {
- Generator * ptr(0);
- try
- {
- if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, install_action_value_ptr()))
- ptr = new generator::SomeIDsMightSupportAction<InstallAction>();
- else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, installed_action_value_ptr()))
- ptr = new generator::SomeIDsMightSupportAction<InstalledAction>();
- else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, uninstall_action_value_ptr()))
- ptr = new generator::SomeIDsMightSupportAction<UninstallAction>();
- else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, pretend_action_value_ptr()))
- ptr = new generator::SomeIDsMightSupportAction<PretendAction>();
- else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, config_action_value_ptr()))
- ptr = new generator::SomeIDsMightSupportAction<ConfigAction>();
- else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, fetch_action_value_ptr()))
- ptr = new generator::SomeIDsMightSupportAction<FetchAction>();
- else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, info_action_value_ptr()))
- ptr = new generator::SomeIDsMightSupportAction<InfoAction>();
- else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, pretend_fetch_action_value_ptr()))
- ptr = new generator::SomeIDsMightSupportAction<PretendFetchAction>();
- else
- rb_raise(rb_eTypeError, "Can't convert %s into an Action subclass", rb_obj_classname(action_class));
-
- VALUE data(Data_Wrap_Struct(self, 0, &Common<Generator>::free, ptr));
- rb_obj_call_init(data, 1, &action_class);
- return data;
- }
- catch (const std::exception & e)
- {
- delete ptr;
- exception_to_ruby_exception(e);
- }
- }
-
void do_register_generator()
{
/*
@@ -311,9 +274,6 @@ namespace
*/
c_generator_repository = rb_define_class_under(c_generator_module, "Repository", c_generator);
rb_define_singleton_method(c_generator_repository, "new", RUBY_FUNC_CAST(&generator_repository_new), 1);
-
- c_generator_some_ids_might_support_action = rb_define_class_under(c_generator_module, "SomeIDsMightSupportAction", c_generator);
- rb_define_singleton_method(c_generator_some_ids_might_support_action, "new", RUBY_FUNC_CAST(&generator_some_ids_might_support_action_new), 1);
}
}
diff --git a/ruby/generator_TEST.rb b/ruby/generator_TEST.rb
index 6e256b8..12456fb 100644
--- a/ruby/generator_TEST.rb
+++ b/ruby/generator_TEST.rb
@@ -90,49 +90,31 @@ module Paludis
end
end
- class TestCase_GeneratorSomeIDsMightSupportAction < Test::Unit::TestCase
- def test_create
- assert_nothing_raised do
- Generator::SomeIDsMightSupportAction.new(InstallAction)
- end
- end
-
- def test_bad_create
- assert_raise TypeError do
- Generator::SomeIDsMightSupportAction.new(String)
- end
- end
-
- def test_to_s
- assert_equal Generator::SomeIDsMightSupportAction.new(InstallAction).to_s, "packages that might support action install"
- end
- end
-
class TestCase_GeneratorIntersection < Test::Unit::TestCase
def test_create
assert_nothing_raised do
- Generator::Intersection.new(Generator::All.new, Generator::SomeIDsMightSupportAction.new(InstallAction))
+ Generator::Intersection.new(Generator::All.new, Generator::Repository.new("arbor"))
end
end
def test_to_s
- assert_equal Generator::Intersection.new(Generator::All.new, Generator::SomeIDsMightSupportAction.new(InstallAction)).to_s,
- "all packages intersected with packages that might support action install"
+ assert_equal Generator::Intersection.new(Generator::All.new, Generator::Repository.new("arbor")).to_s,
+ "all packages intersected with packages with repository arbor"
end
end
class TestCase_GeneratorAmpersand < Test::Unit::TestCase
def test_create
g1 = Generator::All.new
- g2 = Generator::SomeIDsMightSupportAction.new(InstallAction)
+ g2 = Generator::Repository.new("arbor")
assert_nothing_raised do
g1 & g2
end
end
def test_to_s
- assert_equal (Generator::All.new & Generator::SomeIDsMightSupportAction.new(InstalledAction)).to_s,
- "all packages intersected with packages that might support action installed"
+ assert_equal (Generator::All.new & Generator::Repository.new("arbor")).to_s,
+ "all packages intersected with packages with repository arbor"
end
end
end