Created
March 21, 2018 17:28
-
-
Save ch1ago/2a862ca3700d4d704d22a8ebd35b6b9b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class Symbol | |
def with(*args, &block) | |
->(caller, *rest) { caller.send(self, *rest, *args, &block) } | |
end | |
end | |
require 'active_support/core_ext/string' | |
require 'colorize' | |
lines = `git status`.split("\n") | |
files = lines.select(&:starts_with?.with("\tmodified:")) | |
.select(&:ends_with?.with('.rb')) | |
.select(&:exclude?.with('db/')) | |
.map { |line| line.gsub("\tmodified:", '').strip } | |
s= "rubocop -a #{files.join(' ')}" | |
puts s.yellow | |
system s | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment