nephos-server 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG +3 -0
- data/README.md +0 -3
- data/bin/nephos-generator +1 -1
- data/bin/nephos-server +4 -0
- data/bin/nephos-status +1 -1
- data/lib/nephos-server/bin-helpers.rb +1 -1
- data/lib/nephos-server/params.rb +0 -1
- data/lib/nephos-server/router/main.rb +7 -2
- data/test/functional/generator.rb +4 -4
- data/version +1 -1
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10540f776d9a5acd8ff72ca285a8e44162950e21
|
4
|
+
data.tar.gz: fda28610fc278e8dd86019a6e82158e50f4bed67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86bf3706de8ccddc30940377de8d7b367c980765185e200b0957e959a9eb332717d9d6449c6387e177d86c1e7a9eb6b69ad2ff3380101e189ef6392d4a1d6d3d
|
7
|
+
data.tar.gz: 2bf5fe5135a715057d1828ad87eea7c2354641d76afd3dc3280e14cf72a9e31784d81b5a19f85a814f2d2a6b3795f87747cb9ba0301fb65afb835a5ce4183ea7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
data/bin/nephos-generator
CHANGED
@@ -105,7 +105,7 @@ EOF
|
|
105
105
|
|
106
106
|
module Application
|
107
107
|
def self.create_application_dir dir
|
108
|
-
raise BinError, "Directory #{dir} already exists" if Dir.
|
108
|
+
raise BinError, "Directory #{dir} already exists" if Dir.exist? dir and dir != "."
|
109
109
|
Dir.mkdir dir
|
110
110
|
end
|
111
111
|
|
data/bin/nephos-server
CHANGED
data/bin/nephos-status
CHANGED
@@ -12,7 +12,7 @@ module Nephos
|
|
12
12
|
# note: if the Gemfile includes nephos and not nephos-server,
|
13
13
|
# it will work anyway, because nephos require nephos-server
|
14
14
|
def self.is_a_valid_application? dir="."
|
15
|
-
return false if not Dir.
|
15
|
+
return false if not Dir.exist? dir
|
16
16
|
gfl = File.expand_path "Gemfile.lock", dir
|
17
17
|
return false if not File.exist? gfl
|
18
18
|
return false if not File.read(gfl).split.index("nephos-server")
|
data/lib/nephos-server/params.rb
CHANGED
@@ -22,10 +22,13 @@ module Nephos
|
|
22
22
|
# render the return of a call to Controller.new.method.
|
23
23
|
# Controller and method are stored on call via the keys :controller and :method
|
24
24
|
def render_controller req, call
|
25
|
-
|
25
|
+
out = @responder.render_from_controller(req, call)
|
26
|
+
STDERR.puts "<--- #{out.body}" if $verbose == "output"
|
27
|
+
return out
|
26
28
|
end
|
27
29
|
|
28
30
|
def render_error(req, code, err=nil)
|
31
|
+
STDERR.puts "Error #{code}" if $verbose == "output"
|
29
32
|
if Nephos.env == "production"
|
30
33
|
return @responder.render(status: code)
|
31
34
|
elsif err
|
@@ -41,6 +44,7 @@ module Nephos
|
|
41
44
|
end
|
42
45
|
|
43
46
|
def error_custom(req, code, default=nil)
|
47
|
+
STDERR.puts "Error #{code}" if $verbose == "output"
|
44
48
|
if File.exist? "app/#{code}.html"
|
45
49
|
@responder.render(status: code, html: File.read("app/#{code}.html"))
|
46
50
|
else
|
@@ -49,6 +53,7 @@ module Nephos
|
|
49
53
|
end
|
50
54
|
|
51
55
|
def error_404(req)
|
56
|
+
STDERR.puts "Error 404" if $verbose == "output"
|
52
57
|
out = error_custom(req, 404, "404 not found \"#{req.path}\"")
|
53
58
|
out.body[0].gsub!("INJECT_REQ_PATH", req.path)
|
54
59
|
return out
|
@@ -64,7 +69,7 @@ module Nephos
|
|
64
69
|
# Interface which handle the client query (stored in env), create a new
|
65
70
|
# {Controller} instance, and call the render on it
|
66
71
|
def execute(req)
|
67
|
-
env = req.env
|
72
|
+
#env = req.env
|
68
73
|
puts "#{req.env["REMOTE_ADDR"]} [#{req.request_method}] \t ---> \t #{req.path}" unless @silent
|
69
74
|
call = find_route(req)
|
70
75
|
# require 'pry'
|
@@ -4,10 +4,10 @@ class TestNephosServerGenerator < Test::Unit::TestCase
|
|
4
4
|
`rm -rf /tmp/nephos-server-test 2> /tmp/null`
|
5
5
|
|
6
6
|
`./bin/nephos-generator --test -a /tmp/nephos-server-test --no-build --no-git`
|
7
|
-
assert(Dir.
|
7
|
+
assert(Dir.exist? "/tmp/nephos-server-test")
|
8
8
|
assert(File.exist? "/tmp/nephos-server-test/Gemfile")
|
9
9
|
assert(File.exist? "/tmp/nephos-server-test/routes.rb")
|
10
|
-
assert(Dir.
|
10
|
+
assert(Dir.exist? "/tmp/nephos-server-test/app")
|
11
11
|
gemfile_data = File.read("/tmp/nephos-server-test/Gemfile").split("\n")
|
12
12
|
assert(gemfile_data.include? "gem 'nephos'")
|
13
13
|
`rm -rf /tmp/nephos-server-test 2> /tmp/null`
|
@@ -17,10 +17,10 @@ class TestNephosServerGenerator < Test::Unit::TestCase
|
|
17
17
|
`rm -rf /tmp/nephos-server-test 2> /tmp/null`
|
18
18
|
|
19
19
|
`./bin/nephos-generator --test -a /tmp/nephos-server-test --no-git`
|
20
|
-
assert(Dir.
|
20
|
+
assert(Dir.exist? "/tmp/nephos-server-test")
|
21
21
|
assert(File.exist? "/tmp/nephos-server-test/Gemfile")
|
22
22
|
assert(File.exist? "/tmp/nephos-server-test/routes.rb")
|
23
|
-
assert(Dir.
|
23
|
+
assert(Dir.exist? "/tmp/nephos-server-test/app")
|
24
24
|
gemfile_data = File.read("/tmp/nephos-server-test/Gemfile").split("\n")
|
25
25
|
assert(gemfile_data.include? "gem 'nephos'")
|
26
26
|
|
data/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.2
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nephos-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- poulet_a
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
tcYkgfqUJPitIJx1RvWZpIyH5uJhRUYK3+vU9nMOxez5WbIlC1TtpByKAPMX+sht
|
32
32
|
gib3AoIT8jh/2w==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-11-
|
34
|
+
date: 2015-11-09 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: nomorebeer
|
metadata.gz.sig
CHANGED
Binary file
|