agoo 2.15.7 → 2.15.8

Sign up to get free protection for your applications and to get access to all the features.
data/lib/agoo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Agoo
3
3
  # Agoo version.
4
- VERSION = '2.15.7'
4
+ VERSION = '2.15.8'
5
5
  end
@@ -13,161 +13,163 @@ module Rack
13
13
  # Run the server. Options are the same as for Agoo::Server plus a :port,
14
14
  # :root, :rmux, and :wc option.
15
15
  def self.run(handler, options={})
16
- port = 0
17
- root = './public'
16
+ port = 0
17
+ root = './public'
18
18
  root_set = false
19
- worker_count = 1;
20
- default_handler = nil
21
- not_found_handler = nil
22
- path_map = {}
23
- verbose = 1
24
- log_dir = nil
25
- classic = true
26
- console = true
27
- colorize = true
28
- binds = nil
29
- graphql = nil
19
+ worker_count = 1;
20
+ default_handler = nil
21
+ not_found_handler = nil
22
+ path_map = {}
23
+ verbose = 1
24
+ log_dir = nil
25
+ classic = true
26
+ console = true
27
+ colorize = true
28
+ binds = nil
29
+ graphql = nil
30
30
  options[:root_first] = true # the default for rack
31
31
 
32
- default_handler = handler unless handler.nil?
33
- options.each { |k,v|
34
- if :port == k || :p == k
35
- port = v.to_i
36
- options.delete(k)
37
- elsif :root == k || :dir == k || :d == k
38
- root = v
32
+ default_handler = handler unless handler.nil?
33
+ options.each { |k,v|
34
+ if :port == k || :p == k
35
+ port = v.to_i
36
+ options.delete(k)
37
+ elsif :root == k || :dir == k || :d == k
38
+ root = v
39
39
  root_set = true
40
- options.delete(k)
41
- elsif :wc == k || :workers == k
42
- worker_count = v.to_i
43
- options.delete(k)
44
- elsif :rmux == k || :root_first == k || :f == k
40
+ options.delete(k)
41
+ elsif :wc == k || :workers == k
42
+ worker_count = v.to_i
43
+ options.delete(k)
44
+ elsif :rmux == k || :root_first == k || :f == k
45
45
  options[:root_first] = false
46
- elsif k.nil?
47
- not_found_handler = v
48
- options.delete(k)
49
- elsif :graphql == k || :g == k
50
- graphql = v
51
- options.delete(k)
52
- elsif :s == k || :silent == k
53
- verbose = 0
54
- options.delete(k)
55
- elsif :v == k || :verbose == k
56
- verbose = 2
57
- options.delete(k)
58
- elsif :debug == k
59
- verbose = 3
60
- options.delete(k)
61
- elsif :b == k || :bind == k
62
- if v.is_a?(String)
63
- binds = v.split(',')
64
- else
65
- binds = v
66
- end
67
- options.delete(k)
68
- elsif :log_dir == k
69
- log_dir = v
70
- options.delete(k)
71
- elsif :log_classic == k
72
- classic = true
73
- options.delete(k)
74
- elsif :no_log_classic == k
75
- classic = false
76
- options.delete(k)
77
- elsif :log_console == k
78
- console = true
79
- options.delete(k)
80
- elsif :no_log_console == k
81
- console = false
82
- options.delete(k)
83
- elsif :log_colorize == k
84
- colorize = true
85
- options.delete(k)
86
- elsif :no_log_colorize == k
87
- colorize = false
88
- options.delete(k)
89
- elsif :help == k || :h == k
90
- puts %|
46
+ elsif k.nil?
47
+ not_found_handler = v
48
+ options.delete(k)
49
+ elsif :graphql == k || :g == k
50
+ graphql = v
51
+ options.delete(k)
52
+ elsif :s == k || :silent == k
53
+ verbose = 0
54
+ options.delete(k)
55
+ elsif :v == k || :verbose == k
56
+ verbose = 2
57
+ options.delete(k)
58
+ elsif :debug == k
59
+ verbose = 3
60
+ options.delete(k)
61
+ elsif :b == k || :bind == k
62
+ if v.is_a?(String)
63
+ binds = v.split(',')
64
+ else
65
+ binds = v
66
+ end
67
+ options.delete(k)
68
+ elsif :log_dir == k
69
+ log_dir = v
70
+ options.delete(k)
71
+ elsif :log_classic == k
72
+ classic = true
73
+ options.delete(k)
74
+ elsif :no_log_classic == k
75
+ classic = false
76
+ options.delete(k)
77
+ elsif :log_console == k
78
+ console = true
79
+ options.delete(k)
80
+ elsif :no_log_console == k
81
+ console = false
82
+ options.delete(k)
83
+ elsif :log_colorize == k
84
+ colorize = true
85
+ options.delete(k)
86
+ elsif :no_log_colorize == k
87
+ colorize = false
88
+ options.delete(k)
89
+ elsif :help == k || :h == k
90
+ puts %|
91
91
  Agoo is a Ruby web server that supports Rack. The follwing options are available
92
92
  using the -O NAME[=VALUE] option of rackup. Note that if binds are provided the
93
93
  -p PORT option will be ignored but -Op=PORT can be used.
94
94
 
95
- -O h, help Show this display.
96
- -O s, silent Silent.
97
- -O v, verbose Verbose.
98
- -O debug Very verbose.
99
- -O f, rmux, root_first Check the root directory before the handle paths.
100
- -O p, port=PORT Port to listen on.
101
- -O b, bind=URL URLs to receive connections on, comma separated.
102
- Examples:
103
- "http ://127.0.0.1:6464"
104
- "unix:///tmp/agoo.socket"
105
- "http ://[::1]:6464
106
- "http ://:6464"
107
- -O d, dir, root=DIR Directory to serve static assets from.
108
- -O g, graphql=PATH URL path for GraphQL requests.
109
- -O t, threads=COUNT Number of threads to use.
110
- -O w, workers=COUNT Number of workers to use.
111
- -O log_dir=DIR Log file directory.
112
- -O [no_]log_classic Classic log entries instead of JSON.
113
- -O [no_]log_console Display log entries on the console.
114
- -O [no_]log_colorize Display log entries in color.
95
+ -O h, help Show this display.
96
+ -O s, silent Silent.
97
+ -O v, verbose Verbose.
98
+ -O debug Very verbose.
99
+ -O f, rmux, root_first Check the root directory before the handle paths.
100
+ -O p, port=PORT Port to listen on.
101
+ -O b, bind=URL URLs to receive connections on, comma separated.
102
+ Examples:
103
+ "http ://127.0.0.1:6464"
104
+ "unix:///tmp/agoo.socket"
105
+ "http ://[::1]:6464
106
+ "http ://:6464"
107
+ -O d, dir, root=DIR Directory to serve static assets from.
108
+ -O g, graphql=PATH URL path for GraphQL requests.
109
+ -O t, threads=COUNT Number of threads to use.
110
+ -O w, workers=COUNT Number of workers to use.
111
+ -O log_dir=DIR Log file directory.
112
+ -O ssl_cert=FILE SSL certificate file.
113
+ -O ssl_key=FILE SSL key file.
114
+ -O [no_]log_classic Classic log entries instead of JSON.
115
+ -O [no_]log_console Display log entries on the console.
116
+ -O [no_]log_colorize Display log entries in color.
115
117
  -O /path=MyHandler path and class name to handle requests on that path
116
118
 
117
119
  |
118
- exit(true)
119
- else
120
+ exit(true)
121
+ else
120
122
  k = k.to_s
121
123
  if k.start_with?('/')
122
124
  path_map[k] = v
123
125
  options.delete(k)
124
126
  end
125
- end
126
- }
127
- options[:thread_count] = 0
128
- options[:worker_count] = worker_count
129
- if binds.nil?
130
- options[:Port] = port unless port == 0
131
- else
132
- options[:bind] = binds
133
- options[:Port] = port
134
- end
135
- options[:graphql] = graphql unless graphql.nil?
127
+ end
128
+ }
129
+ options[:thread_count] = 0
130
+ options[:worker_count] = worker_count
131
+ if binds.nil?
132
+ options[:Port] = port unless port == 0
133
+ else
134
+ options[:bind] = binds
135
+ options[:Port] = port
136
+ end
137
+ options[:graphql] = graphql unless graphql.nil?
136
138
 
137
- ::Agoo::Log.configure(dir: log_dir,
138
- console: console,
139
- classic: classic,
140
- colorize: colorize,
141
- states: {
142
- INFO: 1 <= verbose,
143
- DEBUG: 3 <= verbose,
144
- connect: 2 <= verbose,
145
- request: 2 <= verbose,
146
- response: 2 <= verbose,
147
- eval: 2 <= verbose,
148
- push: 2 <= verbose,
149
- })
150
- ::Agoo::Server.init(port, root, options)
151
- path_map.each { |path,h|
152
- ::Agoo::Server.handle(nil, path, h)
153
- }
139
+ ::Agoo::Log.configure(dir: log_dir,
140
+ console: console,
141
+ classic: classic,
142
+ colorize: colorize,
143
+ states: {
144
+ INFO: 1 <= verbose,
145
+ DEBUG: 3 <= verbose,
146
+ connect: 2 <= verbose,
147
+ request: 2 <= verbose,
148
+ response: 2 <= verbose,
149
+ eval: 2 <= verbose,
150
+ push: 2 <= verbose,
151
+ })
152
+ ::Agoo::Server.init(port, root, options)
153
+ path_map.each { |path,h|
154
+ ::Agoo::Server.handle(nil, path, h)
155
+ }
154
156
  begin
155
157
  # If Rails is loaded this should work else just ignore.
156
- if const_defined?(:Rails)
158
+ if const_defined?(:Rails)
157
159
  ::Agoo::Server.path_group('/assets', ::Rails.configuration.assets.paths)
158
160
  root = Rails.public_path unless root_set
159
- end
161
+ end
160
162
  rescue Exception
161
163
  end
162
- unless default_handler.nil?
163
- ::Agoo::Server.handle(nil, '**', default_handler)
164
- end
165
- ::Agoo::Server.handle_not_found(not_found_handler) unless not_found_handler.nil?
166
- ::Agoo::Server.start
164
+ unless default_handler.nil?
165
+ ::Agoo::Server.handle(nil, '**', default_handler)
166
+ end
167
+ ::Agoo::Server.handle_not_found(not_found_handler) unless not_found_handler.nil?
168
+ ::Agoo::Server.start
167
169
  end
168
170
 
169
171
  def self.shutdown
170
- ::Agoo::shutdown
172
+ ::Agoo::shutdown
171
173
  end
172
174
 
173
175
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.7
4
+ version: 2.15.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ohler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-10 00:00:00.000000000 Z
11
+ date: 2023-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  version: '0'
191
191
  requirements:
192
192
  - Linux or macOS
193
- rubygems_version: 3.4.1
193
+ rubygems_version: 3.4.10
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: An HTTP server