From 8f7beeac380e29da0efe206bdb1a9d71196764a0 Mon Sep 17 00:00:00 2001 From: Kamil Bielawski Date: Thu, 31 Mar 2016 00:10:40 +0200 Subject: [PATCH] Added --ignore-models option for skipping models annotation --- bin/annotate | 5 +++++ lib/annotate.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/annotate b/bin/annotate index ca770c2e0..d25d000dc 100755 --- a/bin/annotate +++ b/bin/annotate @@ -128,6 +128,11 @@ OptionParser.new do |opts| ENV['root_dir'] = dir end + opts.on('--ignore-models', + "Don't annotate models") do |dir| + ENV['ignore_models'] = 'yes' + end + opts.on('--ignore-model-subdirects', "Ignore subdirectories of the models directory") do |dir| ENV['ignore_model_sub_dir'] = 'yes' diff --git a/lib/annotate.rb b/lib/annotate.rb index ec742bca0..34cb480be 100755 --- a/lib/annotate.rb +++ b/lib/annotate.rb @@ -108,7 +108,7 @@ def self.include_routes? end def self.include_models? - true + ENV['ignore_models'] !~ TRUE_RE end def self.loaded_tasks=(val)