summaryrefslogtreecommitdiff
path: root/ext/pathname
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-09-24 20:59:12 -0700
committerJeremy Evans <code@jeremyevans.net>2019-11-18 01:00:25 +0200
commitffd0820ab317542f8780aac475da590a4bdbc7a8 (patch)
tree6a5d774933c15fd2b9ea948bd3ae2fa587faaf82 /ext/pathname
parentc5c05460ac20abcbc0ed686eb4acf06da7a39a79 (diff)
Deprecate taint/trust and related methods, and make the methods no-ops
This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2476
Diffstat (limited to 'ext/pathname')
-rw-r--r--ext/pathname/pathname.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c
index 75d04d0aee..15f80d487e 100644
--- a/ext/pathname/pathname.c
+++ b/ext/pathname/pathname.c
@@ -110,7 +110,6 @@ path_initialize(VALUE self, VALUE arg)
str = rb_obj_dup(str);
set_strpath(self, str);
- OBJ_INFECT(self, str);
return self;
}
@@ -134,15 +133,12 @@ path_freeze(VALUE self)
* call-seq:
* pathname.taint -> obj
*
- * Taints this Pathname.
- *
- * See Object.taint.
+ * Returns pathname. This method is deprecated and will be removed in Ruby 3.2.
*/
static VALUE
path_taint(VALUE self)
{
- rb_call_super(0, 0);
- rb_obj_taint(get_strpath(self));
+ rb_warning("Pathname#taint is deprecated and will be removed in Ruby 3.2.");
return self;
}
@@ -150,15 +146,12 @@ path_taint(VALUE self)
* call-seq:
* pathname.untaint -> obj
*
- * Untaints this Pathname.
- *
- * See Object.untaint.
+ * Returns pathname. This method is deprecated and will be removed in Ruby 3.2.
*/
static VALUE
path_untaint(VALUE self)
{
- rb_call_super(0, 0);
- rb_obj_untaint(get_strpath(self));
+ rb_warning("Pathname#untaint is deprecated and will be removed in Ruby 3.2.");
return self;
}
@@ -308,7 +301,6 @@ path_sub_ext(VALUE self, VALUE repl)
}
str2 = rb_str_subseq(str, 0, ext-p);
rb_str_append(str2, repl);
- OBJ_INFECT(str2, str);
return rb_class_new_instance(1, &str2, rb_obj_class(self));
}