Sha256: 8e4e2e7948cb5b16ed79e58d84059c6f9cae2770c44c7066364a93c7467e3481

Contents?: true

Size: 642 Bytes

Versions: 6

Compression:

Stored size: 642 Bytes

Contents

module Overcommit::Hook::PostCheckout
  # Scans source code each time HEAD changes to generate an up-to-date index of
  # all function/variable definitions, etc.
  class IndexTags < Base
    def run
      unless in_path?('ctags')
        return :pass # Silently ignore
      end

      index_tags_in_background

      :pass
    end

    private

    SCRIPT_LOCATION = Overcommit::Utils.script_path('index-tags')

    def index_tags_in_background
      ctags_args = config['ctags_arguments']

      # TODO: come up with Ruby 1.8-friendly way to do this
      Process.detach(Process.spawn("#{SCRIPT_LOCATION} #{ctags_args}"))
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
overcommit-0.22.0 lib/overcommit/hook/post_checkout/index_tags.rb
jawshooah-overcommit-0.22.0 lib/overcommit/hook/post_checkout/index_tags.rb
overcommit-0.21.0 lib/overcommit/hook/post_checkout/index_tags.rb
overcommit-0.20.0 lib/overcommit/hook/post_checkout/index_tags.rb
overcommit-0.19.0 lib/overcommit/hook/post_checkout/index_tags.rb
overcommit-0.18.0 lib/overcommit/hook/post_checkout/index_tags.rb