Sha256: 6419aee0cb628b9ee903498954903a0cfc901aed0025be73007592d7025dd871

Contents?: true

Size: 684 Bytes

Versions: 5

Compression:

Stored size: 684 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, [:messages_only, "-m"] => :false, [:slows_only, "-s"] => :false
    def open(path = ".")
      StackTracy.open path, false, options
    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

5 entries across 5 versions & 1 rubygems

Version Path
stack_tracy-0.1.9 lib/stack_tracy/cli.rb
stack_tracy-0.1.8 lib/stack_tracy/cli.rb
stack_tracy-0.1.7 lib/stack_tracy/cli.rb
stack_tracy-0.1.6 lib/stack_tracy/cli.rb
stack_tracy-0.1.5 lib/stack_tracy/cli.rb