Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Library/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@ Homebrew/CompactBlank:
# `blank?` is not necessarily available here:
- "Homebrew/extend/enumerable.rb"

Homebrew/FormulaPathMethods:
Exclude:
# TODO: Remove this after Homebrew/core has applied formula autocorrections.
- "/**/Formula/**/*.rb"
- "**/Formula/**/*.rb"

Homebrew/NoFileutilsRmrf:
Include:
- "/**/{Formula,Casks}/**/*.rb"
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

require "ipaddr"
require "on_system"
require "utils/path"
require "utils/service"

module Homebrew
Expand All @@ -12,6 +13,7 @@ module Homebrew
class Service
extend Forwardable
include OnSystem::MacOSAndLinux
include Utils::Path

RUN_TYPE_IMMEDIATE = :immediate
RUN_TYPE_INTERVAL = :interval
Expand Down
12 changes: 12 additions & 0 deletions Library/Homebrew/test/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ def stub_formula_with_service_sockets(sockets_var)
end
end

describe "#formula_opt_bin" do
it "is available in service blocks" do
f = stub_formula do
service do
run formula_opt_bin("foo")/"foo"
end
end

expect(f.service.run).to eq([(HOMEBREW_PREFIX/"opt/foo/bin/foo").to_s])
end
end

describe "#process_type" do
it "throws for unexpected type" do
f = stub_formula do
Expand Down
Loading