yaframework 0.4.6 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b91dd4a4391f3f01d24edba73230b3831874bb2449c321e7ae795b47334ef68
4
- data.tar.gz: 8e3f1e8c24751c1591aad3c9d6602a51d270ab21ec574621dedc3a8a1a9c6df4
3
+ metadata.gz: 4aec9734b89fbd8a9c87fb63506f49f53df83c0f141efd612d5cdceb9d4d8c64
4
+ data.tar.gz: 8d43e4889c14798d20400ae36bfa9c6b76797bf7348eac539d85c690dcf250a3
5
5
  SHA512:
6
- metadata.gz: adfc2c9f9cc37361d5be76853ff5d42435748fbe3e2816f47d4163303c013f428f793a26dd080a7e7fd65119e1f5910ab50f49aee735fdb57a5d3fed49f7fdd5
7
- data.tar.gz: 77677d979203ecda92b147618823084b0e054f2aec87feeb322624529415ac6bad573e739eaa09a1b2946c8903fe27fa205f6ac4521e7c5d86778cff32155457
6
+ metadata.gz: 00af9a420fd2edffe78d77d6a2ecfc81973cbadb9543424153a6a5e689409a06d4c98a5ff54e7ddbda2a122cbe3bcd2d5b563968f8820738c6f21747269201d7
7
+ data.tar.gz: ba55916ef3b9776ab8711e82af51406b5d4e00b6991acf04418fc1526f6a0aa803757b9744296180843cf201534f4ed14292ac2f738a92d00bb8d5ad11bf6925
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.4.7] - 2021-07-25
2
+
3
+ - Handling 404 error fixed
4
+
1
5
  ## [0.4.6] - 2021-07-25
2
6
 
3
7
  - Content duplication fixed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yaframework (0.4.6)
4
+ yaframework (0.4.7)
5
5
  rack (~> 2.2, >= 2.2.3)
6
6
 
7
7
  GEM
@@ -8,7 +8,8 @@ app.get "/" do
8
8
  end
9
9
 
10
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>,
11
+ response.html "This is <b>HTML</b>, where you cat use some <small>tags</small>.
12
+ <br/>JSON <a href=\"/json\">here</a>,
12
13
  <br/>Plain text <a href=\"/text\">here</a>"
13
14
  end
14
15
 
data/examples/cookies.rb CHANGED
@@ -5,8 +5,12 @@ app = Yaframework::Application
5
5
 
6
6
  app.get "/" do
7
7
  response.set_cookie("foo", "bar")
8
-
8
+ "Your cookies, sir: #{response["Set-Cookie"]}.<br/>Go <a href=\"/delete\">here</a> to delete them"
9
9
  end
10
10
 
11
+ app.get "/delete" do
12
+ response.delete_cookie("foo")
13
+ "Your cookies, sir: #{response["Set-Cookie"]}"
14
+ end
11
15
 
12
16
  app.listen(4567)
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "yaframework"
3
+ require_relative "../lib/yaframework"
4
4
  app = Yaframework::Application
5
5
 
6
6
  app.get "/" do
7
- "This is the root, go somewhere else"
7
+ "This is the root, go somewhere else..<br/>Maybe <a href=\"/asdfg\">here</a>, idk"
8
8
  end
9
9
 
10
10
  app.handle 404 do
11
- "Hey, I just handled a 404 error!"
11
+ "Hey, I just handled a 404 error!<br/>The dude from the previous page deceived you!"
12
12
  end
13
13
 
14
14
  app.handle 500 do
@@ -55,17 +55,15 @@ module Yaframework
55
55
  end
56
56
 
57
57
  def route_eval
58
+ route = find_route
59
+ response.status = 404 unless route
60
+
58
61
  if @inbox[response.status]
59
62
  response.write instance_eval(&@inbox[response.status])
60
63
  return response.finish
61
64
  end
62
65
 
63
- route = find_route
64
- if route
65
- response.write instance_eval(&route[:handler])
66
- else
67
- response.status = 404
68
- end
66
+ response.write instance_eval(&route[:handler]) if route
69
67
  response.finish
70
68
  end
71
69
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yaframework
4
- VERSION = "0.4.6"
4
+ VERSION = "0.4.7"
5
5
  end
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.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - maxbarsukov