fastrb 0.1.0 → 0.2.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/bin/fastrb +3 -0
- data/lib/{rubyapi → fastrb}/cli.rb +9 -9
- data/lib/{rubyapi → fastrb}/config.rb +1 -1
- data/lib/{rubyapi → fastrb}/openapi.rb +1 -1
- data/lib/{rubyapi → fastrb}/session.rb +2 -2
- data/lib/fastrb/version.rb +3 -0
- data/lib/{rubyapi.rb → fastrb.rb} +22 -22
- metadata +27 -27
- data/bin/rubyapi +0 -2
- data/lib/rubyapi/version.rb +0 -3
- /data/lib/{rubyapi → fastrb}/context.rb +0 -0
- /data/lib/{rubyapi → fastrb}/di.rb +0 -0
- /data/lib/{rubyapi → fastrb}/error_handler.rb +0 -0
- /data/lib/{rubyapi → fastrb}/job.rb +0 -0
- /data/lib/{rubyapi → fastrb}/middleware/logging.rb +0 -0
- /data/lib/{rubyapi → fastrb}/param_converters.rb +0 -0
- /data/lib/{rubyapi → fastrb}/plugin.rb +0 -0
- /data/lib/{rubyapi → fastrb}/plugins/auth.rb +0 -0
- /data/lib/{rubyapi → fastrb}/plugins/cache.rb +0 -0
- /data/lib/{rubyapi → fastrb}/plugins/cors.rb +0 -0
- /data/lib/{rubyapi → fastrb}/plugins/jwt.rb +0 -0
- /data/lib/{rubyapi → fastrb}/router.rb +0 -0
- /data/lib/{rubyapi → fastrb}/schema.rb +0 -0
- /data/lib/{rubyapi → fastrb}/serializer.rb +0 -0
- /data/lib/{rubyapi → fastrb}/sse.rb +0 -0
- /data/lib/{rubyapi → fastrb}/streaming.rb +0 -0
- /data/lib/{rubyapi → fastrb}/websocket.rb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ce89fe84dc5bc70621df9c2c44072026bc1867d1fc4952475d346494fb1cacf3
|
|
4
|
+
data.tar.gz: 977ed08389135d00c6ab06cdca556e84aef755a198d25524b7feb3071e4364b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac725e6b10b3779626847d519956445152e7e54d48d6650d7e0b19872759b32969c2c27aefbddf27e5442d9ee752af4d38a5cf3abd1179ffb826d4b92f34a5f6
|
|
7
|
+
data.tar.gz: 1e3362553127c08f15c5b96435ce475a58eba740e4962f5ff776875b8f56f2601052d54bcd9d912b05f8a3142d1bb1b12b08459518fb3ac1ee97e194a86716ab
|
data/bin/fastrb
ADDED
|
@@ -13,12 +13,12 @@ module RubyAPI
|
|
|
13
13
|
when "server"
|
|
14
14
|
start_server
|
|
15
15
|
when "version"
|
|
16
|
-
puts "
|
|
16
|
+
puts "fastrb #{VERSION}"
|
|
17
17
|
else
|
|
18
|
-
puts "Usage:
|
|
18
|
+
puts "Usage: fastrb <command> [options]"
|
|
19
19
|
puts ""
|
|
20
20
|
puts "Commands:"
|
|
21
|
-
puts " new <name> Create a new
|
|
21
|
+
puts " new <name> Create a new FastRb project"
|
|
22
22
|
puts " server Start the server (Falcon/Puma)"
|
|
23
23
|
puts " version Show version"
|
|
24
24
|
exit 1
|
|
@@ -26,7 +26,7 @@ module RubyAPI
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def self.new_project(name)
|
|
29
|
-
puts "Creating new
|
|
29
|
+
puts "Creating new FastRb project: #{name}"
|
|
30
30
|
|
|
31
31
|
FileUtils.mkdir_p(name)
|
|
32
32
|
FileUtils.mkdir_p("#{name}/app")
|
|
@@ -44,7 +44,7 @@ module RubyAPI
|
|
|
44
44
|
File.write("#{name}/spec/requests/hello_spec.rb", hello_spec_content)
|
|
45
45
|
File.write("#{name}/README.md", readme_content(name))
|
|
46
46
|
|
|
47
|
-
puts "Done! cd #{name} && bundle install &&
|
|
47
|
+
puts "Done! cd #{name} && bundle install && fastrb server"
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
def self.start_server
|
|
@@ -74,7 +74,7 @@ module RubyAPI
|
|
|
74
74
|
|
|
75
75
|
def self.main_rb_content
|
|
76
76
|
<<~RUBY
|
|
77
|
-
require "
|
|
77
|
+
require "fastrb"
|
|
78
78
|
|
|
79
79
|
class App < RubyAPI::App
|
|
80
80
|
def initialize
|
|
@@ -104,7 +104,7 @@ module RubyAPI
|
|
|
104
104
|
|
|
105
105
|
def self.spec_helper_content
|
|
106
106
|
<<~RUBY
|
|
107
|
-
require "
|
|
107
|
+
require "fastrb"
|
|
108
108
|
require "rack/test"
|
|
109
109
|
|
|
110
110
|
RSpec.configure do |config|
|
|
@@ -143,7 +143,7 @@ module RubyAPI
|
|
|
143
143
|
<<~MARKDOWN
|
|
144
144
|
# #{name}
|
|
145
145
|
|
|
146
|
-
A
|
|
146
|
+
A FastRb application.
|
|
147
147
|
|
|
148
148
|
## Setup
|
|
149
149
|
|
|
@@ -151,7 +151,7 @@ module RubyAPI
|
|
|
151
151
|
|
|
152
152
|
## Running
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
fastrb server
|
|
155
155
|
|
|
156
156
|
## Testing
|
|
157
157
|
|
|
@@ -5,11 +5,11 @@ require "openssl"
|
|
|
5
5
|
|
|
6
6
|
module RubyAPI
|
|
7
7
|
class Session
|
|
8
|
-
SESSION_COOKIE = "
|
|
8
|
+
SESSION_COOKIE = "_fastrb_session".freeze
|
|
9
9
|
|
|
10
10
|
def initialize(request, secret_key: nil)
|
|
11
11
|
@request = request
|
|
12
|
-
@secret_key = secret_key || "
|
|
12
|
+
@secret_key = secret_key || "fastrb_default_secret"
|
|
13
13
|
@data = load_session
|
|
14
14
|
end
|
|
15
15
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
require_relative "
|
|
2
|
-
require_relative "
|
|
3
|
-
require_relative "
|
|
4
|
-
require_relative "
|
|
5
|
-
require_relative "
|
|
6
|
-
require_relative "
|
|
7
|
-
require_relative "
|
|
8
|
-
require_relative "
|
|
9
|
-
require_relative "
|
|
10
|
-
require_relative "
|
|
11
|
-
require_relative "
|
|
12
|
-
require_relative "
|
|
13
|
-
require_relative "
|
|
14
|
-
require_relative "
|
|
15
|
-
require_relative "
|
|
16
|
-
require_relative "
|
|
17
|
-
require_relative "
|
|
18
|
-
require_relative "
|
|
19
|
-
require_relative "
|
|
20
|
-
require_relative "
|
|
21
|
-
require_relative "
|
|
1
|
+
require_relative "fastrb/version"
|
|
2
|
+
require_relative "fastrb/router"
|
|
3
|
+
require_relative "fastrb/context"
|
|
4
|
+
require_relative "fastrb/param_converters"
|
|
5
|
+
require_relative "fastrb/serializer"
|
|
6
|
+
require_relative "fastrb/openapi"
|
|
7
|
+
require_relative "fastrb/schema"
|
|
8
|
+
require_relative "fastrb/session"
|
|
9
|
+
require_relative "fastrb/error_handler"
|
|
10
|
+
require_relative "fastrb/config"
|
|
11
|
+
require_relative "fastrb/di"
|
|
12
|
+
require_relative "fastrb/plugin"
|
|
13
|
+
require_relative "fastrb/websocket"
|
|
14
|
+
require_relative "fastrb/sse"
|
|
15
|
+
require_relative "fastrb/streaming"
|
|
16
|
+
require_relative "fastrb/job"
|
|
17
|
+
require_relative "fastrb/middleware/logging"
|
|
18
|
+
require_relative "fastrb/plugins/cors"
|
|
19
|
+
require_relative "fastrb/plugins/jwt"
|
|
20
|
+
require_relative "fastrb/plugins/auth"
|
|
21
|
+
require_relative "fastrb/plugins/cache"
|
|
22
22
|
|
|
23
23
|
module RubyAPI
|
|
24
24
|
class App
|
|
@@ -288,7 +288,7 @@ module RubyAPI
|
|
|
288
288
|
<!DOCTYPE html>
|
|
289
289
|
<html>
|
|
290
290
|
<head>
|
|
291
|
-
<title>
|
|
291
|
+
<title>FastRb Docs</title>
|
|
292
292
|
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist/swagger-ui.css">
|
|
293
293
|
</head>
|
|
294
294
|
<body>
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fastrb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bruno Queiroz
|
|
@@ -96,35 +96,35 @@ dependencies:
|
|
|
96
96
|
description: FastRb is a modern web framework for Ruby, inspired by FastAPI, with
|
|
97
97
|
optional typing, automatic validation, and OpenAPI documentation.
|
|
98
98
|
executables:
|
|
99
|
-
-
|
|
99
|
+
- fastrb
|
|
100
100
|
extensions: []
|
|
101
101
|
extra_rdoc_files: []
|
|
102
102
|
files:
|
|
103
|
-
- bin/
|
|
104
|
-
- lib/
|
|
105
|
-
- lib/
|
|
106
|
-
- lib/
|
|
107
|
-
- lib/
|
|
108
|
-
- lib/
|
|
109
|
-
- lib/
|
|
110
|
-
- lib/
|
|
111
|
-
- lib/
|
|
112
|
-
- lib/
|
|
113
|
-
- lib/
|
|
114
|
-
- lib/
|
|
115
|
-
- lib/
|
|
116
|
-
- lib/
|
|
117
|
-
- lib/
|
|
118
|
-
- lib/
|
|
119
|
-
- lib/
|
|
120
|
-
- lib/
|
|
121
|
-
- lib/
|
|
122
|
-
- lib/
|
|
123
|
-
- lib/
|
|
124
|
-
- lib/
|
|
125
|
-
- lib/
|
|
126
|
-
- lib/
|
|
127
|
-
homepage: https://github.com/
|
|
103
|
+
- bin/fastrb
|
|
104
|
+
- lib/fastrb.rb
|
|
105
|
+
- lib/fastrb/cli.rb
|
|
106
|
+
- lib/fastrb/config.rb
|
|
107
|
+
- lib/fastrb/context.rb
|
|
108
|
+
- lib/fastrb/di.rb
|
|
109
|
+
- lib/fastrb/error_handler.rb
|
|
110
|
+
- lib/fastrb/job.rb
|
|
111
|
+
- lib/fastrb/middleware/logging.rb
|
|
112
|
+
- lib/fastrb/openapi.rb
|
|
113
|
+
- lib/fastrb/param_converters.rb
|
|
114
|
+
- lib/fastrb/plugin.rb
|
|
115
|
+
- lib/fastrb/plugins/auth.rb
|
|
116
|
+
- lib/fastrb/plugins/cache.rb
|
|
117
|
+
- lib/fastrb/plugins/cors.rb
|
|
118
|
+
- lib/fastrb/plugins/jwt.rb
|
|
119
|
+
- lib/fastrb/router.rb
|
|
120
|
+
- lib/fastrb/schema.rb
|
|
121
|
+
- lib/fastrb/serializer.rb
|
|
122
|
+
- lib/fastrb/session.rb
|
|
123
|
+
- lib/fastrb/sse.rb
|
|
124
|
+
- lib/fastrb/streaming.rb
|
|
125
|
+
- lib/fastrb/version.rb
|
|
126
|
+
- lib/fastrb/websocket.rb
|
|
127
|
+
homepage: https://github.com/BrunoMoreno/FastRb
|
|
128
128
|
licenses:
|
|
129
129
|
- MIT
|
|
130
130
|
metadata: {}
|
data/bin/rubyapi
DELETED
data/lib/rubyapi/version.rb
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|