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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 498c4c284ca425c3e5209d01d9d672f92564cd34c920c36c30316e1a8558702d
4
- data.tar.gz: 6133c90b3ff6d4b01bed2c05f0ea8909ab530da95fe3c72c16ca6839da1b91f8
3
+ metadata.gz: 7bb87f349c1b4d1a5aebfa07baac5fa4cf71545fbc38966476fdf961a353631f
4
+ data.tar.gz: 44f53f9a315c825c09887a487b04ff5a74a90369eedf672399dffba674041772
5
5
  SHA512:
6
- metadata.gz: 499cecbafa170bb4dea32f752a01ad9326116f82a35cda6a85bf5768eb4aa511968f4ca4521a01ebc5ffba5d0c5e7fa25710d52acb10500a749d4b0ff245d77f
7
- data.tar.gz: 2938c1fd91118110395b34e41b8e4f870799aa43bdd2f471e5e5826590906d8aadad69af6c1379818243d784bdf5d7b758212c452c0864898eb3a72e7c23776e
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}"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GyozaLanguages
4
- VERSION = '1.0.3'
4
+ VERSION = '1.0.4'
5
5
  # The content sent as the HTTP Server header
6
6
  SERVER_NAME = "Gyoza-Languages/#{VERSION}"
7
7
  DEFAULT_PORT = 20125
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gyoza-languages
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fulminazzo