Skip to content

Commit 56abbaa

Browse files
committed
Merge pull request #314 from ctran/revert-312-feature_ignore_routes
Revert "Add ignore_routes option"
2 parents 7744e76 + 053c3b6 commit 56abbaa

File tree

6 files changed

+1
-12
lines changed

6 files changed

+1
-12
lines changed

bin/annotate

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,6 @@ OptionParser.new do |opts|
178178
ENV['ignore_columns'] = regex
179179
end
180180

181-
opts.on('-I', '--ignore-routes REGEX', "don't annotate routes that match a given REGEX (i.e., `annotate -I '(mobile|resque|pghero)'`" ) do |regex|
182-
ENV['ignore_routes'] = regex
183-
end
184-
185181
opts.on('--hide-limit-column-types VALUES', "don't show limit for given column types, separated by comas (i.e., `integer,boolean,text`)" ) do |values|
186182
ENV['hide_limit_column_types'] = "#{values}"
187183
end

lib/annotate.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module Annotate
3131
]
3232
OTHER_OPTIONS=[
3333
:ignore_columns, :skip_on_db_migrate, :wrapper_open, :wrapper_close, :wrapper, :routes,
34-
:hide_limit_column_types, :ignore_routes
34+
:hide_limit_column_types,
3535
]
3636
PATH_OPTIONS=[
3737
:require, :model_dir, :root_dir

lib/annotate/annotate_routes.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ def self.do_annotations(options={})
3232
# keep the line around.
3333
routes_map.shift if(routes_map.first =~ /^\(in \//)
3434

35-
# Skip routes which match given regex
36-
# Note: it matches the complete line (route_name, path, controller/action)
37-
routes_map.reject!{|line| line.match(/#{options[:ignore_routes]}/)} if options[:ignore_routes]
38-
3935
header = [
4036
"#{PREFIX}" + (options[:timestamp] ? " (Updated #{Time.now.strftime("%Y-%m-%d %H:%M")})" : ""),
4137
"#"

lib/generators/annotate/templates/auto_annotate_models.rake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ if Rails.env.development?
2929
'exclude_helpers' => 'false',
3030
'ignore_model_sub_dir' => 'false',
3131
'ignore_columns' => nil,
32-
'ignore_routes' => nil,
3332
'ignore_unknown_models' => 'false',
3433
'hide_limit_column_types' => '<%= AnnotateModels::NO_LIMIT_COL_TYPES.join(',') %>',
3534
'skip_on_db_migrate' => 'false',

lib/tasks/annotate_models.rake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ task :annotate_models => :environment do
4242
options[:wrapper_open] = Annotate.fallback(ENV['wrapper_open'], ENV['wrapper'])
4343
options[:wrapper_close] = Annotate.fallback(ENV['wrapper_close'], ENV['wrapper'])
4444
options[:ignore_columns] = ENV.fetch('ignore_columns', nil)
45-
options[:ignore_routes] = ENV.fetch('ignore_routes', nil)
4645

4746
AnnotateModels.do_annotations(options)
4847
end

lib/tasks/annotate_routes.rake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ task :annotate_routes => :environment do
66
options={}
77
ENV['position'] = options[:position] = Annotate.fallback(ENV['position'], 'before')
88
options[:position_in_routes] = Annotate.fallback(ENV['position_in_routes'], ENV['position'])
9-
options[:ignore_routes] = Annotate.fallback(ENV['ignore_routes'], nil)
109
options[:require] = ENV['require'] ? ENV['require'].split(',') : []
1110
AnnotateRoutes.do_annotations(options)
1211
end

0 commit comments

Comments
 (0)