Sha256: 5de1d9175a956d0d0469269568c646f3d29e17613faad32cd8a89bd4692a98ec

Contents?: true

Size: 813 Bytes

Versions: 3

Compression:

Stored size: 813 Bytes

Contents

#!/usr/bin/env ruby

unless File.exist?('./Rakefile') || File.exist?('./Gemfile')
  abort 'Please run annotate from the root of the project.'
end

require 'rubygems'
begin
  require 'bundler'
  Bundler.setup
rescue StandardError
end

here = File.expand_path(File.dirname __FILE__)
$LOAD_PATH << "#{here}/../lib"

require 'annotate'
require 'annotate/parser'

Annotate.bootstrap_rake

options_result = Annotate::Parser.parse(ARGV)

exit if options_result[:exit]

options = Annotate.setup_options(
  is_rake: ENV['is_rake'] && !ENV['is_rake'].empty?
)
Annotate.eager_load(options) if Annotate::Helpers.include_models?

AnnotateModels.send(options_result[:target_action], options) if Annotate::Helpers.include_models?
AnnotateRoutes.send(options_result[:target_action], options) if Annotate::Helpers.include_routes?

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
annotate-3.2.0 bin/annotate
annotate-3.1.1 bin/annotate
annotate-3.1.0 bin/annotate