Emit a warning when a deprecated function is used, so users have a way
to know that they are using one.
---
generator/ruby.ml | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/generator/ruby.ml b/generator/ruby.ml
index 76fcb58eb..ea129fcba 100644
--- a/generator/ruby.ml
+++ b/generator/ruby.ml
@@ -253,6 +253,16 @@ and generate_ruby_c actions () =
pr "\n"
);
+ (match f.deprecated_by with
+ | Not_deprecated -> ()
+ | Replaced_by alt ->
+ pr " rb_warn (\"Guestfs#%s is deprecated; use #%s
instead\");\n" f.name alt;
+ pr "\n"
+ | Deprecated_no_replacement ->
+ pr " rb_warn (\"Guestfs#%s is deprecated\");\n" f.name;
+ pr "\n"
+ );
+
List.iter (
function
| String (_, n) ->
--
2.20.1