Sha256: 9968e5084af27d4aa141d239c0640b5913f7d842975f19111ba24a4ce62d2ddd

Contents?: true

Size: 644 Bytes

Versions: 1

Compression:

Stored size: 644 Bytes

Contents

require "thor"
require "stack_tracy"

module StackTracy
  class CLI < Thor

    default_task :open

    desc "open [PATH]", "Display StackTracy data within the browser (PATH is optional)"
    method_options [:limit, "-l"] => :numeric, [:threshold, "-t"] => :numeric
    def open(path = ".")
      StackTracy.open path, false, options.threshold, options.limit
    end

  private

    def method_missing(method, *args)
      if File.exists? File.expand_path(method.to_s)
        `tracy open #{method} #{args.join " "}`
      else
        raise Error, "Unrecognized command \"#{method}\". Please consult `tracy help`."
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stack_tracy-0.1.4 lib/stack_tracy/cli.rb