macaw_framework 1.1.6 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -2
- data/README.md +3 -1
- data/lib/macaw_framework/version.rb +1 -1
- data/lib/macaw_framework.rb +4 -2
- 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: 4412336c2166038213ab4a58c54ff6e801a48ed280d60798fdfa7ff71582e2ab
|
4
|
+
data.tar.gz: 1dc49b04d5726e533e6ce1041c646e8d1d7279e75efdcb3caefba32d7e6705b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a28fe409f25f0a74656e4484aefd409d5542829635008409858f9809db21407ad71ced5d0919b44c064094ff5835a500b802370da13d20d0159de4297db6ba03
|
7
|
+
data.tar.gz: 83b5e962993694d211d4ae91d925326fb3a9330708048ab23adc4c2a175e2f2864e4f79c575c21170bb06366c8001b29c8f4a98a26a87caf52852d4180148f47
|
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
|
@@ -100,3 +98,12 @@
|
|
100
98
|
## [1.1.6] - 2023-07-19
|
101
99
|
|
102
100
|
- Creating support for public folder
|
101
|
+
|
102
|
+
## [1.1.7] - 2023-08-12
|
103
|
+
|
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
|
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
|
@@ -198,11 +198,13 @@ 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
|
+
return [] if dir.nil?
|
207
|
+
|
206
208
|
folder_path = Pathname.new(File.expand_path("public", dir))
|
207
209
|
file_paths = folder_path.glob("**/*").select(&:file?)
|
208
210
|
file_paths.map { |path| "public/#{path.relative_path_from(folder_path)}" }
|
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.8
|
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-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prometheus-client
|