nephos-server 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/nephos-generator +23 -14
- data/bin/nephos-server +29 -10
- data/lib/nephos-server.rb +7 -0
- data/lib/nephos-server/server/main.rb +1 -7
- data/lib/nephos-server/server/responder.rb +0 -2
- data/version +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0198ab59046527552ad7b7f66c25dcd04ca3727f
|
4
|
+
data.tar.gz: aeb7527f299c85860b4941a528c15635ed6024a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6aee265e6d6fb09239476dcb545c6ea282fea41ef548432cd28134d94bff3fdf6698399a933a8eca2411f30b08ae0452c9ec00301e8be989682d4feaa61b118
|
7
|
+
data.tar.gz: 66fc08b9fe7a964d87e34eb8e4113f0aa2d68eedc3127ef4f0374ff8a24fa6e5b96be526bd7ab78448fe87b39489e13bf68300b1c7818a1d4f38dd801b798ef6
|
data/bin/nephos-generator
CHANGED
@@ -45,19 +45,28 @@ def initialize_application
|
|
45
45
|
exec("bundle install")
|
46
46
|
end
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
48
|
+
require 'optparse'
|
49
|
+
|
50
|
+
begin
|
51
|
+
OptionParser.new do |opts|
|
52
|
+
opts.banner = "Usage: nephos-generator [controller name] [appli [name]]"
|
53
|
+
end.parse!
|
54
|
+
|
55
|
+
case ARGV[0]
|
56
|
+
when "c", "controller"
|
57
|
+
if not ARGV[1].to_s.match(/[\w_\-\.]+/)
|
58
|
+
generate_controller("#{ARGV[1]}Controller", "src/#{ARGV[1]}.rb")
|
59
|
+
end
|
60
|
+
when "a", "appli", "application"
|
61
|
+
if not ARGV[1].to_s.empty?
|
62
|
+
create_application_dir(ARGV[1])
|
63
|
+
puts "Application #{ARGV[1]} created"
|
64
|
+
move_to_application_dir(ARGV[1])
|
65
|
+
end
|
66
|
+
initialize_application
|
67
|
+
puts "Application initialized"
|
58
68
|
end
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
puts "help: generate c[ontroller] name"
|
69
|
+
|
70
|
+
rescue => err
|
71
|
+
puts "Error: #{err.message}"
|
63
72
|
end
|
data/bin/nephos-server
CHANGED
@@ -1,17 +1,36 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
# require_relative "../lib/nephos-server"
|
4
|
-
require 'nephos-server'
|
5
|
-
|
6
3
|
require 'optparse'
|
7
4
|
|
8
|
-
|
9
|
-
|
5
|
+
begin
|
6
|
+
OptionParser.new do |opts|
|
7
|
+
opts.banner = "Usage: nephos-server [-p=port] [--debug]"
|
8
|
+
|
9
|
+
$server_port = ENV["SERVER_PORT"] || 8080
|
10
|
+
opts.on("-p=nb", "--port=nb", "Port") do |port|
|
11
|
+
$server_port = Integer(port)
|
12
|
+
end
|
13
|
+
|
14
|
+
opts.on("--debug") do
|
15
|
+
$debug = true
|
16
|
+
end
|
17
|
+
|
18
|
+
end.parse!
|
10
19
|
|
11
|
-
$
|
12
|
-
|
13
|
-
|
20
|
+
if $debug
|
21
|
+
require_relative "../lib/nephos-server"
|
22
|
+
else
|
23
|
+
require 'nephos-server'
|
14
24
|
end
|
15
|
-
end.parse!
|
16
25
|
|
17
|
-
|
26
|
+
if not $debug and
|
27
|
+
(not File.exists? "Gemfile.lock" or
|
28
|
+
not File.read("Gemfile.lock").split.index("nephos-server"))
|
29
|
+
raise InvalidApplicationError
|
30
|
+
end
|
31
|
+
|
32
|
+
Nephos::Server.start($server_port)
|
33
|
+
|
34
|
+
rescue => err
|
35
|
+
puts "Error: #{err.message}"
|
36
|
+
end
|
data/lib/nephos-server.rb
CHANGED
data/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|