-
Notifications
You must be signed in to change notification settings - Fork 96
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
Feature request: Allow flags to be added to configuration in .metrics #236
Comments
So, before answering your specific question, here's a dumb answer Create the file #!/usr/bin/env bash
metric_fu --no-open
Or if you don't want to chmod, then just and now you have a super dumb wrapper around your desired behavior and just tell everyone to use The sad answer is that this appears to only be available as an argument to Run, so it's not a regular config :( I suppose you could also write your own runner using the interface MetricFu.run or MetricFu.run_only that's used by the rake task but I'm not sure if that might change in the future. |
In case you want it:
|
I'd be happy to pair on a PR if you want to. |
Thanks for the info! I'm pretty noob-ish, so I'm not sure how much help I can be, but I'd be happy to pair on this at some point if you're available and have the patience! |
One caveat to your bash script answer is that it will conflict with any generated bundler binstub for metric_fu. |
Well, if metric_fu is in your Gemfile, then edit the script to |
Did that help? |
Unfortunately, no. I'm using the auto generated binstub, which looks like this:
It wasn't obvious to me where in this script, if anywhere, I could add a flag as suggested. The docs for |
@shawnacscott Behold: #!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'metric_fu' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require 'rubygems'
require 'bundler/setup'
if ARGV.grep(/open/).empty?
puts "bin/metric_fu is adding the --no-open flag for you"
ARGV << "--no-open"
end
load Gem.bin_path('metric_fu', 'metric_fu') |
👍 Thanks, works like a charm! Appreciate it! |
I suppose I should leave this open to document this: I just remembered that there actually is a config that is totally roundabout and unfortunately separated from the 'open' option. tl;dr in your
|
I'm hoping this is actually not a feature request and I'm just doing it wrong. :)
I would like to add metric_fu to my Rails project which my company runs on a Vagrant instance. Because we're using this VM, I would like to have it always run with the
--no-open
flag by default so that my team members don't have to remember to either pass the flag or ignore the errors every time. I'd like to be able to do something like:If there's a way to do this that I've missed, I'd love to hear it.
Thanks!
The text was updated successfully, but these errors were encountered: