bin/Hokkaido in Hokkaido-0.0.2 vs bin/Hokkaido in Hokkaido-0.0.3

- old
+ new

@@ -6,30 +6,33 @@ program :name, "Hokkaido" program :version, '0.0.1' program :description, 'Gem port tool for RubyMotion' command :port do |c| - c.syntax = "Usage: Hokkaido port <gem_name> <init_file> <lib_dir>" + c.syntax = "Usage: Hokkaido port <gem_name> <init_filename> <lib_dir>" c.description = 'Attempts to port the gem. This will modify the files!' c.option '--sim', TrueClass, 'Does not edit the gem files. Good for hacking Hokkaido' c.action do |args, options| - if File.exists?(args[1]) && File.directory?(args[2]) && args[0].size > 1 + if Hokkaido.valid_input?(args) puts "Init Lib:".colorize(:blue)+" #{args[1]}" puts "Gem name:".colorize(:blue)+" #{args[0]}" say "Lib folder:".colorize(:blue)+" #{args[2]}" port = Hokkaido::Port.new(args, options) + port.modify + say "Gem modification complete. It will now be tested.".colorize(:yellow) + say Hokkaido.self_test_result(port) else say "I can't process that." end end end command :test do |c| - c.syntax = "Usage: Hokkaido test <init_file>" - c.description = 'Attempts to test the gem with a mocked RubyMotion.' + c.syntax = "Usage: Hokkaido port <gem_name> <lib_dir> <init_filename> " + c.description = 'Test a gem with a mocked RubyMotion to see if it passes.' c.action do |args, options| if args[0] && File.exists?(args[0]) - Hokkaido::Port.test(args[0]) + say Hokkaido.self_test_result(Hokkaido::Port.new(args, options)) else say "File not found." end end end