nephos-server 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +3 -0
- data/README.md +9 -4
- data/lib/nephos-server/controller.rb +0 -1
- data/lib/nephos-server/router/main.rb +16 -2
- data/version +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd4f2176f42e827ebb36ac19f651e3adb12e7609
|
4
|
+
data.tar.gz: 99677cc04947d8c967c358d8e2cc8dab847e5879
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d609afb7b502b5ab9831f289b0029cecfbe0ea3ccf8c8c86686df86e575eb1021a8b73b7f39fc4449ce00cecd0c018b264f322d5cfcbce8977345bc65e67824
|
7
|
+
data.tar.gz: 1db01ad58ca2bec79883ca541b8e6d6bd436fea5622b4f0fe193fdcecc1864a917ea3595fe7c8347d0678be3d5d30e4168f5d462ecfdbda00f85886f78b3f291
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -46,6 +46,7 @@ Theses guides will provide you knowlegde about everything you can use in the app
|
|
46
46
|
- [Render API](DOCUMENTATION/API_RENDER.md)
|
47
47
|
- [Router GUIDE](DOCUMENTATION/GUIDE_ROUTER.md)
|
48
48
|
- [Controller GUIDE](DOCUMENTATION/GUIDE_CONTROLLER.md)
|
49
|
+
- [Customisable errors GUIDE](DOCUMENTATION/GUIDE_ERRORS.md)
|
49
50
|
- [Code documentation on RubyDoc.info](http://www.rubydoc.info/gems/nephos-server/toplevel) -> **Note: you can also generate local documentation via yard**
|
50
51
|
|
51
52
|
## Examples
|
@@ -109,24 +110,28 @@ end
|
|
109
110
|
|
110
111
|
# Developers: Roadmap
|
111
112
|
|
112
|
-
## TODO v0.5
|
113
|
-
|
114
113
|
## TODO v0.6
|
115
|
-
- startable as daemon
|
116
114
|
- feature to change HTTP header from controller
|
117
|
-
- customisable default 404 errors and 500 errors
|
118
115
|
- functionnal tests
|
119
116
|
|
117
|
+
## TODO v0.7
|
118
|
+
- Documentation on architecture (UML)
|
119
|
+
- Improved documentation (Tutorial, Improved guides)
|
120
|
+
- Alias for routing
|
121
|
+
|
120
122
|
## v1 requierements
|
121
123
|
- Environement, Daemons, Port, Listen Host, Routables, Arguments
|
124
|
+
- Clear architecture
|
122
125
|
- Generator readables and powerfull
|
123
126
|
- At least 80% tests coverage
|
127
|
+
- Performances benchmark
|
124
128
|
- Guide about
|
125
129
|
- Controllers
|
126
130
|
- Routing
|
127
131
|
- Api Creation
|
128
132
|
- Database creation
|
129
133
|
- Web HTML with templating
|
134
|
+
- Clear documentation on the features using regexp, options, ...
|
130
135
|
|
131
136
|
Gitlab Continuous Integration:
|
132
137
|
[![Gitlab Tests](https://gitlab.com/ci/projects/8973/status.png?ref=master)](https://gitlab.com/ci/projects/8973?ref=master)
|
@@ -40,6 +40,20 @@ module Nephos
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
+
def error_custom(req, code, default=nil)
|
44
|
+
if File.exists? "app/#{code}.html"
|
45
|
+
@responder.render(status: code, html: File.read("app/#{code}.html"))
|
46
|
+
else
|
47
|
+
render_error(req, code, default || "Error: #{req.status}")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def error_404(req)
|
52
|
+
out = error_custom(req, 404, "404 not found \"#{req.path}\"")
|
53
|
+
out.body[0].gsub!("INJECT_REQ_PATH", req.path)
|
54
|
+
return out
|
55
|
+
end
|
56
|
+
|
43
57
|
# @param path [Array]
|
44
58
|
#
|
45
59
|
# Find the right route to use from the url
|
@@ -53,13 +67,13 @@ module Nephos
|
|
53
67
|
env = req.env
|
54
68
|
puts "#{req.env["REMOTE_ADDR"]} [#{req.request_method}] \t ---> \t #{req.path}" unless @silent
|
55
69
|
call = find_route(req)
|
56
|
-
return
|
70
|
+
return error_404(req) if call.nil?
|
57
71
|
begin
|
58
72
|
return render_controller(req, call)
|
59
73
|
rescue => err
|
60
74
|
STDERR.puts "Error: #{err.message}"
|
61
75
|
STDERR.puts err.backtrace
|
62
|
-
return
|
76
|
+
return error_custom(req, 500, "Error: 500\n#{err.message}\n---Backtrace---\n#{err.backtrace.join("\n")}\n")
|
63
77
|
end
|
64
78
|
end
|
65
79
|
|
data/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.3
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nephos-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- poulet_a
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nomorebeer
|