annotate 2.7.4 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,30 @@
1
+ module Annotate
2
+ # Class for holding helper methods. Done to make lib/annotate.rb less bloated.
3
+ class Helpers
4
+ class << self
5
+ def skip_on_migration?
6
+ ENV['ANNOTATE_SKIP_ON_DB_MIGRATE'] =~ Constants::TRUE_RE || ENV['skip_on_db_migrate'] =~ Constants::TRUE_RE
7
+ end
8
+
9
+ def include_routes?
10
+ ENV['routes'] =~ Constants::TRUE_RE
11
+ end
12
+
13
+ def include_models?
14
+ ENV['models'] =~ Constants::TRUE_RE
15
+ end
16
+
17
+ def true?(val)
18
+ val.present? && Constants::TRUE_RE.match?(val)
19
+ end
20
+
21
+ def fallback(*args)
22
+ args.detect(&:present?)
23
+ end
24
+
25
+ def reset_options(options)
26
+ options.flatten.each { |key| ENV[key.to_s] = nil }
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,303 @@
1
+ require 'optparse'
2
+
3
+ module Annotate
4
+ # Class for handling command line arguments
5
+ class Parser # rubocop:disable Metrics/ClassLength
6
+ def self.parse(args, env = {})
7
+ new(args, env).parse
8
+ end
9
+
10
+ attr_reader :args, :options, :env
11
+
12
+ DEFAULT_OPTIONS = {
13
+ target_action: :do_annotations,
14
+ exit: false
15
+ }.freeze
16
+
17
+ ANNOTATION_POSITIONS = %w[before top after bottom].freeze
18
+ FILE_TYPE_POSITIONS = %w[position_in_class position_in_factory position_in_fixture position_in_test position_in_routes position_in_serializer].freeze
19
+ EXCLUSION_LIST = %w[tests fixtures factories serializers].freeze
20
+ FORMAT_TYPES = %w[bare rdoc yard markdown].freeze
21
+
22
+ def initialize(args, env)
23
+ @args = args
24
+ @options = DEFAULT_OPTIONS.dup
25
+ @env = env
26
+ end
27
+
28
+ def parse
29
+ # To split up because right now this method parses and commits
30
+ parser.parse!(args)
31
+
32
+ commit
33
+
34
+ options
35
+ end
36
+
37
+ private
38
+
39
+ def parser
40
+ OptionParser.new do |option_parser|
41
+ add_options_to_parser(option_parser)
42
+ end
43
+ end
44
+
45
+ def commit
46
+ env.each_pair do |key, value|
47
+ ENV[key] = value
48
+ end
49
+ end
50
+
51
+ def add_options_to_parser(option_parser) # rubocop:disable Metrics/MethodLength
52
+ has_set_position = {}
53
+
54
+ option_parser.banner = 'Usage: annotate [options] [model_file]*'
55
+
56
+ option_parser.on('--additional-file-patterns path1,path2,path3',
57
+ Array,
58
+ "Additional file paths or globs to annotate, separated by commas (e.g. `/foo/bar/%model_name%/*.rb,/baz/%model_name%.rb`)") do |additional_file_patterns|
59
+ ENV['additional_file_patterns'] = additional_file_patterns
60
+ end
61
+
62
+ option_parser.on('-d',
63
+ '--delete',
64
+ 'Remove annotations from all model files or the routes.rb file') do
65
+ @options[:target_action] = :remove_annotations
66
+ end
67
+
68
+ option_parser.on('-p',
69
+ '--position [before|top|after|bottom]',
70
+ ANNOTATION_POSITIONS,
71
+ 'Place the annotations at the top (before) or the bottom (after) of the model/test/fixture/factory/route/serializer file(s)') do |position|
72
+ env['position'] = position
73
+
74
+ FILE_TYPE_POSITIONS.each do |key|
75
+ env[key] = position unless has_set_position[key]
76
+ end
77
+ end
78
+
79
+ option_parser.on('--pc',
80
+ '--position-in-class [before|top|after|bottom]',
81
+ ANNOTATION_POSITIONS,
82
+ 'Place the annotations at the top (before) or the bottom (after) of the model file') do |position_in_class|
83
+ env['position_in_class'] = position_in_class
84
+ has_set_position['position_in_class'] = true
85
+ end
86
+
87
+ option_parser.on('--pf',
88
+ '--position-in-factory [before|top|after|bottom]',
89
+ ANNOTATION_POSITIONS,
90
+ 'Place the annotations at the top (before) or the bottom (after) of any factory files') do |position_in_factory|
91
+ env['position_in_factory'] = position_in_factory
92
+ has_set_position['position_in_factory'] = true
93
+ end
94
+
95
+ option_parser.on('--px',
96
+ '--position-in-fixture [before|top|after|bottom]',
97
+ ANNOTATION_POSITIONS,
98
+ 'Place the annotations at the top (before) or the bottom (after) of any fixture files') do |position_in_fixture|
99
+ env['position_in_fixture'] = position_in_fixture
100
+ has_set_position['position_in_fixture'] = true
101
+ end
102
+
103
+ option_parser.on('--pt',
104
+ '--position-in-test [before|top|after|bottom]',
105
+ ANNOTATION_POSITIONS,
106
+ 'Place the annotations at the top (before) or the bottom (after) of any test files') do |position_in_test|
107
+ env['position_in_test'] = position_in_test
108
+ has_set_position['position_in_test'] = true
109
+ end
110
+
111
+ option_parser.on('--pr',
112
+ '--position-in-routes [before|top|after|bottom]',
113
+ ANNOTATION_POSITIONS,
114
+ 'Place the annotations at the top (before) or the bottom (after) of the routes.rb file') do |position_in_routes|
115
+ env['position_in_routes'] = position_in_routes
116
+ has_set_position['position_in_routes'] = true
117
+ end
118
+
119
+ option_parser.on('--ps',
120
+ '--position-in-serializer [before|top|after|bottom]',
121
+ ANNOTATION_POSITIONS,
122
+ 'Place the annotations at the top (before) or the bottom (after) of the serializer files') do |position_in_serializer|
123
+ env['position_in_serializer'] = position_in_serializer
124
+ has_set_position['position_in_serializer'] = true
125
+ end
126
+
127
+ option_parser.on('--w',
128
+ '--wrapper STR',
129
+ 'Wrap annotation with the text passed as parameter.',
130
+ 'If --w option is used, the same text will be used as opening and closing') do |wrapper|
131
+ env['wrapper'] = wrapper
132
+ end
133
+
134
+ option_parser.on('--wo',
135
+ '--wrapper-open STR',
136
+ 'Annotation wrapper opening.') do |wrapper_open|
137
+ env['wrapper_open'] = wrapper_open
138
+ end
139
+
140
+ option_parser.on('--wc',
141
+ '--wrapper-close STR',
142
+ 'Annotation wrapper closing') do |wrapper_close|
143
+ env['wrapper_close'] = wrapper_close
144
+ end
145
+
146
+ option_parser.on('-r',
147
+ '--routes',
148
+ "Annotate routes.rb with the output of 'rake routes'") do
149
+ env['routes'] = 'true'
150
+ end
151
+
152
+ option_parser.on('--models',
153
+ "Annotate ActiveRecord models") do
154
+ env['models'] = 'true'
155
+ end
156
+
157
+ option_parser.on('-a',
158
+ '--active-admin',
159
+ 'Annotate active_admin models') do
160
+ env['active_admin'] = 'true'
161
+ end
162
+
163
+ option_parser.on('-v',
164
+ '--version',
165
+ 'Show the current version of this gem') do
166
+ puts "annotate v#{Annotate.version}"
167
+ @options[:exit] = true
168
+ end
169
+
170
+ option_parser.on('-m',
171
+ '--show-migration',
172
+ 'Include the migration version number in the annotation') do
173
+ env['include_version'] = 'yes'
174
+ end
175
+
176
+ option_parser.on('-k',
177
+ '--show-foreign-keys',
178
+ "List the table's foreign key constraints in the annotation") do
179
+ env['show_foreign_keys'] = 'yes'
180
+ end
181
+
182
+ option_parser.on('--ck',
183
+ '--complete-foreign-keys',
184
+ 'Complete foreign key names in the annotation') do
185
+ env['show_foreign_keys'] = 'yes'
186
+ env['show_complete_foreign_keys'] = 'yes'
187
+ end
188
+
189
+ option_parser.on('-i',
190
+ '--show-indexes',
191
+ "List the table's database indexes in the annotation") do
192
+ env['show_indexes'] = 'yes'
193
+ end
194
+
195
+ option_parser.on('-s',
196
+ '--simple-indexes',
197
+ "Concat the column's related indexes in the annotation") do
198
+ env['simple_indexes'] = 'yes'
199
+ end
200
+
201
+ option_parser.on('--model-dir dir',
202
+ "Annotate model files stored in dir rather than app/models, separate multiple dirs with commas") do |dir|
203
+ env['model_dir'] = dir
204
+ end
205
+
206
+ option_parser.on('--root-dir dir',
207
+ "Annotate files stored within root dir projects, separate multiple dirs with commas") do |dir|
208
+ env['root_dir'] = dir
209
+ end
210
+
211
+ option_parser.on('--ignore-model-subdirects',
212
+ "Ignore subdirectories of the models directory") do
213
+ env['ignore_model_sub_dir'] = 'yes'
214
+ end
215
+
216
+ option_parser.on('--sort',
217
+ "Sort columns alphabetically, rather than in creation order") do
218
+ env['sort'] = 'yes'
219
+ end
220
+
221
+ option_parser.on('--classified-sort',
222
+ "Sort columns alphabetically, but first goes id, then the rest columns, then the timestamp columns and then the association columns") do
223
+ env['classified_sort'] = 'yes'
224
+ end
225
+
226
+ option_parser.on('-R',
227
+ '--require path',
228
+ "Additional file to require before loading models, may be used multiple times") do |path|
229
+ env['require'] = if env['require'].present?
230
+ "#{env['require']},#{path}"
231
+ else
232
+ path
233
+ end
234
+ end
235
+
236
+ option_parser.on('-e',
237
+ '--exclude [tests,fixtures,factories,serializers]',
238
+ Array,
239
+ "Do not annotate fixtures, test files, factories, and/or serializers") do |exclusions|
240
+ exclusions ||= EXCLUSION_LIST
241
+ exclusions.each { |exclusion| env["exclude_#{exclusion}"] = 'yes' }
242
+ end
243
+
244
+ option_parser.on('-f',
245
+ '--format [bare|rdoc|yard|markdown]',
246
+ FORMAT_TYPES,
247
+ 'Render Schema Infomation as plain/RDoc/Yard/Markdown') do |format_type|
248
+ env["format_#{format_type}"] = 'yes'
249
+ end
250
+
251
+ option_parser.on('--force',
252
+ 'Force new annotations even if there are no changes.') do
253
+ env['force'] = 'yes'
254
+ end
255
+
256
+ option_parser.on('--frozen',
257
+ 'Do not allow to change annotations. Exits non-zero if there are going to be changes to files.') do
258
+ env['frozen'] = 'yes'
259
+ end
260
+
261
+ option_parser.on('--timestamp',
262
+ 'Include timestamp in (routes) annotation') do
263
+ env['timestamp'] = 'true'
264
+ end
265
+
266
+ option_parser.on('--trace',
267
+ 'If unable to annotate a file, print the full stack trace, not just the exception message.') do
268
+ env['trace'] = 'yes'
269
+ end
270
+
271
+ option_parser.on('-I',
272
+ '--ignore-columns REGEX',
273
+ "don't annotate columns that match a given REGEX (i.e., `annotate -I '^(id|updated_at|created_at)'`") do |regex|
274
+ env['ignore_columns'] = regex
275
+ end
276
+
277
+ option_parser.on('--ignore-routes REGEX',
278
+ "don't annotate routes that match a given REGEX (i.e., `annotate -I '(mobile|resque|pghero)'`") do |regex|
279
+ env['ignore_routes'] = regex
280
+ end
281
+
282
+ option_parser.on('--hide-limit-column-types VALUES',
283
+ "don't show limit for given column types, separated by commas (i.e., `integer,boolean,text`)") do |values|
284
+ env['hide_limit_column_types'] = values.to_s
285
+ end
286
+
287
+ option_parser.on('--hide-default-column-types VALUES',
288
+ "don't show default for given column types, separated by commas (i.e., `json,jsonb,hstore`)") do |values|
289
+ env['hide_default_column_types'] = values.to_s
290
+ end
291
+
292
+ option_parser.on('--ignore-unknown-models',
293
+ "don't display warnings for bad model files") do
294
+ env['ignore_unknown_models'] = 'true'
295
+ end
296
+
297
+ option_parser.on('--with-comment',
298
+ "include database comments in model annotations") do
299
+ env['with_comment'] = 'true'
300
+ end
301
+ end
302
+ end
303
+ end
@@ -1,5 +1,5 @@
1
1
  module Annotate
2
2
  def self.version
3
- '2.7.4'
3
+ '3.1.1'
4
4
  end
5
5
  end
@@ -7,46 +7,51 @@ if Rails.env.development?
7
7
  # You can override any of these by setting an environment variable of the
8
8
  # same name.
9
9
  Annotate.set_defaults(
10
- 'routes' => 'false',
11
- 'position_in_routes' => 'before',
12
- 'position_in_class' => 'before',
13
- 'position_in_test' => 'before',
14
- 'position_in_fixture' => 'before',
15
- 'position_in_factory' => 'before',
16
- 'position_in_serializer' => 'before',
17
- 'show_foreign_keys' => 'true',
18
- 'show_complete_foreign_keys' => 'false',
19
- 'show_indexes' => 'true',
20
- 'simple_indexes' => 'false',
21
- 'model_dir' => 'app/models',
22
- 'root_dir' => '',
23
- 'include_version' => 'false',
24
- 'require' => '',
25
- 'exclude_tests' => 'false',
26
- 'exclude_fixtures' => 'false',
27
- 'exclude_factories' => 'false',
28
- 'exclude_serializers' => 'false',
29
- 'exclude_scaffolds' => 'true',
30
- 'exclude_controllers' => 'true',
31
- 'exclude_helpers' => 'true',
32
- 'exclude_sti_subclasses' => 'false',
33
- 'ignore_model_sub_dir' => 'false',
34
- 'ignore_columns' => nil,
35
- 'ignore_routes' => nil,
36
- 'ignore_unknown_models' => 'false',
37
- 'hide_limit_column_types' => '<%= AnnotateModels::NO_LIMIT_COL_TYPES.join(",") %>',
38
- 'hide_default_column_types' => '<%= AnnotateModels::NO_DEFAULT_COL_TYPES.join(",") %>',
39
- 'skip_on_db_migrate' => 'false',
40
- 'format_bare' => 'true',
41
- 'format_rdoc' => 'false',
42
- 'format_markdown' => 'false',
43
- 'sort' => 'false',
44
- 'force' => 'false',
45
- 'classified_sort' => 'true',
46
- 'trace' => 'false',
47
- 'wrapper_open' => nil,
48
- 'wrapper_close' => nil,
49
- 'with_comment' => true
10
+ 'active_admin' => 'false',
11
+ 'additional_file_patterns' => [],
12
+ 'routes' => 'false',
13
+ 'models' => 'true',
14
+ 'position_in_routes' => 'before',
15
+ 'position_in_class' => 'before',
16
+ 'position_in_test' => 'before',
17
+ 'position_in_fixture' => 'before',
18
+ 'position_in_factory' => 'before',
19
+ 'position_in_serializer' => 'before',
20
+ 'show_foreign_keys' => 'true',
21
+ 'show_complete_foreign_keys' => 'false',
22
+ 'show_indexes' => 'true',
23
+ 'simple_indexes' => 'false',
24
+ 'model_dir' => 'app/models',
25
+ 'root_dir' => '',
26
+ 'include_version' => 'false',
27
+ 'require' => '',
28
+ 'exclude_tests' => 'false',
29
+ 'exclude_fixtures' => 'false',
30
+ 'exclude_factories' => 'false',
31
+ 'exclude_serializers' => 'false',
32
+ 'exclude_scaffolds' => 'true',
33
+ 'exclude_controllers' => 'true',
34
+ 'exclude_helpers' => 'true',
35
+ 'exclude_sti_subclasses' => 'false',
36
+ 'ignore_model_sub_dir' => 'false',
37
+ 'ignore_columns' => nil,
38
+ 'ignore_routes' => nil,
39
+ 'ignore_unknown_models' => 'false',
40
+ 'hide_limit_column_types' => '<%= AnnotateModels::NO_LIMIT_COL_TYPES.join(",") %>',
41
+ 'hide_default_column_types' => '<%= AnnotateModels::NO_DEFAULT_COL_TYPES.join(",") %>',
42
+ 'skip_on_db_migrate' => 'false',
43
+ 'format_bare' => 'true',
44
+ 'format_rdoc' => 'false',
45
+ 'format_yard' => 'false',
46
+ 'format_markdown' => 'false',
47
+ 'sort' => 'false',
48
+ 'force' => 'false',
49
+ 'frozen' => 'false',
50
+ 'classified_sort' => 'true',
51
+ 'trace' => 'false',
52
+ 'wrapper_open' => nil,
53
+ 'wrapper_close' => nil,
54
+ 'with_comment' => 'true'
50
55
  )
51
56
  end
52
57
 
@@ -11,43 +11,47 @@ task annotate_models: :environment do
11
11
  require "#{annotate_lib}/annotate/active_record_patch"
12
12
 
13
13
  options = {is_rake: true}
14
- ENV['position'] = options[:position] = Annotate.fallback(ENV['position'], 'before')
15
- options[:position_in_class] = Annotate.fallback(ENV['position_in_class'], ENV['position'])
16
- options[:position_in_fixture] = Annotate.fallback(ENV['position_in_fixture'], ENV['position'])
17
- options[:position_in_factory] = Annotate.fallback(ENV['position_in_factory'], ENV['position'])
18
- options[:position_in_test] = Annotate.fallback(ENV['position_in_test'], ENV['position'])
19
- options[:position_in_serializer] = Annotate.fallback(ENV['position_in_serializer'], ENV['position'])
20
- options[:show_foreign_keys] = Annotate.true?(ENV['show_foreign_keys'])
21
- options[:show_complete_foreign_keys] = Annotate.true?(ENV['show_complete_foreign_keys'])
22
- options[:show_indexes] = Annotate.true?(ENV['show_indexes'])
23
- options[:simple_indexes] = Annotate.true?(ENV['simple_indexes'])
14
+ ENV['position'] = options[:position] = Annotate::Helpers.fallback(ENV['position'], 'before')
15
+ options[:additional_file_patterns] = ENV['additional_file_patterns'] ? ENV['additional_file_patterns'].split(',') : []
16
+ options[:position_in_class] = Annotate::Helpers.fallback(ENV['position_in_class'], ENV['position'])
17
+ options[:position_in_fixture] = Annotate::Helpers.fallback(ENV['position_in_fixture'], ENV['position'])
18
+ options[:position_in_factory] = Annotate::Helpers.fallback(ENV['position_in_factory'], ENV['position'])
19
+ options[:position_in_test] = Annotate::Helpers.fallback(ENV['position_in_test'], ENV['position'])
20
+ options[:position_in_serializer] = Annotate::Helpers.fallback(ENV['position_in_serializer'], ENV['position'])
21
+ options[:show_foreign_keys] = Annotate::Helpers.true?(ENV['show_foreign_keys'])
22
+ options[:show_complete_foreign_keys] = Annotate::Helpers.true?(ENV['show_complete_foreign_keys'])
23
+ options[:show_indexes] = Annotate::Helpers.true?(ENV['show_indexes'])
24
+ options[:simple_indexes] = Annotate::Helpers.true?(ENV['simple_indexes'])
24
25
  options[:model_dir] = ENV['model_dir'] ? ENV['model_dir'].split(',') : ['app/models']
25
26
  options[:root_dir] = ENV['root_dir']
26
- options[:include_version] = Annotate.true?(ENV['include_version'])
27
+ options[:include_version] = Annotate::Helpers.true?(ENV['include_version'])
27
28
  options[:require] = ENV['require'] ? ENV['require'].split(',') : []
28
- options[:exclude_tests] = Annotate.true?(ENV['exclude_tests'])
29
- options[:exclude_factories] = Annotate.true?(ENV['exclude_factories'])
30
- options[:exclude_fixtures] = Annotate.true?(ENV['exclude_fixtures'])
31
- options[:exclude_serializers] = Annotate.true?(ENV['exclude_serializers'])
32
- options[:exclude_scaffolds] = Annotate.true?(ENV['exclude_scaffolds'])
33
- options[:exclude_controllers] = Annotate.true?(ENV.fetch('exclude_controllers', 'true'))
34
- options[:exclude_helpers] = Annotate.true?(ENV.fetch('exclude_helpers', 'true'))
35
- options[:exclude_sti_subclasses] = Annotate.true?(ENV['exclude_sti_subclasses'])
36
- options[:ignore_model_sub_dir] = Annotate.true?(ENV['ignore_model_sub_dir'])
37
- options[:format_bare] = Annotate.true?(ENV['format_bare'])
38
- options[:format_rdoc] = Annotate.true?(ENV['format_rdoc'])
39
- options[:format_markdown] = Annotate.true?(ENV['format_markdown'])
40
- options[:sort] = Annotate.true?(ENV['sort'])
41
- options[:force] = Annotate.true?(ENV['force'])
42
- options[:classified_sort] = Annotate.true?(ENV['classified_sort'])
43
- options[:trace] = Annotate.true?(ENV['trace'])
44
- options[:wrapper_open] = Annotate.fallback(ENV['wrapper_open'], ENV['wrapper'])
45
- options[:wrapper_close] = Annotate.fallback(ENV['wrapper_close'], ENV['wrapper'])
29
+ options[:exclude_tests] = Annotate::Helpers.true?(ENV['exclude_tests'])
30
+ options[:exclude_factories] = Annotate::Helpers.true?(ENV['exclude_factories'])
31
+ options[:exclude_fixtures] = Annotate::Helpers.true?(ENV['exclude_fixtures'])
32
+ options[:exclude_serializers] = Annotate::Helpers.true?(ENV['exclude_serializers'])
33
+ options[:exclude_scaffolds] = Annotate::Helpers.true?(ENV['exclude_scaffolds'])
34
+ options[:exclude_controllers] = Annotate::Helpers.true?(ENV.fetch('exclude_controllers', 'true'))
35
+ options[:exclude_helpers] = Annotate::Helpers.true?(ENV.fetch('exclude_helpers', 'true'))
36
+ options[:exclude_sti_subclasses] = Annotate::Helpers.true?(ENV['exclude_sti_subclasses'])
37
+ options[:ignore_model_sub_dir] = Annotate::Helpers.true?(ENV['ignore_model_sub_dir'])
38
+ options[:format_bare] = Annotate::Helpers.true?(ENV['format_bare'])
39
+ options[:format_rdoc] = Annotate::Helpers.true?(ENV['format_rdoc'])
40
+ options[:format_yard] = Annotate::Helpers.true?(ENV['format_yard'])
41
+ options[:format_markdown] = Annotate::Helpers.true?(ENV['format_markdown'])
42
+ options[:sort] = Annotate::Helpers.true?(ENV['sort'])
43
+ options[:force] = Annotate::Helpers.true?(ENV['force'])
44
+ options[:frozen] = Annotate::Helpers.true?(ENV['frozen'])
45
+ options[:classified_sort] = Annotate::Helpers.true?(ENV['classified_sort'])
46
+ options[:trace] = Annotate::Helpers.true?(ENV['trace'])
47
+ options[:wrapper_open] = Annotate::Helpers.fallback(ENV['wrapper_open'], ENV['wrapper'])
48
+ options[:wrapper_close] = Annotate::Helpers.fallback(ENV['wrapper_close'], ENV['wrapper'])
46
49
  options[:ignore_columns] = ENV.fetch('ignore_columns', nil)
47
50
  options[:ignore_routes] = ENV.fetch('ignore_routes', nil)
48
- options[:hide_limit_column_types] = Annotate.fallback(ENV['hide_limit_column_types'], '')
49
- options[:hide_default_column_types] = Annotate.fallback(ENV['hide_default_column_types'], '')
50
- options[:with_comment] = Annotate.true?(ENV['with_comment'])
51
+ options[:hide_limit_column_types] = Annotate::Helpers.fallback(ENV['hide_limit_column_types'], '')
52
+ options[:hide_default_column_types] = Annotate::Helpers.fallback(ENV['hide_default_column_types'], '')
53
+ options[:with_comment] = Annotate::Helpers.true?(ENV['with_comment'])
54
+ options[:ignore_unknown_models] = Annotate::Helpers.true?(ENV.fetch('ignore_unknown_models', 'false'))
51
55
 
52
56
  AnnotateModels.do_annotations(options)
53
57
  end
@@ -61,6 +65,6 @@ task remove_annotation: :environment do
61
65
  options[:model_dir] = ENV['model_dir']
62
66
  options[:root_dir] = ENV['root_dir']
63
67
  options[:require] = ENV['require'] ? ENV['require'].split(',') : []
64
- options[:trace] = Annotate.true?(ENV['trace'])
68
+ options[:trace] = Annotate::Helpers.true?(ENV['trace'])
65
69
  AnnotateModels.remove_annotations(options)
66
70
  end