fastrb 0.2.0 → 0.2.1
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/lib/fastrb/cli.rb +10 -8
- data/lib/fastrb/version.rb +1 -1
- metadata +30 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5bd8a42d176cd81c91138c9fe6496d63a28e042fc82199efe5106bceadb7797a
|
|
4
|
+
data.tar.gz: 5cf1b0323b4f8824555bcf6d21c22542fa9766cdf719bbc30debf692644cd7ef
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 151d228fad9bd6f36828dcae5a3f355e48cb8d8d8addadb62c29ec75fe951b3df9314b5aa9b730dbf7caea3c7d03b412766aa1b02747679baa1dc92bbc5478a8
|
|
7
|
+
data.tar.gz: d424fc566c2d93cac6c4acbe4b0e96a334ad44d04a0537f56e9ab34b2a6b9bab9ce5350b6349fcd831243600b018d9cd24feee73bf0da1a73398a2b5fd2c7217
|
data/lib/fastrb/cli.rb
CHANGED
|
@@ -48,7 +48,13 @@ module RubyAPI
|
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
def self.start_server
|
|
51
|
-
|
|
51
|
+
require "rackup"
|
|
52
|
+
rackup_file = File.join(Dir.pwd, "config.ru")
|
|
53
|
+
unless File.exist?(rackup_file)
|
|
54
|
+
puts "Error: config.ru not found in current directory"
|
|
55
|
+
exit 1
|
|
56
|
+
end
|
|
57
|
+
Rackup::Server.start(config: rackup_file, Host: "0.0.0.0", Port: 3000)
|
|
52
58
|
end
|
|
53
59
|
|
|
54
60
|
private
|
|
@@ -79,11 +85,7 @@ module RubyAPI
|
|
|
79
85
|
class App < RubyAPI::App
|
|
80
86
|
def initialize
|
|
81
87
|
super do
|
|
82
|
-
|
|
83
|
-
# use MyMiddleware
|
|
84
|
-
|
|
85
|
-
# Routes
|
|
86
|
-
include Routes
|
|
88
|
+
Routes.apply(self)
|
|
87
89
|
end
|
|
88
90
|
end
|
|
89
91
|
end
|
|
@@ -93,8 +95,8 @@ module RubyAPI
|
|
|
93
95
|
def self.routes_rb_content
|
|
94
96
|
<<~RUBY
|
|
95
97
|
module Routes
|
|
96
|
-
def self.
|
|
97
|
-
|
|
98
|
+
def self.apply(app)
|
|
99
|
+
app.get "/hello" do
|
|
98
100
|
{ message: "Hello World" }
|
|
99
101
|
end
|
|
100
102
|
end
|
data/lib/fastrb/version.rb
CHANGED
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.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bruno Queiroz
|
|
@@ -23,6 +23,34 @@ dependencies:
|
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
25
|
version: '3.0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: rackup
|
|
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'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: webrick
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
26
54
|
- !ruby/object:Gem::Dependency
|
|
27
55
|
name: bigdecimal
|
|
28
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -142,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
142
170
|
- !ruby/object:Gem::Version
|
|
143
171
|
version: '0'
|
|
144
172
|
requirements: []
|
|
145
|
-
rubygems_version: 4.0.
|
|
173
|
+
rubygems_version: 4.0.6
|
|
146
174
|
specification_version: 4
|
|
147
175
|
summary: A FastAPI-inspired web framework for Ruby
|
|
148
176
|
test_files: []
|