webcommand 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Gemfile.lock +3 -7
- data/lib/webcommand.rb +1 -0
- data/lib/webcommand/cli.rb +10 -7
- data/lib/webcommand/server/adapters/webrick.rb +23 -0
- data/lib/webcommand/version.rb +1 -1
- data/webcommand.gemspec +1 -2
- metadata +5 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ab170912e3f5f6894da78adc829a98a2af5a244cf254c1bbce200506fcceda1
|
4
|
+
data.tar.gz: d69a2d9ce59c2d13a46d388ce20a313d3b472cdc6b5007cfb56cb1960876a427
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c5803beb7e93505a2941cb79b055b2bc8ec98e8893994ebf7dc5e492af284b1eb31fb625b4d951816a0a4b960d4508c1df71bc7eaf8c36e67e4eca247dea7a9
|
7
|
+
data.tar.gz: 8859ab578c0fbcf0f4e39c070f27ce8191797a478736ce671d52f61f4927f64295ad71faf9b3c7ccfa8a8b2b50aaaac9bce8a95769b806336ac2941641dad64b
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
webcommand (0.1.
|
4
|
+
webcommand (0.1.4)
|
5
5
|
mustache (~> 1.0)
|
6
|
-
puma (>= 4.2.1, < 4.4.0)
|
7
6
|
rack-contrib (~> 2.1.0)
|
8
7
|
sinatra (~> 2.0.7)
|
9
8
|
thor (~> 0.20.3)
|
@@ -35,7 +34,6 @@ GEM
|
|
35
34
|
mustache (1.1.1)
|
36
35
|
mustermann (1.1.1)
|
37
36
|
ruby2_keywords (~> 0.0.1)
|
38
|
-
nio4r (2.5.2)
|
39
37
|
parser (2.6.5.0)
|
40
38
|
ast (~> 2.4.0)
|
41
39
|
pastel (0.7.3)
|
@@ -49,8 +47,6 @@ GEM
|
|
49
47
|
pry (0.12.2)
|
50
48
|
coderay (~> 1.1.0)
|
51
49
|
method_source (~> 0.9.0)
|
52
|
-
puma (4.2.1)
|
53
|
-
nio4r (~> 2.0)
|
54
50
|
rack (2.0.8)
|
55
51
|
rack-contrib (2.1.0)
|
56
52
|
rack (~> 2.0)
|
@@ -58,7 +54,7 @@ GEM
|
|
58
54
|
rack
|
59
55
|
rack-test (1.1.0)
|
60
56
|
rack (>= 1.0, < 3)
|
61
|
-
rake (
|
57
|
+
rake (13.0.1)
|
62
58
|
rspec (3.9.0)
|
63
59
|
rspec-core (~> 3.9.0)
|
64
60
|
rspec-expectations (~> 3.9.0)
|
@@ -112,7 +108,7 @@ DEPENDENCIES
|
|
112
108
|
byebug
|
113
109
|
pry
|
114
110
|
rack-test
|
115
|
-
rake (~>
|
111
|
+
rake (~> 13.0)
|
116
112
|
rspec (~> 3.0)
|
117
113
|
rspec-parameterized
|
118
114
|
simplecov
|
data/lib/webcommand.rb
CHANGED
@@ -10,6 +10,7 @@ require 'pathname'
|
|
10
10
|
require_relative 'webcommand/extensions/hash_extension'
|
11
11
|
require_relative 'webcommand/command'
|
12
12
|
require_relative 'webcommand/server'
|
13
|
+
require_relative 'webcommand/server/adapters/webrick'
|
13
14
|
require_relative 'webcommand/config'
|
14
15
|
require_relative 'webcommand/commands'
|
15
16
|
require_relative 'webcommand/cli'
|
data/lib/webcommand/cli.rb
CHANGED
@@ -1,16 +1,19 @@
|
|
1
1
|
module Webcommand
|
2
2
|
class CLI < Thor
|
3
|
+
SERVER_ADAPTERS = {
|
4
|
+
'webrick' => Webcommand::Server::Adapters::Webrick
|
5
|
+
}.freeze
|
6
|
+
|
3
7
|
desc "server", "Start the Webcommand server"
|
4
8
|
option :port, aliases: :p, default: 9292
|
5
9
|
option :bind, aliases: :b, default: '0.0.0.0'
|
6
|
-
option :
|
7
|
-
|
10
|
+
option :adapter, type: :string, enum: SERVER_ADAPTERS.keys, default: 'webrick'
|
11
|
+
|
8
12
|
def server
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
"#{Webcommand.root_path.join('config.ru')}"
|
13
|
+
server_adapter = SERVER_ADAPTERS[options[:adapter]]
|
14
|
+
server = server_adapter.new(Webcommand::Server, options)
|
15
|
+
|
16
|
+
server.start
|
14
17
|
end
|
15
18
|
end
|
16
19
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Webcommand
|
2
|
+
class Server
|
3
|
+
module Adapters
|
4
|
+
class Webrick
|
5
|
+
def initialize(server, options)
|
6
|
+
require 'webrick'
|
7
|
+
@server = server
|
8
|
+
@options = options
|
9
|
+
end
|
10
|
+
|
11
|
+
def start
|
12
|
+
server = WEBrick::HTTPServer.new(
|
13
|
+
Port: @options[:port],
|
14
|
+
BindAddress: @options[:bind])
|
15
|
+
server.mount "/", Rack::Handler::WEBrick, server
|
16
|
+
Signal.trap(:INT) { server.shutdown }
|
17
|
+
server.start
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
data/lib/webcommand/version.rb
CHANGED
data/webcommand.gemspec
CHANGED
@@ -29,10 +29,9 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_dependency "mustache", "~> 1.0"
|
30
30
|
spec.add_dependency "rack-contrib", "~> 2.1.0"
|
31
31
|
spec.add_dependency "tty-command", "~> 0.9.0"
|
32
|
-
spec.add_dependency "puma", ">= 4.2.1", "< 4.4.0"
|
33
32
|
spec.add_development_dependency "byebug"
|
34
33
|
spec.add_development_dependency "pry"
|
35
34
|
spec.add_development_dependency "bundler", "~> 2.0"
|
36
|
-
spec.add_development_dependency "rake", "~>
|
35
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
37
36
|
spec.add_development_dependency "rspec", "~> 3.0"
|
38
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webcommand
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Atkinson Ferreira Filho
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -80,26 +80,6 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 0.9.0
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: puma
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 4.2.1
|
90
|
-
- - "<"
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: 4.4.0
|
93
|
-
type: :runtime
|
94
|
-
prerelease: false
|
95
|
-
version_requirements: !ruby/object:Gem::Requirement
|
96
|
-
requirements:
|
97
|
-
- - ">="
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: 4.2.1
|
100
|
-
- - "<"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: 4.4.0
|
103
83
|
- !ruby/object:Gem::Dependency
|
104
84
|
name: byebug
|
105
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,14 +128,14 @@ dependencies:
|
|
148
128
|
requirements:
|
149
129
|
- - "~>"
|
150
130
|
- !ruby/object:Gem::Version
|
151
|
-
version: '
|
131
|
+
version: '13.0'
|
152
132
|
type: :development
|
153
133
|
prerelease: false
|
154
134
|
version_requirements: !ruby/object:Gem::Requirement
|
155
135
|
requirements:
|
156
136
|
- - "~>"
|
157
137
|
- !ruby/object:Gem::Version
|
158
|
-
version: '
|
138
|
+
version: '13.0'
|
159
139
|
- !ruby/object:Gem::Dependency
|
160
140
|
name: rspec
|
161
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,6 +178,7 @@ files:
|
|
198
178
|
- lib/webcommand/config.rb
|
199
179
|
- lib/webcommand/extensions/hash_extension.rb
|
200
180
|
- lib/webcommand/server.rb
|
181
|
+
- lib/webcommand/server/adapters/webrick.rb
|
201
182
|
- lib/webcommand/version.rb
|
202
183
|
- webcommand.gemspec
|
203
184
|
homepage: https://github.com/catks/webcommand
|