yaframework 0.4.5 → 0.4.6
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/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +7 -7
- data/examples/{halts-and-redirects/Gemfile → Gemfile} +0 -0
- data/examples/README.md +15 -4
- data/examples/content_types.rb +23 -0
- data/examples/cookies.rb +12 -0
- data/examples/error_handling.rb +18 -0
- data/examples/{halts-and-redirects/app.rb → halts_and_redirects.rb} +0 -0
- data/examples/headers.rb +11 -0
- data/examples/{hello-world/app.rb → hello_world.rb} +1 -0
- data/examples/{params/app.rb → params.rb} +3 -1
- data/lib/yaframework/response.rb +1 -0
- data/lib/yaframework/version.rb +1 -1
- metadata +9 -13
- data/examples/halts-and-redirects/README.md +0 -12
- data/examples/halts-and-redirects/config.ru +0 -6
- data/examples/hello-world/Gemfile +0 -5
- data/examples/hello-world/README.md +0 -12
- data/examples/hello-world/config.ru +0 -6
- data/examples/params/Gemfile +0 -5
- data/examples/params/README.md +0 -12
- data/examples/params/config.ru +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b91dd4a4391f3f01d24edba73230b3831874bb2449c321e7ae795b47334ef68
|
4
|
+
data.tar.gz: 8e3f1e8c24751c1591aad3c9d6602a51d270ab21ec574621dedc3a8a1a9c6df4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adfc2c9f9cc37361d5be76853ff5d42435748fbe3e2816f47d4163303c013f428f793a26dd080a7e7fd65119e1f5910ab50f49aee735fdb57a5d3fed49f7fdd5
|
7
|
+
data.tar.gz: 77677d979203ecda92b147618823084b0e054f2aec87feeb322624529415ac6bad573e739eaa09a1b2946c8903fe27fa205f6ac4521e7c5d86778cff32155457
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
yaframework (0.4.
|
4
|
+
yaframework (0.4.6)
|
5
5
|
rack (~> 2.2, >= 2.2.3)
|
6
6
|
|
7
7
|
GEM
|
@@ -10,29 +10,29 @@ GEM
|
|
10
10
|
ast (2.4.2)
|
11
11
|
minitest (5.14.4)
|
12
12
|
parallel (1.20.1)
|
13
|
-
parser (3.0.
|
13
|
+
parser (3.0.1.1)
|
14
14
|
ast (~> 2.4.1)
|
15
15
|
rack (2.2.3)
|
16
16
|
rainbow (3.0.0)
|
17
|
-
rake (13.0.
|
17
|
+
rake (13.0.3)
|
18
18
|
regexp_parser (2.1.1)
|
19
19
|
rexml (3.2.5)
|
20
|
-
rubocop (1.18.
|
20
|
+
rubocop (1.18.2)
|
21
21
|
parallel (~> 1.10)
|
22
22
|
parser (>= 3.0.0.0)
|
23
23
|
rainbow (>= 2.2.2, < 4.0)
|
24
24
|
regexp_parser (>= 1.8, < 3.0)
|
25
25
|
rexml
|
26
|
-
rubocop-ast (>= 1.
|
26
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
27
27
|
ruby-progressbar (~> 1.7)
|
28
28
|
unicode-display_width (>= 1.4.0, < 3.0)
|
29
|
-
rubocop-ast (1.
|
29
|
+
rubocop-ast (1.7.0)
|
30
30
|
parser (>= 3.0.1.1)
|
31
31
|
ruby-progressbar (1.11.0)
|
32
32
|
unicode-display_width (2.0.0)
|
33
33
|
|
34
34
|
PLATFORMS
|
35
|
-
|
35
|
+
x86_64-linux
|
36
36
|
|
37
37
|
DEPENDENCIES
|
38
38
|
bundler (>= 2.2.10)
|
File without changes
|
data/examples/README.md
CHANGED
@@ -2,16 +2,27 @@
|
|
2
2
|
|
3
3
|
Here are some examples of applications created with Yaframework:
|
4
4
|
|
5
|
-
1.
|
5
|
+
1. [**Hello World**](https://github.com/maxbarsukov/yaframework/tree/master/examples/hello_world.rb)
|
6
6
|
|
7
|
-
A simple application that displays "Hello world" to you.
|
7
|
+
A simple application that displays "Hello world" to you. Go to `http://localhost:4567/` and see `Hello World`!
|
8
8
|
|
9
9
|
|
10
|
-
2.
|
10
|
+
2. [**Params**](https://github.com/maxbarsukov/yaframework/tree/master/examples/params.rb)
|
11
11
|
|
12
12
|
Shows how the application parameters can be used
|
13
13
|
|
14
14
|
|
15
|
-
3.
|
15
|
+
3. [**Halts and Redirects**](https://github.com/maxbarsukov/yaframework/tree/master/examples/halts_and_redirects.rb)
|
16
16
|
|
17
17
|
Shows how to use halts and redirects
|
18
|
+
|
19
|
+
|
20
|
+
## Installation
|
21
|
+
|
22
|
+
Clone this repo and go to this folder.
|
23
|
+
Then, run `bundle install` to install this gem.
|
24
|
+
|
25
|
+
## Run
|
26
|
+
|
27
|
+
Run with `ruby hello-world.rb` or any other file and view at http://localhost:4567
|
28
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "yaframework"
|
4
|
+
app = Yaframework::Application
|
5
|
+
|
6
|
+
app.get "/" do
|
7
|
+
response.redirect "/html"
|
8
|
+
end
|
9
|
+
|
10
|
+
app.get "/html" do
|
11
|
+
response.html "This is <b>HTML</b>, where you cat use some <small>tags</small>.<br/>JSON <a href=\"/json\">here</a>,
|
12
|
+
<br/>Plain text <a href=\"/text\">here</a>"
|
13
|
+
end
|
14
|
+
|
15
|
+
app.get "/text" do
|
16
|
+
response.text "Just plain text.<br/>Boring, even tags don't work..."
|
17
|
+
end
|
18
|
+
|
19
|
+
app.get "/json" do
|
20
|
+
response.json "{ \"The awesomeness of this framework\": \"100/100\" }"
|
21
|
+
end
|
22
|
+
|
23
|
+
app.listen(4567)
|
data/examples/cookies.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "yaframework"
|
4
|
+
app = Yaframework::Application
|
5
|
+
|
6
|
+
app.get "/" do
|
7
|
+
"This is the root, go somewhere else"
|
8
|
+
end
|
9
|
+
|
10
|
+
app.handle 404 do
|
11
|
+
"Hey, I just handled a 404 error!"
|
12
|
+
end
|
13
|
+
|
14
|
+
app.handle 500 do
|
15
|
+
"Error 500, this shouldn't have happened..."
|
16
|
+
end
|
17
|
+
|
18
|
+
app.listen(4567)
|
File without changes
|
data/examples/headers.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "yaframework"
|
4
|
+
app = Yaframework::Application
|
5
|
+
|
6
|
+
app.get "/" do
|
7
|
+
request[:username] = "IVAN!"
|
8
|
+
"Now 'request[:username]': #{request[:username]} contains in 'request.params': #{request.params}"
|
9
|
+
end
|
10
|
+
|
11
|
+
app.listen(4567)
|
@@ -3,11 +3,13 @@
|
|
3
3
|
require "yaframework"
|
4
4
|
app = Yaframework::Application
|
5
5
|
|
6
|
+
# Any route, like /max or /ivan
|
6
7
|
app.get "/:name" do
|
7
8
|
"Hello #{request.params[:name]}!"
|
8
9
|
end
|
9
10
|
|
10
|
-
|
11
|
+
# You can try /max/from/rnd and see it with your own eyes
|
12
|
+
app.get "/:name/from/:bar" do
|
11
13
|
"Hello #{request.params[:name]} from #{request.params[:bar]}!"
|
12
14
|
end
|
13
15
|
|
data/lib/yaframework/response.rb
CHANGED
data/lib/yaframework/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaframework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- maxbarsukov
|
@@ -105,19 +105,15 @@ files:
|
|
105
105
|
- Rakefile
|
106
106
|
- bin/console
|
107
107
|
- bin/setup
|
108
|
+
- examples/Gemfile
|
108
109
|
- examples/README.md
|
109
|
-
- examples/
|
110
|
-
- examples/
|
111
|
-
- examples/
|
112
|
-
- examples/
|
113
|
-
- examples/
|
114
|
-
- examples/
|
115
|
-
- examples/
|
116
|
-
- examples/hello-world/config.ru
|
117
|
-
- examples/params/Gemfile
|
118
|
-
- examples/params/README.md
|
119
|
-
- examples/params/app.rb
|
120
|
-
- examples/params/config.ru
|
110
|
+
- examples/content_types.rb
|
111
|
+
- examples/cookies.rb
|
112
|
+
- examples/error_handling.rb
|
113
|
+
- examples/halts_and_redirects.rb
|
114
|
+
- examples/headers.rb
|
115
|
+
- examples/hello_world.rb
|
116
|
+
- examples/params.rb
|
121
117
|
- lib/yaframework.rb
|
122
118
|
- lib/yaframework/base.rb
|
123
119
|
- lib/yaframework/request.rb
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# Hello world
|
2
|
-
|
3
|
-
A simple application that displays "Hello world" to you.
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Clone this repo and go to this folder.
|
8
|
-
Then, run `bundle install` to install this gem.
|
9
|
-
|
10
|
-
## Run
|
11
|
-
|
12
|
-
Run with `ruby app.rb` or `rackup` and view at http://localhost:4567
|
data/examples/params/Gemfile
DELETED
data/examples/params/README.md
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# Params
|
2
|
-
|
3
|
-
Shows how the application parameters can be used
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Clone this repo and go to this folder.
|
8
|
-
Then, run `bundle install` to install this gem.
|
9
|
-
|
10
|
-
## Run
|
11
|
-
|
12
|
-
Run with `ruby app.rb` or `rackup` and view at http://localhost:4567
|