@@ -11,46 +11,46 @@ 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' )
14
+ ENV [ 'position' ] = options [ :position ] = Annotate :: Helpers . fallback ( ENV [ 'position' ] , 'before' )
15
15
options [ :additional_file_patterns ] = ENV [ 'additional_file_patterns' ] ? ENV [ 'additional_file_patterns' ] . split ( ',' ) : [ ]
16
- options [ :position_in_class ] = Annotate . fallback ( ENV [ 'position_in_class' ] , ENV [ 'position' ] )
17
- options [ :position_in_fixture ] = Annotate . fallback ( ENV [ 'position_in_fixture' ] , ENV [ 'position' ] )
18
- options [ :position_in_factory ] = Annotate . fallback ( ENV [ 'position_in_factory' ] , ENV [ 'position' ] )
19
- options [ :position_in_test ] = Annotate . fallback ( ENV [ 'position_in_test' ] , ENV [ 'position' ] )
20
- options [ :position_in_serializer ] = Annotate . fallback ( ENV [ 'position_in_serializer' ] , ENV [ 'position' ] )
21
- options [ :show_foreign_keys ] = Annotate . true? ( ENV [ 'show_foreign_keys' ] )
22
- options [ :show_complete_foreign_keys ] = Annotate . true? ( ENV [ 'show_complete_foreign_keys' ] )
23
- options [ :show_indexes ] = Annotate . true? ( ENV [ 'show_indexes' ] )
24
- options [ :simple_indexes ] = Annotate . true? ( ENV [ 'simple_indexes' ] )
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' ] )
25
25
options [ :model_dir ] = ENV [ 'model_dir' ] ? ENV [ 'model_dir' ] . split ( ',' ) : [ 'app/models' ]
26
26
options [ :root_dir ] = ENV [ 'root_dir' ]
27
- options [ :include_version ] = Annotate . true? ( ENV [ 'include_version' ] )
27
+ options [ :include_version ] = Annotate :: Helpers . true? ( ENV [ 'include_version' ] )
28
28
options [ :require ] = ENV [ 'require' ] ? ENV [ 'require' ] . split ( ',' ) : [ ]
29
- options [ :exclude_tests ] = Annotate . true? ( ENV [ 'exclude_tests' ] )
30
- options [ :exclude_factories ] = Annotate . true? ( ENV [ 'exclude_factories' ] )
31
- options [ :exclude_fixtures ] = Annotate . true? ( ENV [ 'exclude_fixtures' ] )
32
- options [ :exclude_serializers ] = Annotate . true? ( ENV [ 'exclude_serializers' ] )
33
- options [ :exclude_scaffolds ] = Annotate . true? ( ENV [ 'exclude_scaffolds' ] )
34
- options [ :exclude_controllers ] = Annotate . true? ( ENV . fetch ( 'exclude_controllers' , 'true' ) )
35
- options [ :exclude_helpers ] = Annotate . true? ( ENV . fetch ( 'exclude_helpers' , 'true' ) )
36
- options [ :exclude_sti_subclasses ] = Annotate . true? ( ENV [ 'exclude_sti_subclasses' ] )
37
- options [ :ignore_model_sub_dir ] = Annotate . true? ( ENV [ 'ignore_model_sub_dir' ] )
38
- options [ :format_bare ] = Annotate . true? ( ENV [ 'format_bare' ] )
39
- options [ :format_rdoc ] = Annotate . true? ( ENV [ 'format_rdoc' ] )
40
- options [ :format_markdown ] = Annotate . true? ( ENV [ 'format_markdown' ] )
41
- options [ :sort ] = Annotate . true? ( ENV [ 'sort' ] )
42
- options [ :force ] = Annotate . true? ( ENV [ 'force' ] )
43
- options [ :frozen ] = Annotate . true? ( ENV [ 'frozen' ] )
44
- options [ :classified_sort ] = Annotate . true? ( ENV [ 'classified_sort' ] )
45
- options [ :trace ] = Annotate . true? ( ENV [ 'trace' ] )
46
- options [ :wrapper_open ] = Annotate . fallback ( ENV [ 'wrapper_open' ] , ENV [ 'wrapper' ] )
47
- 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_markdown ] = Annotate :: Helpers . true? ( ENV [ 'format_markdown' ] )
41
+ options [ :sort ] = Annotate :: Helpers . true? ( ENV [ 'sort' ] )
42
+ options [ :force ] = Annotate :: Helpers . true? ( ENV [ 'force' ] )
43
+ options [ :frozen ] = Annotate :: Helpers . true? ( ENV [ 'frozen' ] )
44
+ options [ :classified_sort ] = Annotate :: Helpers . true? ( ENV [ 'classified_sort' ] )
45
+ options [ :trace ] = Annotate :: Helpers . true? ( ENV [ 'trace' ] )
46
+ options [ :wrapper_open ] = Annotate :: Helpers . fallback ( ENV [ 'wrapper_open' ] , ENV [ 'wrapper' ] )
47
+ options [ :wrapper_close ] = Annotate :: Helpers . fallback ( ENV [ 'wrapper_close' ] , ENV [ 'wrapper' ] )
48
48
options [ :ignore_columns ] = ENV . fetch ( 'ignore_columns' , nil )
49
49
options [ :ignore_routes ] = ENV . fetch ( 'ignore_routes' , nil )
50
- options [ :hide_limit_column_types ] = Annotate . fallback ( ENV [ 'hide_limit_column_types' ] , '' )
51
- options [ :hide_default_column_types ] = Annotate . fallback ( ENV [ 'hide_default_column_types' ] , '' )
52
- options [ :with_comment ] = Annotate . true? ( ENV [ 'with_comment' ] )
53
- options [ :ignore_unknown_models ] = Annotate . true? ( ENV . fetch ( 'ignore_unknown_models' , 'false' ) )
50
+ options [ :hide_limit_column_types ] = Annotate :: Helpers . fallback ( ENV [ 'hide_limit_column_types' ] , '' )
51
+ options [ :hide_default_column_types ] = Annotate :: Helpers . fallback ( ENV [ 'hide_default_column_types' ] , '' )
52
+ options [ :with_comment ] = Annotate :: Helpers . true? ( ENV [ 'with_comment' ] )
53
+ options [ :ignore_unknown_models ] = Annotate :: Helpers . true? ( ENV . fetch ( 'ignore_unknown_models' , 'false' ) )
54
54
55
55
AnnotateModels . do_annotations ( options )
56
56
end
@@ -64,6 +64,6 @@ task remove_annotation: :environment do
64
64
options [ :model_dir ] = ENV [ 'model_dir' ]
65
65
options [ :root_dir ] = ENV [ 'root_dir' ]
66
66
options [ :require ] = ENV [ 'require' ] ? ENV [ 'require' ] . split ( ',' ) : [ ]
67
- options [ :trace ] = Annotate . true? ( ENV [ 'trace' ] )
67
+ options [ :trace ] = Annotate :: Helpers . true? ( ENV [ 'trace' ] )
68
68
AnnotateModels . remove_annotations ( options )
69
69
end
0 commit comments