optimus_prime 4.6.0 → 4.10.0
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/README.md +13 -0
- data/certs/acnalesso.pem +16 -16
- data/lib/optimus_prime.rb +10 -5
- data/lib/optimus_prime/version.rb +1 -1
- data/optimus_prime.log +7 -0
- data/tags +4 -22
- metadata +18 -18
- 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: 630350e797cbfb3fbc177f9f6c22e02c36bcdbeb
|
4
|
+
data.tar.gz: ea1ae51ed3e2ce3eaa6248621d29afa08994e4dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba07bdd25a7f296ff17c3f93417216463b7bae6257ec36f29ac5d6a3640bd0c63b50920be11cf8c9c3c1a7894df71e9579582fcdab1799ffd5fc372ff70e09a4
|
7
|
+
data.tar.gz: c460046889e1c4c1e4c043fde980279df8daec8718e68bbd1cf5ab564d6e0bf01d6c9d4f80816499e357d0b16cefa11e7008d0aea1d287a3395dda29f2525ea8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -24,6 +24,8 @@ to it and get the desired response.
|
|
24
24
|
## Default configuration
|
25
25
|
* localhost:7003 -> TEST default endpoint
|
26
26
|
* returns 200 status code for GET,POST
|
27
|
+
* Runs on a single thread
|
28
|
+
* If multi_threaded is true the default thread pool size is 16
|
27
29
|
* sets content-type to text
|
28
30
|
* wait_for is 3 seconds
|
29
31
|
* Returns empty body when status_code is 404/500
|
@@ -40,6 +42,17 @@ op = OptimusPrime::Base.new
|
|
40
42
|
op.prime("path_name", response, options)
|
41
43
|
```
|
42
44
|
|
45
|
+
multi threaded mode
|
46
|
+
```ruby
|
47
|
+
#
|
48
|
+
# OptimusPrime::Cannon.fire!(7002, {multi_threaded: true, thread_pool: 50})
|
49
|
+
# thread_pool is by default set to 16
|
50
|
+
#
|
51
|
+
OptimusPrime::Cannon.fire!(7002, {multi_threaded: true})
|
52
|
+
op = OptimusPrime::Base.new
|
53
|
+
op.prime("path_name", response, options)
|
54
|
+
```
|
55
|
+
|
43
56
|
changing port number:
|
44
57
|
```ruby
|
45
58
|
OptimusPrime::Cannon.fire!(2020)
|
data/certs/acnalesso.pem
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
2
|
MIIDnjCCAoagAwIBAgIBATANBgkqhkiG9w0BAQUFADBTMRIwEAYDVQQDDAlhY25h
|
3
3
|
bGVzc28xFTATBgoJkiaJk/IsZAEZFgV5YWhvbzESMBAGCgmSJomT8ixkARkWAmNv
|
4
|
-
|
5
|
-
|
4
|
+
MRIwEAYKCZImiZPyLGQBGRYCdWswHhcNMTUwNjE4MTUyMTUxWhcNMTYwNjE3MTUy
|
5
|
+
MTUxWjBTMRIwEAYDVQQDDAlhY25hbGVzc28xFTATBgoJkiaJk/IsZAEZFgV5YWhv
|
6
6
|
bzESMBAGCgmSJomT8ixkARkWAmNvMRIwEAYKCZImiZPyLGQBGRYCdWswggEiMA0G
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDh7bPMjJG1+8Xk9LLULd8PcErjejrg
|
8
|
+
IfJqXY89HxjyD1ShdHFm2B1kmufLyJl4ulvCEWBJJTx5b2f4jXIGz/8ab/vCTpIz
|
9
|
+
4R25gSLb8PrPk5jd4Sn/OnLCbMmCmFfnsWrlXQhDweAtafC9GW1vnVBO7EEBb5FY
|
10
|
+
+/nJJBUVXaheS1yOY7VysrbLq+gOy/isX+NP813KJ0KsoYrIN94gu3SWwh6QFZge
|
11
|
+
03zUrUkmcXX2G+tcYMRJ9keevS7rv9OpzHNbHbIhiW6/9dlola6nKDzvA55hfHlx
|
12
|
+
iIj30sJjf0N0bK0Jga7sY97jlZ1o+Y/E/TNIPz55nevarumHV/sJz2GBAgMBAAGj
|
13
|
+
fTB7MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQyuD7NlszPbmVd
|
14
|
+
TdE0Ud+j25TRAjAgBgNVHREEGTAXgRVhY25hbGVzc29AeWFob28uY28udWswIAYD
|
15
15
|
VR0SBBkwF4EVYWNuYWxlc3NvQHlhaG9vLmNvLnVrMA0GCSqGSIb3DQEBBQUAA4IB
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
AQBKdD5moSTDcMUtmMF++RVyCXGOynzdhuwF/w+h99aC0/AZxuOsJUEa0nP3tnon
|
17
|
+
ChKnpGwf0M6aJQuRvE+k21KRXO202r3RmXw8R9M4SBb8cZHaIDIqHZGvW6wP2iJ0
|
18
|
+
5KfofwbYUNOpJppk7hhjl5+ASlCU0ved5gHJ1v0PzERurTZHKH631GB+gSL+RDmc
|
19
|
+
Q5jbIMvDAerheX+7UGm1Fwfs4nJqn1qlPZvrzGjcKCPFKnvWdbNN8a7P2U78TbvH
|
20
|
+
VENeDFfZVO7+QJ1CcexQChPNOenp/1hPs18XXfz7Bx/EOw69PTCudZVqj+xt3gYS
|
21
|
+
9Y/PNWqAWckM1cLwdt/PnWHI
|
22
22
|
-----END CERTIFICATE-----
|
data/lib/optimus_prime.rb
CHANGED
@@ -8,14 +8,15 @@ module OptimusPrime
|
|
8
8
|
|
9
9
|
$port = 7002
|
10
10
|
|
11
|
-
def self.fire!(port)
|
11
|
+
def self.fire!(port, options={})
|
12
12
|
$port = port
|
13
|
-
self.new.start_server
|
13
|
+
self.new(options).start_server
|
14
14
|
end
|
15
15
|
|
16
16
|
attr_reader :op_port
|
17
17
|
|
18
|
-
def initialize
|
18
|
+
def initialize(options={})
|
19
|
+
@options = options
|
19
20
|
@op_port = $port
|
20
21
|
end
|
21
22
|
|
@@ -23,7 +24,7 @@ module OptimusPrime
|
|
23
24
|
|
24
25
|
return system("echo '\nOptimus is already priming :)\n\n'") if File.exist?("#{current_path}/tmp/pids/optimus_prime.pid")
|
25
26
|
|
26
|
-
unless
|
27
|
+
unless File.directory?("#{current_path}/tmp/pids")
|
27
28
|
system("echo 'Creating tmp/pid' && mkdir -p #{current_path}/tmp/pids")
|
28
29
|
end
|
29
30
|
|
@@ -33,7 +34,11 @@ module OptimusPrime
|
|
33
34
|
end
|
34
35
|
|
35
36
|
system("echo '\nStarting Optimus Prime\n'")
|
36
|
-
|
37
|
+
if @options[:multi_threaded]
|
38
|
+
puts system("thin start -c #{optimus_prime_path} -p #{op_port} -P #{current_path}/tmp/pids/optimus_prime.pid -l #{current_path}/optimus_prime.log --threaded -p 7011 --threadpool-size #{@options[:thread_pool] || 16} -d")
|
39
|
+
else
|
40
|
+
puts system("thin start -c #{optimus_prime_path} -p #{op_port} -P #{current_path}/tmp/pids/optimus_prime.pid -l #{current_path}/optimus_prime.log -D -d")
|
41
|
+
end
|
37
42
|
|
38
43
|
while :starting_server
|
39
44
|
sleep(2) and break if File.exist?("#{current_path}/tmp/pids/optimus_prime.pid")
|
data/optimus_prime.log
CHANGED
@@ -17818,3 +17818,10 @@ JSON::ParserError - 757: unexpected token at 'status=YES':
|
|
17818
17818
|
/Users/acnalesso/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `eval'
|
17819
17819
|
/Users/acnalesso/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `<main>'
|
17820
17820
|
Exiting!
|
17821
|
+
Writing PID to /Users/acnalesso/dev/shop/optimus_prime/tmp/pids/optimus_prime.pid
|
17822
|
+
Using rack adapter
|
17823
|
+
Thin web server (v1.6.3 codename Protein Powder)
|
17824
|
+
Debugging ON
|
17825
|
+
Maximum connections set to 1024
|
17826
|
+
Listening on 0.0.0.0:7003, CTRL+C to stop
|
17827
|
+
Exiting!
|
data/tags
CHANGED
@@ -4,26 +4,8 @@
|
|
4
4
|
!_TAG_PROGRAM_NAME Exuberant Ctags //
|
5
5
|
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
|
6
6
|
!_TAG_PROGRAM_VERSION 5.8 //
|
7
|
-
Base lib/optimus_prime.rb /^ class Base$/;" c class:OptimusPrime
|
8
|
-
Cannon lib/optimus_prime.rb /^ class Cannon$/;" c class:OptimusPrime
|
9
|
-
OptimusPrime lib/optimus_prime.rb /^module OptimusPrime$/;" m
|
10
|
-
OptimusPrime lib/optimus_prime/server.rb /^module OptimusPrime$/;" m
|
11
7
|
OptimusPrime lib/optimus_prime/version.rb /^module OptimusPrime$/;" m
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
fire lib/optimus_prime.rb /^ def self.fire!(port)$/;" F class:OptimusPrime.Cannon
|
17
|
-
get_boolean lib/optimus_prime/server.rb /^ def get_boolean(boolean)$/;" f
|
18
|
-
get_path lib/optimus_prime/server.rb /^ def get_path$/;" f
|
19
|
-
initialize lib/optimus_prime.rb /^ def initialize$/;" f class:OptimusPrime.Cannon
|
20
|
-
initialize lib/optimus_prime.rb /^ def initialize(opts={})$/;" f class:OptimusPrime.Base
|
21
|
-
last_request_for lib/optimus_prime.rb /^ def last_request_for(path_name)$/;" f class:OptimusPrime.Base
|
22
|
-
optimus_prime_path lib/optimus_prime.rb /^ def optimus_prime_path$/;" f class:OptimusPrime.Cannon
|
23
|
-
parse_request lib/optimus_prime/server.rb /^ def parse_request(content_type)$/;" f
|
24
|
-
prime lib/optimus_prime.rb /^ def prime(path_name, response="", options={})$/;" f class:OptimusPrime.Base
|
25
|
-
record_request lib/optimus_prime/server.rb /^ def record_request(path, body)$/;" f
|
26
|
-
requests lib/optimus_prime/server.rb /^ def requests$/;" f
|
27
|
-
responses lib/optimus_prime/server.rb /^ def responses$/;" f
|
28
|
-
start_server lib/optimus_prime.rb /^ def start_server$/;" f class:OptimusPrime.Cannon
|
29
|
-
wait_until_request lib/optimus_prime.rb /^ def wait_until_request(path_name, &block)$/;" f class:OptimusPrime.Base
|
8
|
+
get lib/optimus_prime.rb /^ ::Faraday.get("http:\/\/localhost:#{op_port}/
|
9
|
+
prime lib/optimus_prime.rb /^ def prime(path_name, response="", options={})$/
|
10
|
+
sleep lib/optimus_prime.rb /^ sleep(0.1)$/
|
11
|
+
system lib/optimus_prime.rb /^ return system("echo '\\nOptimus is already p/
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: optimus_prime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antonio Nalesso
|
@@ -12,26 +12,26 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDnjCCAoagAwIBAgIBATANBgkqhkiG9w0BAQUFADBTMRIwEAYDVQQDDAlhY25h
|
14
14
|
bGVzc28xFTATBgoJkiaJk/IsZAEZFgV5YWhvbzESMBAGCgmSJomT8ixkARkWAmNv
|
15
|
-
|
16
|
-
|
15
|
+
MRIwEAYKCZImiZPyLGQBGRYCdWswHhcNMTUwNjE4MTUyMTUxWhcNMTYwNjE3MTUy
|
16
|
+
MTUxWjBTMRIwEAYDVQQDDAlhY25hbGVzc28xFTATBgoJkiaJk/IsZAEZFgV5YWhv
|
17
17
|
bzESMBAGCgmSJomT8ixkARkWAmNvMRIwEAYKCZImiZPyLGQBGRYCdWswggEiMA0G
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDh7bPMjJG1+8Xk9LLULd8PcErjejrg
|
19
|
+
IfJqXY89HxjyD1ShdHFm2B1kmufLyJl4ulvCEWBJJTx5b2f4jXIGz/8ab/vCTpIz
|
20
|
+
4R25gSLb8PrPk5jd4Sn/OnLCbMmCmFfnsWrlXQhDweAtafC9GW1vnVBO7EEBb5FY
|
21
|
+
+/nJJBUVXaheS1yOY7VysrbLq+gOy/isX+NP813KJ0KsoYrIN94gu3SWwh6QFZge
|
22
|
+
03zUrUkmcXX2G+tcYMRJ9keevS7rv9OpzHNbHbIhiW6/9dlola6nKDzvA55hfHlx
|
23
|
+
iIj30sJjf0N0bK0Jga7sY97jlZ1o+Y/E/TNIPz55nevarumHV/sJz2GBAgMBAAGj
|
24
|
+
fTB7MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQyuD7NlszPbmVd
|
25
|
+
TdE0Ud+j25TRAjAgBgNVHREEGTAXgRVhY25hbGVzc29AeWFob28uY28udWswIAYD
|
26
26
|
VR0SBBkwF4EVYWNuYWxlc3NvQHlhaG9vLmNvLnVrMA0GCSqGSIb3DQEBBQUAA4IB
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
AQBKdD5moSTDcMUtmMF++RVyCXGOynzdhuwF/w+h99aC0/AZxuOsJUEa0nP3tnon
|
28
|
+
ChKnpGwf0M6aJQuRvE+k21KRXO202r3RmXw8R9M4SBb8cZHaIDIqHZGvW6wP2iJ0
|
29
|
+
5KfofwbYUNOpJppk7hhjl5+ASlCU0ved5gHJ1v0PzERurTZHKH631GB+gSL+RDmc
|
30
|
+
Q5jbIMvDAerheX+7UGm1Fwfs4nJqn1qlPZvrzGjcKCPFKnvWdbNN8a7P2U78TbvH
|
31
|
+
VENeDFfZVO7+QJ1CcexQChPNOenp/1hPs18XXfz7Bx/EOw69PTCudZVqj+xt3gYS
|
32
|
+
9Y/PNWqAWckM1cLwdt/PnWHI
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-06-
|
34
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bundler
|
metadata.gz.sig
CHANGED
Binary file
|