Skip to content

Commit 48186d0

Browse files
committed
Update bake support.
1 parent 9721b29 commit 48186d0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11

2-
recipe :fetch, description: "Fetch the specified URL and print the response." do |url, method:|
2+
# Fetch the specified URL and print the response.
3+
# @param url [String] the URL to parse and fetch.
4+
# @param method [String] the HTTP method to use.
5+
def fetch(url, method:)
36
require 'async/http/internet'
47
require 'kernel/sync'
58

@@ -68,11 +71,13 @@
6871
end
6972
end
7073

71-
recipe :get, description: "GET the specified URL and print the response." do |url|
72-
call :fetch, url, "method=GET"
74+
# GET the specified URL and print the response.
75+
def get(url)
76+
self.fetch(url, method: "GET")
7377
end
7478

75-
recipe :head, description: "HEAD the specified URL and print the response." do |url|
76-
call :fetch, url, "method=HEAD"
79+
# HEAD the specified URL and print the response.
80+
def head(url)
81+
self.fetch(url, method: "HEAD")
7782
end
7883

0 commit comments

Comments
 (0)