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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -1
- data/lib/macaw_framework/version.rb +1 -1
- data/lib/macaw_framework.rb +8 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 491bca651168a6934d2271ea54b4d123d986b2cf467d47f8da6ec512988d71e5
|
4
|
+
data.tar.gz: 16607cefef4714fcf6062d540b5dba60985e6276f4569ad20fe65f1eef199ff3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b93f8683ec3b67450ed8321000822db8fc8b049eace487711df574d8f1e20943aaf5f5366640be0a01ef461919e66a4510ab876b4f408f3c42fc92efb1d12a41
|
7
|
+
data.tar.gz: '02087194f65d038a66c4e4618c4142c2bdc569111c278ad14a19dc658daa4f25e2017f3b5d4349fdcdc41f762234dc1a3835593df137c8c35452c0780f0665a8'
|
data/CHANGELOG.md
CHANGED
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`
|
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
|
data/lib/macaw_framework.rb
CHANGED
@@ -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:
|
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
|
-
|
207
|
-
|
208
|
-
|
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.
|
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-
|
11
|
+
date: 2023-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prometheus-client
|