[command] Make the device-console command work again.

This commit is contained in:
Eloy Durán
2014-01-17 17:00:57 +01:00
parent b65a05e142
commit a2f130f0b3
2 changed files with 21 additions and 16 deletions

View File

@@ -45,29 +45,29 @@ module Motion; module Project
end
def self.name
warn "The usage of `Motion::Project::Command.name` is deprecated use the " \
"`Motion::Project::Command.command` method instead. " \
warn "[!] The usage of `Motion::Project::Command.name` is deprecated " \
"use the `Motion::Project::Command.command` method instead. " \
"(Called from: #{caller.first})"
command
end
def self.name=(name)
warn "The usage of `Motion::Project::Command.name=` is deprecated use the " \
"`Motion::Project::Command.command=` method instead. " \
warn "[!] The usage of `Motion::Project::Command.name=` is deprecated " \
"use the `Motion::Project::Command.command=` method instead. " \
"(Called from: #{caller.first})"
self.command = name
end
def self.help
warn "The usage of `Motion::Project::Command.help` is deprecated use the " \
"`Motion::Project::Command.summary` method instead. " \
warn "[!] The usage of `Motion::Project::Command.help` is deprecated " \
"use the `Motion::Project::Command.summary` method instead. " \
"(Called from: #{caller.first})"
summary
end
def self.help=(summary)
warn "The usage of `Motion::Project::Command.help=` is deprecated use the " \
"`Motion::Project::Command.summary=` method instead. " \
warn "[!] The usage of `Motion::Project::Command.help=` is deprecated " \
"use the `Motion::Project::Command.summary=` method instead. " \
"(Called from: #{caller.first})"
self.summary = summary
end
@@ -80,7 +80,7 @@ module Motion; module Project
require 'motion/project/command/activate'
require 'motion/project/command/changelog'
#require 'motion/project/command/create'
#require 'motion/project/command/device_console'
require 'motion/project/command/device_console'
require 'motion/project/command/ri'
require 'motion/project/command/support'
require 'motion/project/command/update'

View File

@@ -22,15 +22,20 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
module Motion; module Project
class DeviceConsoleCommand < Command
self.name = 'device:console'
self.help = 'Print the device console logs'
class DeprecatedDeviceConsole < Command
self.command = 'device:console'
def run(args)
unless args.empty?
die "Usage: motion device:console"
end
def run
warn "[!] The usage of the `device:console` command is deprecated" \
"use the `device-console` command instead."
DeviceConsole.run([])
end
end
class DeviceConsole < Command
self.summary = 'Print iOS device logs'
def run
deploy = File.join(File.dirname(__FILE__), '../../../../bin/ios/deploy')
devices = `\"#{deploy}\" -D`.strip.split(/\n/)
if devices.empty?