schmurfy-bacon 1.7.3 → 1.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/bacon/ext/http.rb +17 -5
- data/lib/bacon/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5bbbf87534ceb73d7947f2de3c145c63785eaf55fbec842f798e8b69dcab0643
|
4
|
+
data.tar.gz: bbfd8fa73f40ca2f9ab63604720fc7006301066a44643a5697003784e4906432
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1342cfd205fe0e73de78bd8f647e00a713592d1b3911e386442007bd538c0c443cf4175677d767e4856f9c63381a3eb286273b88df52ed34675b54db9e1f8ef
|
7
|
+
data.tar.gz: 47df737e1cc4f3379a3f50661892c0462e7f1da3f9ea7111e5704526b1ee263168c0ad93a81b9a86c03aa7869efa1694690f81466f3e3d0608b96fbb99e55f3a
|
data/lib/bacon/ext/http.rb
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
|
2
|
-
gem 'em-http-request'
|
2
|
+
gem 'em-http-request'
|
3
3
|
gem 'thin'
|
4
4
|
require 'em-http-request'
|
5
5
|
require 'thin'
|
6
6
|
|
7
|
-
require 'em-synchrony'
|
8
|
-
require 'em-synchrony/em-http'
|
9
|
-
|
10
7
|
module Bacon
|
11
8
|
module HTTPHelpers
|
9
|
+
@@servers = []
|
10
|
+
|
12
11
|
def start_server(rack_app = nil, &block)
|
13
12
|
$bacon_http_port ||= 11000
|
14
13
|
$bacon_http_port+= 1
|
@@ -20,7 +19,20 @@ module Bacon
|
|
20
19
|
end
|
21
20
|
|
22
21
|
Thin::Logging.silent = true
|
23
|
-
|
22
|
+
|
23
|
+
server = Thin::Server.new('127.0.0.1', $bacon_http_port, &block)
|
24
|
+
server.start
|
25
|
+
|
26
|
+
@@servers << server
|
27
|
+
end
|
28
|
+
|
29
|
+
def stop_servers()
|
30
|
+
@@servers.each{|s| s.stop() }
|
31
|
+
@@servers = []
|
32
|
+
end
|
33
|
+
|
34
|
+
def http_url(path)
|
35
|
+
"http://127.0.0.1:#{$bacon_http_port}#{path}"
|
24
36
|
end
|
25
37
|
|
26
38
|
def http_request(method, path, args = {}, &block)
|
data/lib/bacon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schmurfy-bacon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Neukirchen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: term-ansicolor
|
@@ -100,8 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
|
-
|
104
|
-
rubygems_version: 2.6.8
|
103
|
+
rubygems_version: 3.0.3
|
105
104
|
signing_key:
|
106
105
|
specification_version: 4
|
107
106
|
summary: a small RSpec clone
|