Skip to content

Improve style of `conflicts_with` implementation. #159

Merged
merged 1 commit into from

2 participants

@mikemcquaid
Homebrew member

Address @xu-cheng's comments from after #154 was merged.

@mikemcquaid mikemcquaid Improve style of `conflicts_with` implementation.
80c49c2
@mikemcquaid mikemcquaid merged commit 4eb0170 into master

3 checks passed

Details continuous-integration/travis-ci/pr The Travis CI build passed
Details continuous-integration/travis-ci/push The Travis CI build passed
Details coverage/coveralls First build on master at 100.0%
@mikemcquaid mikemcquaid deleted the conflicts-style-fixs branch
@xu-cheng xu-cheng commented on the diff
lib/bundle/brew_services.rb
@@ -1,7 +1,7 @@
module Bundle
class BrewServices
def self.stop(name)
- started = !`brew services list | grep "#{name}" | grep -q "started"`.chomp.empty?
+ started = `brew services list`.lines.grep(/^#{name} +started/).any?
@xu-cheng
Homebrew member

Probably need a regex escape here.

@mikemcquaid
Homebrew member

Can you think of a valid formula name that'd generate invalid regex?

@xu-cheng
Homebrew member

Formula with + in the name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.