aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Richard Brown <rbrown@exherbo.org> 2007-02-19 19:35:34 +0000
committerAvatar Richard Brown <rbrown@exherbo.org> 2007-02-19 19:35:34 +0000
commit4e7ceb0a59da65b76c86974fca27473ff9ee88f4 (patch)
treef794f4afe40a4b7a8f8dde9492ac479e6b773906
parent8ebef6bfd4c1be0e21efc5ed51babb48a89556bd (diff)
downloadpaludis-4e7ceb0a59da65b76c86974fca27473ff9ee88f4.tar.gz
paludis-4e7ceb0a59da65b76c86974fca27473ff9ee88f4.tar.xz
Bring ruby up to date.
-rw-r--r--ruby/dep_list.cc19
-rw-r--r--ruby/dep_list_TEST.rb2
2 files changed, 20 insertions, 1 deletions
diff --git a/ruby/dep_list.cc b/ruby/dep_list.cc
index 61edc45..faf1bbc 100644
--- a/ruby/dep_list.cc
+++ b/ruby/dep_list.cc
@@ -1035,6 +1035,24 @@ namespace
}
}
+ /*
+ * call-seq:
+ * destinations -> Array
+ *
+ * Returns an array of our destinations.
+ */
+ VALUE
+ dep_list_entry_destinations(VALUE self)
+ {
+ DepListEntry * p;
+ Data_Get_Struct(self, DepListEntry, p);
+ VALUE result = rb_ary_new();
+ for (DestinationsCollection::Iterator i(p->destinations->begin()),
+ i_end(p->destinations->end()) ; i != i_end ; ++i)
+ rb_ary_push(result, repository_to_value(*i));
+ return result;
+ }
+
VALUE
dep_list_override_masks_init(VALUE self)
{
@@ -1484,6 +1502,7 @@ namespace
rb_define_method(c_dep_list_entry, "metadata", RUBY_FUNC_CAST(&dep_list_entry_metadata), 0);
rb_define_method(c_dep_list_entry, "state", RUBY_FUNC_CAST(&dep_list_entry_state), 0);
rb_define_method(c_dep_list_entry, "tags", RUBY_FUNC_CAST(&dep_list_entry_tags), 0);
+ rb_define_method(c_dep_list_entry, "destinations", RUBY_FUNC_CAST(&dep_list_entry_destinations), 0);
/*
* Document-class: DepListOverrideMasks
diff --git a/ruby/dep_list_TEST.rb b/ruby/dep_list_TEST.rb
index afa98a0..8c10677 100644
--- a/ruby/dep_list_TEST.rb
+++ b/ruby/dep_list_TEST.rb
@@ -248,7 +248,7 @@ module Paludis
dep_list_entry = dle
{
:package => PackageDatabaseEntry, :metadata => VersionMetadata,
- :state=> Integer, :tags => Array
+ :state=> Integer, :tags => Array, :destinations => Array
}.each_pair do |method, returns|
assert_respond_to dep_list_entry, method
assert_kind_of returns, dep_list_entry.send(method)