#!/usr/bin/env ruby require 'commander/import' require 'Hokkaido' puts "Hokkaido v#{Hokkaido::VERSION} codename Northern Sea Circuit" #.colorize(:yellow) program :name, "Hokkaido" program :version, '0.0.1' program :description, 'Gem port tool for RubyMotion' command :port do |c| c.syntax = "Usage: Hokkaido port " 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 Hokkaido.valid_input?(args) puts "Init Lib: #{args[1]}" puts "Gem name: #{args[0]}" say "Lib folder: #{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 port " 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]) say Hokkaido.self_test_result(Hokkaido::Port.new(args, options)) else say "File not found." end end end