syntropy 0.16 → 0.17
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/CHANGELOG.md +4 -0
- data/README.md +37 -5
- data/lib/syntropy/app.rb +1 -1
- data/lib/syntropy/version.rb +1 -1
- data/lib/syntropy.rb +1 -1
- data/syntropy.gemspec +3 -3
- data/test/app/api+.rb +1 -1
- data/test/test_app.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db440894351239f4fdc164cd3550d741919a8fed568f20620040cca54b7dbebd
|
4
|
+
data.tar.gz: 165d4a52b7d7ce7fb8377d7b0e96f108ef7c65cfc768cf59ec73b97a4f7c84e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2bb77e92b44ca5e66a46c4427a4705cb2316b42372a71ce3c1e250bf1f93bccbe9201fe9602c174a6315880f33d47338133c121871561ab31e98c5a095bb385
|
7
|
+
data.tar.gz: c1069d92fbdb6a4a9eb792fa26c16e3d3494c882eb8a8d09e211a0f16b7b880bab8e0004a74cf4d1969398c2185091282bc3a4eebbf37b325c31ae06d52d3cd0
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -9,10 +9,10 @@
|
|
9
9
|
<a href="http://rubygems.org/gems/syntropy">
|
10
10
|
<img src="https://badge.fury.io/rb/syntropy.svg" alt="Ruby gem">
|
11
11
|
</a>
|
12
|
-
<a href="https://github.com/
|
13
|
-
<img src="https://github.com/
|
12
|
+
<a href="https://github.com/digital-fabric/syntropy/actions">
|
13
|
+
<img src="https://github.com/digital-fabric/syntropy/actions/workflows/test.yml/badge.svg" alt="Tests">
|
14
14
|
</a>
|
15
|
-
<a href="https://github.com/
|
15
|
+
<a href="https://github.com/digital-fabric/syntropy/blob/master/LICENSE">
|
16
16
|
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License">
|
17
17
|
</a>
|
18
18
|
</p>
|
@@ -38,7 +38,7 @@ Syntropy is based on:
|
|
38
38
|
|
39
39
|
- [UringMachine](https://github.com/digital-fabric/uringmachine) - a lean mean
|
40
40
|
[io_uring](https://unixism.net/loti/what_is_io_uring.html) machine for Ruby.
|
41
|
-
- [TP2](https://github.com/
|
41
|
+
- [TP2](https://github.com/digital-fabric/tp2) - an io_uring-based web server for
|
42
42
|
concurrent Ruby apps.
|
43
43
|
- [Qeweney](https://github.com/digital-fabric/qeweney) a uniform interface for
|
44
44
|
working with HTTP requests and responses.
|
@@ -46,6 +46,16 @@ Syntropy is based on:
|
|
46
46
|
- [Extralite](https://github.com/digital-fabric/extralite) a fast and innovative
|
47
47
|
SQLite wrapper for Ruby.
|
48
48
|
|
49
|
+
## Examples
|
50
|
+
|
51
|
+
To get a taste of some of Syntropy's capabilities, you can run the included
|
52
|
+
examples site inside the Syntropy repository:
|
53
|
+
|
54
|
+
```bash
|
55
|
+
$ cd syntropy
|
56
|
+
$ bundle exec syntropy -d examples
|
57
|
+
```
|
58
|
+
|
49
59
|
## Routing
|
50
60
|
|
51
61
|
Syntropy routes request by following the tree structure of the Syntropy app. A
|
@@ -93,6 +103,28 @@ Some conventions employed in Syntropy-based web apps:
|
|
93
103
|
- The Syntrpy router accepts clean URLs for Ruby modules and Markdown files. It
|
94
104
|
also accepts clean URLs for `index.html` files.
|
95
105
|
|
106
|
+
## Running Syntropy
|
107
|
+
|
108
|
+
Note: Syntropy runs exclusively on Linux and requires kernel version >= 6.4.
|
109
|
+
|
110
|
+
To start a web server on the working directory, use the `syntropy` command:
|
111
|
+
|
112
|
+
```bash
|
113
|
+
$ # install syntropy:
|
114
|
+
$ gem install syntropy
|
115
|
+
$ # run syntropy
|
116
|
+
$ syntropy path/to/my_site
|
117
|
+
```
|
118
|
+
|
119
|
+
To get help for the different options available, run `syntropy -h`.
|
120
|
+
|
121
|
+
## Development mode
|
122
|
+
|
123
|
+
When developing and making changes to your site, you can run Syntropy in
|
124
|
+
development mode, which automatically reloads changed modules and provides tools
|
125
|
+
to automatically refresh open web pages and debug HTML templates. To start
|
126
|
+
Syntropy in development mode, run `syntropy -d path/to/my_site`.
|
127
|
+
|
96
128
|
## What does a Syntropic Ruby module look like?
|
97
129
|
|
98
130
|
Consider `site/archive.rb` in the file tree above. We want to get a list of
|
@@ -121,7 +153,7 @@ But a module can also be something completely different:
|
|
121
153
|
|
122
154
|
```ruby
|
123
155
|
# api/v1.rb
|
124
|
-
class APIV1 < Syntropy::
|
156
|
+
class APIV1 < Syntropy::JSONAPI
|
125
157
|
def initialize(db)
|
126
158
|
@db = db
|
127
159
|
end
|
data/lib/syntropy/app.rb
CHANGED
data/lib/syntropy/version.rb
CHANGED
data/lib/syntropy.rb
CHANGED
@@ -47,7 +47,7 @@ module Syntropy
|
|
47
47
|
" #{GREEN}ooooo\n"\
|
48
48
|
" #{GREEN} ooo vvv #{CLEAR}Syntropy - a web framework for Ruby\n"\
|
49
49
|
" #{GREEN} o vvvvv #{CLEAR}--------------------------------------\n"\
|
50
|
-
" #{GREEN} #{YELLOW}|#{GREEN} vvv o #{CLEAR}https://github.com/
|
50
|
+
" #{GREEN} #{YELLOW}|#{GREEN} vvv o #{CLEAR}https://github.com/digital-fabric/syntropy\n"\
|
51
51
|
" #{GREEN} :#{YELLOW}|#{GREEN}:::#{YELLOW}|#{GREEN}::#{YELLOW}|#{GREEN}:\n"\
|
52
52
|
"#{YELLOW}+++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\n\n"
|
53
53
|
end
|
data/syntropy.gemspec
CHANGED
@@ -9,11 +9,11 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.email = 'sharon@noteflakes.com'
|
10
10
|
s.files = `git ls-files`.split
|
11
11
|
|
12
|
-
s.homepage = 'https://github.com/
|
12
|
+
s.homepage = 'https://github.com/digital-fabric/syntropy'
|
13
13
|
s.metadata = {
|
14
|
-
'homepage_uri' => 'https://github.com/
|
14
|
+
'homepage_uri' => 'https://github.com/digital-fabric/syntropy',
|
15
15
|
'documentation_uri' => 'https://www.rubydoc.info/gems/syntropy',
|
16
|
-
'changelog_uri' => 'https://github.com/
|
16
|
+
'changelog_uri' => 'https://github.com/digital-fabric/syntropy/blob/master/CHANGELOG.md'
|
17
17
|
}
|
18
18
|
s.rdoc_options = ['--title', 'Extralite', '--main', 'README.md']
|
19
19
|
s.extra_rdoc_files = ['README.md']
|
data/test/app/api+.rb
CHANGED
data/test/test_app.rb
CHANGED
@@ -104,7 +104,7 @@ class AppTest < Minitest::Test
|
|
104
104
|
assert_equal 'About', req.response_body.chomp
|
105
105
|
|
106
106
|
req = make_request(':method' => 'GET', ':path' => '/test/about/foo')
|
107
|
-
assert_equal '
|
107
|
+
assert_equal '<!DOCTYPE html><html><head><title></title></head><body><p>Hello from Markdown</p></body></html>', req.response_body.gsub(/\n/, '')
|
108
108
|
|
109
109
|
req = make_request(':method' => 'HEAD', ':path' => '/test/about/foo')
|
110
110
|
assert_nil req.response_body
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syntropy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.17'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
@@ -255,13 +255,13 @@ files:
|
|
255
255
|
- test/test_request_extensions.rb
|
256
256
|
- test/test_routing_tree.rb
|
257
257
|
- test/test_side_run.rb
|
258
|
-
homepage: https://github.com/
|
258
|
+
homepage: https://github.com/digital-fabric/syntropy
|
259
259
|
licenses:
|
260
260
|
- MIT
|
261
261
|
metadata:
|
262
|
-
homepage_uri: https://github.com/
|
262
|
+
homepage_uri: https://github.com/digital-fabric/syntropy
|
263
263
|
documentation_uri: https://www.rubydoc.info/gems/syntropy
|
264
|
-
changelog_uri: https://github.com/
|
264
|
+
changelog_uri: https://github.com/digital-fabric/syntropy/blob/master/CHANGELOG.md
|
265
265
|
rdoc_options:
|
266
266
|
- "--title"
|
267
267
|
- Extralite
|