-
Notifications
You must be signed in to change notification settings - Fork 655
Use rails routes
instead of rake routes
, minimum rails is now 5.0
#843
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
base: develop
Are you sure you want to change the base?
Conversation
Doesn't work for me on Ruby 2.6.6 and Rails 6.1.
|
this one works with rails 6.1.0.rc |
Are there any plans to cut a release with this PR? |
Bumping again as I have my gemfile pegged to @Vasfed 's fork on the |
@ctran please |
85ce415
to
dba8ce9
Compare
Rebased onto current |
Signed-off-by: Vasily Fedoseyev <[email protected]>
dba8ce9
to
e822eb8
Compare
This works great for me! Not sure why the CI is failing. I also tried replacing I prefer not to add forked gems to my Gemfile since they don't get updated by dependabot. So I just added a monkey patch for this method to # frozen_string_literal: true
if Rails.env.development?
if Annotate.version != '3.2.0'
raise "annotate has been updated to version #{Annotate.version}! " \
"Check if the 'rails routes' patch is still needed, or if this PR has been merged: " \
'https://github.com/ctran/annotate_models/pull/843'
end
module AnnotateRoutes
class HeaderGenerator
class << self
private
# UPDATE: Changed `rake routes` to `rails routes`
def routes_map(options)
result = `rails routes`.chomp("\n").split(/\n/, -1)
# In old versions of Rake, the first line of output was the cwd. Not so
# much in newer ones. We ditch that line if it exists, and if not, we
# keep the line around.
result.shift if result.first =~ %r{^\(in /}
ignore_routes = options[:ignore_routes]
regexp_for_ignoring_routes = ignore_routes ? /#{ignore_routes}/ : nil
# Skip routes which match given regex
# Note: it matches the complete line (route_name, path, controller/action)
if regexp_for_ignoring_routes
result.reject { |line| line =~ regexp_for_ignoring_routes }
else
result
end
end
end
end
end
end |
Route annotation is broken until this is addressed @ctran ! How can the community help maintain this library? I've helped in the past (long, long ago, in a galaxy far away) and would be happy to help out again! I love this tool! |
I need help getting CI to work if you can spare some time. I was attempting to set up gitpod env but ran into few issues and haven't had time to continue. |
I was able to add a task that solved this for me:
task :routes do
puts `bin/rails routes`
end This injects the |
@ctran looks like the CI issues have been resolved now so hopefully this is good to go - is there anything else that could be done to help you with shipping this? |
This fixes #696
Major version bump is required because of minimum rails >= 5.0