macaw_framework 1.1.7 → 1.2.0

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: 491bca651168a6934d2271ea54b4d123d986b2cf467d47f8da6ec512988d71e5
4
- data.tar.gz: 16607cefef4714fcf6062d540b5dba60985e6276f4569ad20fe65f1eef199ff3
3
+ metadata.gz: 8fdecdae940a89142bf0252b2d0b818684f87b50d030c86c1523224aab684b0f
4
+ data.tar.gz: bf7ff6874613d14f1a97f803ca3bc063269cc2fb5f34d17679fc694ca80ed2f2
5
5
  SHA512:
6
- metadata.gz: b93f8683ec3b67450ed8321000822db8fc8b049eace487711df574d8f1e20943aaf5f5366640be0a01ef461919e66a4510ab876b4f408f3c42fc92efb1d12a41
7
- data.tar.gz: '02087194f65d038a66c4e4618c4142c2bdc569111c278ad14a19dc658daa4f25e2017f3b5d4349fdcdc41f762234dc1a3835593df137c8c35452c0780f0665a8'
6
+ metadata.gz: 85c4c95350b29411fcfa51bbfaf8929f9046d8927c8d8ebb56b7725f05680a0ec5845c4b9ad2a03aff07ab951289e81035711fe1a76132a534b51876543916d1
7
+ data.tar.gz: 777150885e128a091f05e9d63548fd715a4fa36cf61f7ed350bf291dc75b22b12f5f69aa7252f4dea2dbee827d6a0c852830a1ea105c45919d5e08b486fc7b71
data/CHANGELOG.md CHANGED
@@ -1,5 +1,3 @@
1
- ## [Unreleased]
2
-
3
1
  ## [0.1.0] - 2022-12-05
4
2
 
5
3
  - Initial release
@@ -104,3 +102,12 @@
104
102
  ## [1.1.7] - 2023-08-12
105
103
 
106
104
  - Fixing a bug where the server would not start with the public folder feature enabled on non-Unix systems
105
+
106
+ ## [1.1.8] - 2023-09-17
107
+
108
+ - Optimizing bug report template on GitHub
109
+ - Optimizing return clause of the get_files_public_folder method
110
+
111
+ ## [1.2.0] - 2023-09-17
112
+
113
+ - Fixing bug where the server would accept new connections during shutdown
@@ -62,7 +62,7 @@ class ThreadServer
62
62
  end
63
63
 
64
64
  loop do
65
- @work_queue << @server.accept
65
+ @work_queue << @server.accept unless @is_shutting_down
66
66
  rescue OpenSSL::SSL::SSLError => e
67
67
  @macaw_log&.error("SSL error: #{e.message}")
68
68
  rescue IOError, Errno::EBADF
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MacawFramework
4
- VERSION = "1.1.7"
4
+ VERSION = "1.2.0"
5
5
  end
@@ -198,18 +198,16 @@ module MacawFramework
198
198
  @macaw_log&.info("Defining #{prefix.upcase} endpoint at /#{path}")
199
199
  define_singleton_method("#{prefix}.#{path_clean}", block || lambda {
200
200
  |context = { headers: {}, body: "", params: {} }|
201
- })
201
+ })
202
202
  @routes << "#{prefix}.#{path_clean}"
203
203
  end
204
204
 
205
205
  def get_files_public_folder(dir)
206
- if dir.nil?
207
- []
208
- else
209
- folder_path = Pathname.new(File.expand_path("public", dir))
210
- file_paths = folder_path.glob("**/*").select(&:file?)
211
- file_paths.map { |path| "public/#{path.relative_path_from(folder_path)}" }
212
- end
206
+ return [] if dir.nil?
207
+
208
+ folder_path = Pathname.new(File.expand_path("public", dir))
209
+ file_paths = folder_path.glob("**/*").select(&:file?)
210
+ file_paths.map { |path| "public/#{path.relative_path_from(folder_path)}" }
213
211
  end
214
212
 
215
213
  def create_endpoint_public_files(dir)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: macaw_framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aria Diniz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-12 00:00:00.000000000 Z
11
+ date: 2023-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prometheus-client