macaw_framework 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d75c6de0b02d30691fa5f96e00b0b3ee57252ea1aa85a46d39233bcea0559116
4
- data.tar.gz: ead04287539187c0eb4077c49f00ba1e197861ee60f915a9686d904630444ed3
3
+ metadata.gz: 491bca651168a6934d2271ea54b4d123d986b2cf467d47f8da6ec512988d71e5
4
+ data.tar.gz: 16607cefef4714fcf6062d540b5dba60985e6276f4569ad20fe65f1eef199ff3
5
5
  SHA512:
6
- metadata.gz: 5c620f8210e450f2e830fa5089feb5843f04750f9399f32d31dae271c490676628648ba306d6d9084c4ee3272eb8bb85efe43f55a1d9f4db761731b82ba10d7e
7
- data.tar.gz: 5c447df10c725b61407b9d1846975550894d9555d4e42b5e0154c6af70aa73fe1300995c90e71e5bb116581f94323f7a2e3dbb3b9b6603d4c604893621f9bea9
6
+ metadata.gz: b93f8683ec3b67450ed8321000822db8fc8b049eace487711df574d8f1e20943aaf5f5366640be0a01ef461919e66a4510ab876b4f408f3c42fc92efb1d12a41
7
+ data.tar.gz: '02087194f65d038a66c4e4618c4142c2bdc569111c278ad14a19dc658daa4f25e2017f3b5d4349fdcdc41f762234dc1a3835593df137c8c35452c0780f0665a8'
data/CHANGELOG.md CHANGED
@@ -100,3 +100,7 @@
100
100
  ## [1.1.6] - 2023-07-19
101
101
 
102
102
  - Creating support for public folder
103
+
104
+ ## [1.1.7] - 2023-08-12
105
+
106
+ - Fixing a bug where the server would not start with the public folder feature enabled on non-Unix systems
data/README.md CHANGED
@@ -175,7 +175,7 @@ MacawFramework allows you to serve static assets, such as CSS, JavaScript, image
175
175
  To enable this functionality, make sure the "public" folder is placed in the same directory as the main.rb file.
176
176
  The "public" folder should contain any static assets required by your web application.
177
177
 
178
- To avoid issues, instantiate the Macaw using the `dir` proporty as following:
178
+ To avoid issues, instantiate the Macaw using the `dir` property as following:
179
179
 
180
180
  ```ruby
181
181
  MacawFramework::Macaw.new(dir: __dir__)
@@ -185,6 +185,8 @@ By default, MacawFramework will automatically serve files from the "public" fold
185
185
  are made. For example, if you have an image file named "logo.png" inside a "img" folder in the "public" folder, it will
186
186
  be accessible at http://yourdomain.com/img/logo.png without any additional configuration.
187
187
 
188
+ #### Caution: This is incompatible with most non-unix systems, such as Windows. If you are using a non-unix system, you will need to manually configure the "public" folder and use dir as nil to avoid problems.
189
+
188
190
  ### Cron Jobs
189
191
 
190
192
  Macaw Framework supports the declaration of cron jobs right in your application code. This feature allows developers to
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MacawFramework
4
- VERSION = "1.1.6"
4
+ VERSION = "1.1.7"
5
5
  end
@@ -24,7 +24,7 @@ module MacawFramework
24
24
 
25
25
  ##
26
26
  # @param {Logger} custom_log
27
- def initialize(custom_log: Logger.new($stdout), server: ThreadServer, dir: __dir__)
27
+ def initialize(custom_log: Logger.new($stdout), server: ThreadServer, dir: nil)
28
28
  begin
29
29
  @routes = []
30
30
  @macaw_log ||= custom_log
@@ -203,9 +203,13 @@ module MacawFramework
203
203
  end
204
204
 
205
205
  def get_files_public_folder(dir)
206
- folder_path = Pathname.new(File.expand_path("public", dir))
207
- file_paths = folder_path.glob("**/*").select(&:file?)
208
- file_paths.map { |path| "public/#{path.relative_path_from(folder_path)}" }
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
209
213
  end
210
214
 
211
215
  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.6
4
+ version: 1.1.7
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-07-20 00:00:00.000000000 Z
11
+ date: 2023-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prometheus-client