Sha256: 1b305234c4bcd025d853cbc2d5686c5c8290928643c0b69a5d09bc72d7abf855

Contents?: true

Size: 595 Bytes

Versions: 3

Compression:

Stored size: 595 Bytes

Contents

#!/usr/bin/env ruby

require 'optparse'
require 'annotate'

task = :annotate_models

OptionParser.new do |opts|
  opts.banner = "Usage: annotate [options]"
  opts.on('-d', '--delete') { task = :remove_annotation }
  opts.on('-p', '--position [before|after]', ['before', 'after']) { |p| ENV['position'] = p }
  opts.on('-r', '--routes') { task = :annotate_routes }
  opts.on('-v', '--version') { puts "Annotate v#{Annotate::VERSION}"; exit }
end.parse!

begin
  Rake::Task[task].invoke
  #TODO: rescue only rake error
rescue NameError => e
  puts "Can`t find Rake. Are we in a Rails folder?"
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
IPGlider-annotate-2.2.6 bin/annotate
IPGlider-annotate-2.2.7 bin/annotate
nofxx-annotate-2.2.5 bin/annotate