GithubHelp home page GithubHelp logo

ivalkeen / guard-ctags-bundler Goto Github PK

View Code? Open in Web Editor NEW
108.0 2.0 24.0 364 KB

Guard gem for generating ctags for project files and gems from project's bundle.

Home Page: https://github.com/ivalkeen/guard-ctags-bundler

License: MIT License

Ruby 99.50% Java 0.50%
ruby guard ctags

guard-ctags-bundler's Introduction

Guard-CTags-Bundler

Build Status

Guard-CTags-Bundler generates ctags for your project and for gems in your bundle. For project tags file tags is generated, for gems tags file gems.tags is generated.

Features

  • Initially developed for Rails projects, but theoretically can be used with any ruby project, that uses Bundler, with minimal configuration changes.
  • When you run bundle install in your project, gems.tags file is automatically is generated or updated.
  • When you save one of you project's ruby files, tags file is automatically generated or updated.
  • Only Linux is tested, but probably will work on Mac

Install

Make sure you have Guard installed.

Install the gem:

$ gem install guard-ctags-bundler

Add it to your Gemfile (inside development group):

gem 'guard-ctags-bundler'

And then add a basic setup to your Guardfile:

$ guard init ctags-bundler

Usage

Please, read Guard usage doc

Guardfile Options

:src_path => ".", # source path to be scanned for tags (default .)
:emacs => false, # run ctags in emacs mode and merge tags and gems.tags into TAGS file
:stdlib => true, # run ctags for core and stdlib, generating stdlib.tags (default false)
:binary => 'ctags-exuberant' # name of the ctags binary (default ctags)
:arguments => '-R --languages=ruby --fields=+l' # change the arguments passed to ctags (default '-R --languages=ruby')
:stdlib_file => "stdlib.tags" # name of tags file for stdlib references (default stdlib.tags)
:bundler_tags_file => "gems.tags" # name of tags file for bundler gems references (default gems.tags)
:project_file => "tags" # name of tags file for project references (default tags)
:gemfile => "Gemfile" # name of tags file for project references (default 'Gemfile')
:silent => false # Suppress regeneration notices

For a typical Rails application, Guardfile can look like this (default):

guard 'ctags-bundler', :src_path => ["app", "lib", "spec/support"] do
  watch(/^(app|lib|spec\/support)\/.*\.rb$/)
  watch('Gemfile.lock')
end

CTags

Ctags generates an index (or tag) file of language objects found in source files that allows these items to be quickly and easily located by a text editor or other utility. A tag signifies a language object for which an index entry is available (or, alternatively, the index entry created for that object).

In ubuntu you can install ctags by running

$ sudo apt-get install exuberant-ctags

Vim

Vim supports ctags by default. All you need to do is add your gems.tags file to the Vim's tag stack.

set tags+=gems.tags

Emacs

Ctags can be used with emacs too. Add :emacs => true option to your Guardfile and ctags will be generated with -e option:

guard 'ctags-bundler', :emacs => true, :src_path => ["app", "lib", "spec/support"] do
  watch(/^(app|lib|spec\/support)\/.*\.rb$/)
  watch('Gemfile.lock')
end

Thanks to Jorge Dias and Antono Vasiljev for emacs support.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Self-Promotion

If you like this project, please follow the repository on GitHub. Also, you might consider visiting my blog and following me on Twitter and Github.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.