burg 0.1.0 → 0.3.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 +4 -4
- data/README.md +4 -0
- data/lib/burg/app_loader.rb +52 -0
- data/lib/burg/app_loader_middleware.rb +16 -0
- data/lib/burg/once.rb +18 -0
- data/lib/burg/version.rb +1 -1
- data/lib/burg.rb +3 -3
- metadata +33 -3
- data/Rakefile +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d7f4537c75aa510de90e7c2a2c6bb69f4af0378d61b614ee7d76da1a1f732f8
|
4
|
+
data.tar.gz: 6f9409a6644ec944f63868c275c2e176462330a14c2b07fafce55ea7510f0e17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebd9b3f9a482d3949601d9e6cb54889c62ab735bda3e6c0091c312b60d56a4787eb7b227ef37e1856839e22d087b0191ed1c95b5855a7101c06b598850a352ff
|
7
|
+
data.tar.gz: 4ecda71a63df8fb96827bc72bfdad1eef4c9d0991c23625f6202a3d935fc1357f9011f2a78313d42d1b29d94d66b5d70ab04ab4eb068788170179f534c68f68b
|
data/README.md
CHANGED
@@ -6,6 +6,10 @@ Burg is the worst Ruby web framework. It's an experimental framework that's most
|
|
6
6
|
|
7
7
|
Bug reports and pull requests are welcome [on GitHub](https://github.com/jarednorman/burg). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/jarednorman/burg/blob/main/CODE_OF_CONDUCT.md).
|
8
8
|
|
9
|
+
## Releasing
|
10
|
+
|
11
|
+
This project uses [bake-gem](https://github.com/ioquatix/bake-gem) for releasing. Run `bake gem:release:{patch,minor,major}` to cut a new release.
|
12
|
+
|
9
13
|
## License
|
10
14
|
|
11
15
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require "concurrent/atomic/read_write_lock"
|
2
|
+
|
3
|
+
module Burg
|
4
|
+
class AppLoader
|
5
|
+
def initialize(path:, enable_reloading:)
|
6
|
+
@loader = Zeitwerk::Loader.new
|
7
|
+
|
8
|
+
@loader.push_dir path
|
9
|
+
@loader.enable_reloading if enable_reloading
|
10
|
+
@loader.inflector.inflect(**inflections)
|
11
|
+
@loader.setup
|
12
|
+
|
13
|
+
@reload_lock = Concurrent::ReadWriteLock.new
|
14
|
+
|
15
|
+
if @loader.reloading_enabled?
|
16
|
+
@start_loading = Once.new do
|
17
|
+
Listen.to(*@loader.dirs) do
|
18
|
+
@dirty = true
|
19
|
+
end.start
|
20
|
+
end
|
21
|
+
else
|
22
|
+
@loader.eager_load
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
attr_reader :reload_lock
|
27
|
+
|
28
|
+
def reload!
|
29
|
+
@start_loading&.call
|
30
|
+
|
31
|
+
return unless @dirty
|
32
|
+
|
33
|
+
reload_lock.with_write_lock do
|
34
|
+
@dirty = false
|
35
|
+
@loader.reload
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def reloading_enabled?
|
40
|
+
@loader.reloading_enabled?
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
# FIXME: This needs to be made configurable.
|
46
|
+
# Note: This configures inflections for whole segments. Inflecting "xml" as
|
47
|
+
# "XML" will only change paths like "foo/xml.rb", not "foo/my_xml_parser.rb".
|
48
|
+
def inflections = {
|
49
|
+
"vii_action" => "VIIAction"
|
50
|
+
}
|
51
|
+
end
|
52
|
+
end
|
data/lib/burg/once.rb
ADDED
data/lib/burg/version.rb
CHANGED
data/lib/burg.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,42 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: burg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jared Norman
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
11
|
-
dependencies:
|
11
|
+
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: concurrent-ruby
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '0'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '0'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: zeitwerk
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
12
40
|
description: The worst Ruby web framework
|
13
41
|
email:
|
14
42
|
- hey@jardo.dev
|
@@ -20,8 +48,10 @@ files:
|
|
20
48
|
- CODE_OF_CONDUCT.md
|
21
49
|
- LICENSE.txt
|
22
50
|
- README.md
|
23
|
-
- Rakefile
|
24
51
|
- lib/burg.rb
|
52
|
+
- lib/burg/app_loader.rb
|
53
|
+
- lib/burg/app_loader_middleware.rb
|
54
|
+
- lib/burg/once.rb
|
25
55
|
- lib/burg/version.rb
|
26
56
|
homepage: https://github.com/jarednorman/burg
|
27
57
|
licenses:
|