Skip to content

Revert "Add ignore_routes option" #314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions bin/annotate
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,6 @@ OptionParser.new do |opts|
ENV['ignore_columns'] = regex
end

opts.on('-I', '--ignore-routes REGEX', "don't annotate routes that match a given REGEX (i.e., `annotate -I '(mobile|resque|pghero)'`" ) do |regex|
ENV['ignore_routes'] = regex
end

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|
ENV['hide_limit_column_types'] = "#{values}"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/annotate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module Annotate
]
OTHER_OPTIONS=[
:ignore_columns, :skip_on_db_migrate, :wrapper_open, :wrapper_close, :wrapper, :routes,
:hide_limit_column_types, :ignore_routes
:hide_limit_column_types,
]
PATH_OPTIONS=[
:require, :model_dir, :root_dir
Expand Down
4 changes: 0 additions & 4 deletions lib/annotate/annotate_routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ def self.do_annotations(options={})
# keep the line around.
routes_map.shift if(routes_map.first =~ /^\(in \//)

# Skip routes which match given regex
# Note: it matches the complete line (route_name, path, controller/action)
routes_map.reject!{|line| line.match(/#{options[:ignore_routes]}/)} if options[:ignore_routes]

header = [
"#{PREFIX}" + (options[:timestamp] ? " (Updated #{Time.now.strftime("%Y-%m-%d %H:%M")})" : ""),
"#"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if Rails.env.development?
'exclude_helpers' => 'false',
'ignore_model_sub_dir' => 'false',
'ignore_columns' => nil,
'ignore_routes' => nil,
'ignore_unknown_models' => 'false',
'hide_limit_column_types' => '<%= AnnotateModels::NO_LIMIT_COL_TYPES.join(',') %>',
'skip_on_db_migrate' => 'false',
Expand Down
1 change: 0 additions & 1 deletion lib/tasks/annotate_models.rake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ task :annotate_models => :environment do
options[:wrapper_open] = Annotate.fallback(ENV['wrapper_open'], ENV['wrapper'])
options[:wrapper_close] = Annotate.fallback(ENV['wrapper_close'], ENV['wrapper'])
options[:ignore_columns] = ENV.fetch('ignore_columns', nil)
options[:ignore_routes] = ENV.fetch('ignore_routes', nil)

AnnotateModels.do_annotations(options)
end
Expand Down
1 change: 0 additions & 1 deletion lib/tasks/annotate_routes.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ task :annotate_routes => :environment do
options={}
ENV['position'] = options[:position] = Annotate.fallback(ENV['position'], 'before')
options[:position_in_routes] = Annotate.fallback(ENV['position_in_routes'], ENV['position'])
options[:ignore_routes] = Annotate.fallback(ENV['ignore_routes'], nil)
options[:require] = ENV['require'] ? ENV['require'].split(',') : []
AnnotateRoutes.do_annotations(options)
end
Expand Down