-
Notifications
You must be signed in to change notification settings - Fork 900
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
generate a csv of features supported across all models #11281
Conversation
/cc @mfeifer |
❤️ |
def usage | ||
<<-USAGE | ||
Usage: | ||
`bin/rails r tools/feature_support_matrix.rb` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest putting this at the top so you can invoke this with plain ruby:
require File.expand_path('../config/environment', __dir__)
This will load rails in a way that's nearly 100% identical as bin/rails runner. Runner is for inline ruby strings, not actual files. See also #4307.
the side effect is you don't have to deal with rails runner intercepting any ARGs you pass to the script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also easier to invoke
ruby tools/feature_support_matrix.rb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since i brought it up, I'll fix up some of the existing scripts in tools that do the bin/rails runner way.
409a78a
to
58bfea7
Compare
Benefits: * rails runner is for shebang lines or inline ruby, see ManageIQ#4307 * We don't have to check if rails is loaded. * Can be run outside rails root directory via ruby. * We don't need -- to avoid rails runner modifying our args. * Less typing. * Existing bin/rails runner callers with args just work: `ruby tools/purge_orphaned_tag_values.rb -s 100` Or, the old way: `bin/rails runner tools/purge_orphaned_tag_values.rb -- -s 100` Discovered while reviewing: ManageIQ#11281
def usage | ||
<<-USAGE | ||
Usage: | ||
`ruby tools/feature_support_matrix.rb` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 👍
@durandom Can you reword the commit message to say ruby instead of bin/rails runner? I already updated the description of the PR but the commit is still lying. Note, bin/rails runner still works but is not very friendly. |
58bfea7
to
12bc64c
Compare
execute as `ruby tools/feature_support_matrix.rb`
12bc64c
to
0fa1af9
Compare
Checked commit durandom@0fa1af9 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
execute as
ruby tools/feature_support_matrix.rb
A sample Google Docs output is here