mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
ruby: show warnings for deprecated functions
Emit a warning when a deprecated function is used, so users have a way to know that they are using one.
This commit is contained in:
@@ -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) ->
|
||||
|
||||
Reference in New Issue
Block a user