From 04f1e80a7fdcb319222f74b4a1a1610d41ed2ade Mon Sep 17 00:00:00 2001 From: Andy Brody Date: Thu, 27 Nov 2014 22:15:53 -0500 Subject: [PATCH] Use define_method rather than eval. --- bin/restclient | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/restclient b/bin/restclient index 9a585da..7876503 100755 --- a/bin/restclient +++ b/bin/restclient @@ -56,11 +56,9 @@ if @verb end POSSIBLE_VERBS.each do |m| - eval <<-end_eval -def #{m}(path, *args, &b) - r[path].#{m}(*args, &b) -end - end_eval + define_method(m.to_sym) do |path, *args, &b| + r[path].public_send(m.to_sym, *args, &b) + end end def method_missing(s, * args, & b)