nephos-server 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 +4 -4
- data/CHANGELOG +5 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +2 -0
- data/README.md +1 -4
- data/bin/nephos-generator +6 -3
- data/bin/nephos-server +6 -1
- data/lib/nephos-server.rb +5 -0
- data/nephos-server.gemspec +1 -0
- data/test/generator.rb +5 -0
- data/version +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c19caddb625aa364f4db457946e82f11c9677cad
|
4
|
+
data.tar.gz: cfbda59dc9b76f3127738802b8fa5e32c7195daa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 976ab4a4c50704d349a41c47bc2d62f8d2ce8c358ad27ad6812dc122d3cbe09cbd375d22725a6002f524f616a9557e3484b54a69655ec747df4fd57858a9972c
|
7
|
+
data.tar.gz: 976677fcea7eee326490ef4811b6087e8d7403fed10952566370c29703dc8fc616c4abf0d73f65cd84151845e79efe4d12e68f15c3eda3bc4152120e3a4839b3
|
data/CHANGELOG
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -109,12 +109,9 @@ end
|
|
109
109
|
# Developers: Roadmap
|
110
110
|
|
111
111
|
## TODO v0.4
|
112
|
-
- improve generator with application
|
113
|
-
- improved render status
|
112
|
+
- improve generator with application tests
|
114
113
|
- improve executables (tests, arguments)
|
115
114
|
- improve documentation (bin)
|
116
|
-
- improve controller generator (names's case)
|
117
|
-
- environnementable
|
118
115
|
|
119
116
|
## TODO v0.5
|
120
117
|
- executables with version
|
data/bin/nephos-generator
CHANGED
@@ -70,7 +70,10 @@ module Nephos
|
|
70
70
|
end
|
71
71
|
|
72
72
|
module Controller
|
73
|
-
def self.generate!(
|
73
|
+
def self.generate!(ctr)
|
74
|
+
uname = "#{ctr[0].upcase}#{ctr[1..-1]}Controller".gsub(/ControllerController$/, "Controller")
|
75
|
+
lname = uname.gsub(/([A-Z])/, '_\1')[1..-1].downcase
|
76
|
+
file = "app/#{lname}.rb"
|
74
77
|
raise_invalid_appli
|
75
78
|
if File.exists? file
|
76
79
|
print "The file #{file} already exists. Are you sure to erase it ? (y/N)"
|
@@ -79,7 +82,7 @@ module Nephos
|
|
79
82
|
end
|
80
83
|
f = File.open(file, 'w')
|
81
84
|
f << <<EOF
|
82
|
-
class #{
|
85
|
+
class #{uname} < Nephos::Controller
|
83
86
|
def root
|
84
87
|
return {plain: "index"}
|
85
88
|
end
|
@@ -120,7 +123,7 @@ EOF
|
|
120
123
|
case opt[0]
|
121
124
|
when "c", "controller"
|
122
125
|
if opt[1].to_s.match(/[\w\-\.]+/)
|
123
|
-
Controller.generate!(
|
126
|
+
Controller.generate!(opt[1])
|
124
127
|
else
|
125
128
|
puts "error"
|
126
129
|
end
|
data/bin/nephos-server
CHANGED
@@ -19,6 +19,11 @@ begin
|
|
19
19
|
$server_host = host
|
20
20
|
end
|
21
21
|
|
22
|
+
$server_env = ENV["ENVIRONMENT"] || "development"
|
23
|
+
opts.on("-e=env", "--env=env", "Environment") do |env|
|
24
|
+
$server_env = env
|
25
|
+
end
|
26
|
+
|
22
27
|
opts.on("--debug") do
|
23
28
|
$debug = true
|
24
29
|
end
|
@@ -36,7 +41,7 @@ begin
|
|
36
41
|
raise InvalidApplication
|
37
42
|
end
|
38
43
|
|
39
|
-
puts "Running Nephos::Server version #{Nephos::VERSION}"
|
44
|
+
puts "Running Nephos::Server version #{Nephos::VERSION} (#{Nephos.env})"
|
40
45
|
Nephos::Server.start($server_port, $server_host)
|
41
46
|
|
42
47
|
rescue RoutingError => err
|
data/lib/nephos-server.rb
CHANGED
data/nephos-server.gemspec
CHANGED
data/test/generator.rb
CHANGED
@@ -17,6 +17,11 @@ class TestNephosServerGenerator < Test::Unit::TestCase
|
|
17
17
|
`nephos-generator c test --debug`
|
18
18
|
assert File.exists? "app/test_controller.rb"
|
19
19
|
assert_equal "class TestController < Nephos::Controller", File.read("app/test_controller.rb").split("\n").first
|
20
|
+
`rm -f app/test_controller.rb`
|
21
|
+
|
22
|
+
`nephos-generator c testController --debug`
|
23
|
+
assert File.exists? "app/test_controller.rb"
|
24
|
+
assert_equal "class TestController < Nephos::Controller", File.read("app/test_controller.rb").split("\n").first
|
20
25
|
`rm -f app/test_controller.rb`
|
21
26
|
end
|
22
27
|
|
data/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.7
|
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.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- poulet_a
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: puma
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.13'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.13'
|
55
69
|
description: " a minimalist server, based on rack/puma, with routing, rendering, and
|
56
70
|
controllers. Designed for quick api."
|
57
71
|
email:
|
@@ -148,6 +162,6 @@ rubyforge_project:
|
|
148
162
|
rubygems_version: 2.4.8
|
149
163
|
signing_key:
|
150
164
|
specification_version: 4
|
151
|
-
summary: "* improve
|
152
|
-
|
165
|
+
summary: "* improve controller generator (names) * add puma to change the default
|
166
|
+
web server * add environments"
|
153
167
|
test_files: []
|