From 0a138735637f945d52c99be72e4d86dc99c5ed9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Mon, 27 Jan 2014 13:37:52 +0100 Subject: [PATCH] [Command] Deprecate usage of colons in command names. --- lib/motion/command.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/motion/command.rb b/lib/motion/command.rb index f562998b..7c130169 100644 --- a/lib/motion/command.rb +++ b/lib/motion/command.rb @@ -58,6 +58,17 @@ module Motion self.description = 'RubyMotion lets you develop native iOS and OS X ' \ 'applications using the awesome Ruby language.' + # TODO remove in RM 3. + def self.command=(name) + if name.include?(':') + root = File.expand_path('../../../', __FILE__) + external_caller = caller.find { |line| !line.start_with?(root) } + warn "[!] Commands should no longer use colons to indicate their " \ + "own namespace. (Called from: #{external_caller})" + end + super + end + def self.options [ ['--version', 'Show the version of RubyMotion'],