gyoza-languages 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gyoza-languages/gyoza_app.rb +13 -0
- data/lib/gyoza-languages/gyoza_language_app.rb +17 -0
- data/lib/gyoza-languages/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bb87f349c1b4d1a5aebfa07baac5fa4cf71545fbc38966476fdf961a353631f
|
4
|
+
data.tar.gz: 44f53f9a315c825c09887a487b04ff5a74a90369eedf672399dffba674041772
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c38291aef05df4d6d95f8bd41133a4816ed77c1d08d1b6f38317c7cb26d5b96bbfa85443bdbc315db291fd87d0cbeaa004fe4d634ba27c257c6b89328dee87b
|
7
|
+
data.tar.gz: e8e8bf272cb9349fc15c433008535dd04d64cd4fcc15e9dbc2ba83eb3364bec46f4c68747689f5168e4357e84dea2f4f6f99423a2ea7dd548c82960346e69052
|
@@ -70,6 +70,8 @@ class GyozaApp
|
|
70
70
|
patch(path, query, env)
|
71
71
|
when 'DELETE'
|
72
72
|
delete(path, query, env)
|
73
|
+
when 'HEAD'
|
74
|
+
head(path, query, env)
|
73
75
|
else
|
74
76
|
response 405
|
75
77
|
end
|
@@ -130,6 +132,17 @@ class GyozaApp
|
|
130
132
|
response 405
|
131
133
|
end
|
132
134
|
|
135
|
+
# The response to a HEAD request.
|
136
|
+
# By default, returns the 405 HTTP status code.
|
137
|
+
#
|
138
|
+
# Arguments:
|
139
|
+
# path: the path of the repository
|
140
|
+
# query: a hash containing all the query parameters
|
141
|
+
# env: the environment variables at the time of receiving the request
|
142
|
+
protected def head(path, query, env)
|
143
|
+
response 405
|
144
|
+
end
|
145
|
+
|
133
146
|
# Formats a new HTTP response from the given HTTP status code.
|
134
147
|
#
|
135
148
|
# Arguments:
|
@@ -65,6 +65,23 @@ class GyozaLanguageApp < GyozaApp
|
|
65
65
|
response(200, languages)
|
66
66
|
end
|
67
67
|
|
68
|
+
# Executes a GET response using get(path, query, env),
|
69
|
+
# but removes the returned body from the final response.
|
70
|
+
#
|
71
|
+
# Arguments:
|
72
|
+
# path: the path of the repository
|
73
|
+
# query: a hash of arguments. If the "branch" argument is specified, then
|
74
|
+
# the languages will be looked for that particular branch. However,
|
75
|
+
# if not found a 404 'Not Found' error is returned
|
76
|
+
# env: the environment variables at the time of receiving the request
|
77
|
+
protected def head(path, query, env)
|
78
|
+
response = get(path, query, env)
|
79
|
+
headers = response[1]
|
80
|
+
headers.delete 'Content-Type'
|
81
|
+
response[2] = []
|
82
|
+
response
|
83
|
+
end
|
84
|
+
|
68
85
|
private def not_found(type, name)
|
69
86
|
response(404, {
|
70
87
|
'message' => "Could not find #{type}: #{name}"
|