aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-08 23:47:39 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-08 23:47:39 +0000
commitee28ca1ecdd30f33f5548b375c8b950efa1f9f3c (patch)
tree8c74f0af4eeb68c8b3838494128c50becbc79ad9
parentee49af658310a5c05442f5896ec0fe56072ba4b1 (diff)
downloadpaludis-ee28ca1ecdd30f33f5548b375c8b950efa1f9f3c.tar.gz
paludis-ee28ca1ecdd30f33f5548b375c8b950efa1f9f3c.tar.xz
Add suggested deps to version metadata ruby bindings. From eroyf.
-rw-r--r--AUTHORS2
-rw-r--r--ruby/version_metadata.cc21
-rw-r--r--ruby/version_metadata_TEST.rb3
3 files changed, 26 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
index 5e21fa4..1eb7f06 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -43,3 +43,5 @@ Richard Brown <mynamewasgone@gmail.com>
Baptiste Daroussin <baptux@free.fr>
Contributor, zsh completion
+Alexander H. Færøy <eroyf@gentoo.org>
+ Contributer
diff --git a/ruby/version_metadata.cc b/ruby/version_metadata.cc
index de14cc3..c2d0100 100644
--- a/ruby/version_metadata.cc
+++ b/ruby/version_metadata.cc
@@ -2,6 +2,7 @@
/*
* Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2007 Alexander H. Færøy <eroyf@gentoo.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -292,6 +293,14 @@ namespace
* Fetches run_depend information as a DepAtom
*/
/*
+ * Document-method: suggested_depend
+ *
+ * call-seq:
+ * suggested_depend -> DepAtom
+ *
+ * Fetches sugest_depend information as a DepAtom
+ */
+ /*
* Document-method: post_depend
*
* call-seq:
@@ -329,6 +338,14 @@ namespace
* Fetches run_depend information as a String
*/
/*
+ * Document-method: suggested_depend_string
+ *
+ * call-seq:
+ * suggested_depend_string -> String
+ *
+ * Fetches suggested_depend information as a String
+ */
+ /*
* Document-method: post_depend_string
*
* call-seq:
@@ -467,6 +484,8 @@ namespace
&VersionMetadataDeps::build_depend>::fetch)), 0);
rb_define_method(c_version_metadata, "run_depend", RUBY_FUNC_CAST((&DependValue<
&VersionMetadataDeps::run_depend>::fetch)), 0);
+ rb_define_method(c_version_metadata, "suggested_depend", RUBY_FUNC_CAST((&DependValue<
+ &VersionMetadataDeps::suggested_depend>::fetch)), 0);
rb_define_method(c_version_metadata, "post_depend", RUBY_FUNC_CAST((&DependValue<
&VersionMetadataDeps::post_depend>::fetch)), 0);
@@ -474,6 +493,8 @@ namespace
&VersionMetadataDeps::build_depend_string>::fetch)), 0);
rb_define_method(c_version_metadata, "run_depend_string", RUBY_FUNC_CAST((&DependValueString<
&VersionMetadataDeps::run_depend_string>::fetch)), 0);
+ rb_define_method(c_version_metadata, "suggested_depend_string", RUBY_FUNC_CAST((&DependValueString<
+ &VersionMetadataDeps::suggested_depend_string>::fetch)), 0);
rb_define_method(c_version_metadata, "post_depend_string", RUBY_FUNC_CAST((&DependValueString<
&VersionMetadataDeps::post_depend_string>::fetch)), 0);
diff --git a/ruby/version_metadata_TEST.rb b/ruby/version_metadata_TEST.rb
index 0a82265..e589ba6 100644
--- a/ruby/version_metadata_TEST.rb
+++ b/ruby/version_metadata_TEST.rb
@@ -83,14 +83,17 @@ module Paludis
def test_deps
assert_kind_of AllDepAtom, vmd("1.0").build_depend
assert_kind_of AllDepAtom, vmd("1.0").run_depend
+ assert_kind_of AllDepAtom, vmd("1.0").suggested_depend
assert_kind_of AllDepAtom, vmd("1.0").post_depend
assert_equal 1, vmd("1.0").build_depend.to_a.length
assert vmd("1.0").run_depend.to_a.empty?
+ assert vmd("1.0").suggested_depend.to_a.empty?
assert vmd("1.0").post_depend.to_a.empty?
assert_equal "foo/bar", vmd("1.0").build_depend_string.gsub(/\s/, "")
assert_equal "", vmd("1.0").run_depend_string.gsub(/\s/, "")
+ assert_equal "", vmd("1.0").suggested_depend_string.gsub(/\s/, "")
assert_equal "", vmd("1.0").post_depend_string.gsub(/\s/, "")
end