You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

notes

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

notes

0.1.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

= Notes

Stupidly grep tags in source code.

This gem provides a command line tool and a Ruby library to find tags in source code. Defaults tags are TODO, FIXME, and XXX. Custom tags can be found as well.

It's kind of a generic version of the Ruby on Rails rake notes command, for any project/source.

== Command line tool

Usage:

$ notes [options] [file...]

With no argument, notes will search recursively in the current directory. For details, see notes --help.

Examples:

$ notes
$ notes foo.h src/
$ notes --tag @@@
$ notes --no-{todo,fixme,xxx} --tag FOO

=== Integration with Git

A cool thing to do is to add a Git alias to parse every versionned files:

$ git config --global alias.n '!git ls-files | xargs notes'

Now, running git n in any Git repository will search notes in every files under version control!

=== Convention over configuration

No custom output.

It uses a grep-style display, which makes it easy to fit your needs. cut is great:

$ notes | cut -d: -f3,4-

will display TODO: /* add a cool feature / instead of the normal output foo.c:42:TODO: / add a cool feature */.

Notes won't filter.

find, xargs are your friends:

$ find . -name '*.rb' | xargs notes

Or get the list of tagged files in the current directory with:

$ notes | cut -d: -f1 | sort -u

== Installation

Notes is available on Rubygems.org[http://rubygems.org/gems/notes] and can be installed with:

$ [sudo] gem install notes

Or you can install from the source directory with:

$ rake install

== The Notes library

The Notes module provides convenient methods.

require 'notes'

Notes.scan_file("foo.c") do |note|
  puts "#{note.tag} found at line #{note.line}!"
end

Notes can also extend an object to add a new method (see Notes#notes), or allow you to create your own scanner (see the Notes::Scanner).

For usage example of the library, you can have a look at the really basic {Notes plugin}[http://github.com/vivien/redmine_notes] for Redmine, at: http://github.com/vivien/redmine_notes

== License

That's free and friendly for sure! See the LICENSE file.

FAQs

Package last updated on 17 Sep 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts