Sha256: 12847cdfa7a8aefcc6e557b428a9386cc0c51c5899f9e56c92b8b2de4e8ddfe3

Contents?: true

Size: 1.33 KB

Versions: 4

Compression:

Stored size: 1.33 KB

Contents

#!/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 <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 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 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])
      say Hokkaido.self_test_result(Hokkaido::Port.new(args, options))
    else
      say "File not found."
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
Hokkaido-0.0.6 bin/Hokkaido
Hokkaido-0.0.5 bin/Hokkaido
Hokkaido-0.0.4 bin/Hokkaido
Hokkaido-0.0.3 bin/Hokkaido