ru.Bee 2.7.13 → 2.7.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4094dc9186412f408a5fb68be073177c786e8348222f6b57c35744eea709dffb
4
- data.tar.gz: 2d3c38258a5efc0aacc05b1f7d6a3dab1a46f41ec919464b7c90525f30205e35
3
+ metadata.gz: e6378c189ee732e5d57d9243c15cbb821b438adb16cb35c78f22940526bac65c
4
+ data.tar.gz: 7c39cfc95486d9eab4e4685ba4467bbc683f994ca9e28f6f6b1f27d539707692
5
5
  SHA512:
6
- metadata.gz: 8e58881b7b4541f0c6e4f04060e99ca0ad16d473f783dfc9596408eeecb6900d2c8b1ac0bd8ccd31cf27a9d7e07e3fc7494f5b590149ef5f8a09fce4991aace9
7
- data.tar.gz: df11787362b2894323fb7e3535c1cb2b192a5273ee39169c67e09dd826f5ed718e236ae48d0e5240cedb995270b3e2dcb37730ea62d15a8a72ae224285aa8728
6
+ metadata.gz: 42a775843e2181ace3bea37ee918adf8a3606309b2831572b27936eac49d7c8b2fb259ad2822097f8386305e9a29765813e5d16a7315ff499d5b3b4dd30d8dd0
7
+ data.tar.gz: 12ca16e3d05017ed31e7b6c301da397105eb5e0f9394e0a308051eae49ea5d07472e9dcb8b480655e3baf0b4bb13ff3874b2bbd45c87a952d432a2679ce32015
data/lib/db/test.db CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  module Rubee
2
2
  class Autoload
3
- BLACKLIST = ['rubee.rb', 'test_helper.rb']
3
+ BLACKLIST = ['rubee.rb', 'test_helper.rb', 'puma.rb']
4
4
  class << self
5
5
  def call(black_list = [], **options)
6
6
  load_whitelisted(options[:white_list_dirs]) && return if options[:white_list_dirs]
@@ -9,36 +9,45 @@ module Rubee
9
9
  |_| \_\\____/ |____/|_____|__|
10
10
  Ver: %s ⬡ ⬢ ⬢ rubee ⬢ ⬡
11
11
  LOGO
12
-
13
12
  class << self
14
13
  def call(command, argv)
15
14
  send(command, argv)
16
15
  end
17
16
 
18
17
  def start(argv)
19
- # get params
20
- options = argv.select { _1.start_with?('--') }
21
- port = options.find { _1.start_with?('--port') }&.split('=')&.last
22
- jit = options.find { _1.start_with?('--jit') }&.split('=')&.last
18
+ options = argv.select { _1.start_with?('--') }
19
+ port = options.find { _1.start_with?('--port') }&.split('=')&.last
20
+ jit = options.find { _1.start_with?('--jit') }&.split('=')&.last
21
+ port ||= ENV.fetch('PORT', '7000') # fix: don't clobber parsed port
22
+ puma_config = ENV.fetch('PUMA_CONFIG', 'config/puma.rb')
23
+ rackup_file = ENV.fetch('RACKUP_FILE', '')
23
24
 
24
- port ||= '7000'
25
25
  print_logo
26
26
  color_puts("Starting takeoff of ruBee on port: #{port}...", color: :yellow)
27
- command = "#{jit_prefix(jit)}rackup #{ENV['RACKUP_FILE']} -p #{port}"
27
+
28
+ command = [
29
+ jit_prefix(jit),
30
+ "bundle exec puma",
31
+ File.exist?(puma_config) ? "-C #{puma_config}" : '',
32
+ rackup_file,
33
+ "-p #{port}",
34
+ ].join(" ")
35
+
28
36
  color_puts(command, color: :gray)
29
37
  exec(command)
30
38
  end
31
39
 
32
40
  def start_dev(argv)
33
41
  options = argv.select { _1.start_with?('--') }
34
- port = options.find { _1.start_with?('--port') }&.split('=')&.last
35
- jit = options.find { _1.start_with?('--jit') }&.split('=')&.last
42
+ port = options.find { _1.start_with?('--port') }&.split('=')&.last
43
+ jit = options.find { _1.start_with?('--jit') }&.split('=')&.last
44
+ port ||= ENV.fetch('PORT', '7000') # fix: consistent with start; use ENV fallback
45
+ rackup_file = ENV.fetch('RACKUP_FILE', '')
36
46
 
37
- port ||= '7000'
38
47
  print_logo
39
-
40
48
  color_puts("Starting takeoff of ruBee server on port #{port} in dev mode...", color: :yellow)
41
- command = "rerun -- #{jit_prefix_dev(jit)}rackup --port #{port} #{ENV['RACKUP_FILE']}"
49
+
50
+ command = "rerun -- #{jit_prefix(jit)}rackup --port #{port} #{rackup_file}"
42
51
  color_puts(command, color: :gray)
43
52
  exec(command)
44
53
  end
@@ -52,24 +61,13 @@ LOGO
52
61
  end
53
62
 
54
63
  def print_logo
55
- puts "\e[36m#{LOGO % Rubee::VERSION}\e[0m" # Cyan color
56
- end
57
-
58
- def jit_prefix(key)
59
- case key
60
- when 'yjit'
61
- "ruby --yjit -S "
62
- else
63
- ""
64
- end
64
+ puts "\e[36m#{LOGO % Rubee::VERSION}\e[0m"
65
65
  end
66
66
 
67
- def jit_prefix_dev(key)
67
+ def jit_prefix(key) # fix: removed identical jit_prefix_dev; use this for both
68
68
  case key
69
- when 'yjit'
70
- "ruby --yjit -S "
71
- else
72
- ""
69
+ when 'yjit' then "ruby --yjit -S "
70
+ else ""
73
71
  end
74
72
  end
75
73
  end
@@ -179,12 +179,15 @@ module Rubee
179
179
  end
180
180
 
181
181
  def dataset
182
- DB[pluralize_class_name.to_sym]
182
+ @dataset ||= DB[pluralize_class_name.to_sym]
183
+ reconnect_count = 0
184
+
185
+ @dataset
183
186
  rescue Exception => e
184
187
  reconnect!
185
- __reconnect_count ||= 0
186
- __reconnect_count += 1
187
- if __reconnect_count > 3
188
+ reconnect_count ||= 0
189
+ reconnect_count += 1
190
+ if reconnect_count > 3
188
191
  raise e
189
192
  end
190
193
  sleep(0.1)
data/lib/rubee.rb CHANGED
@@ -20,7 +20,7 @@ module Rubee
20
20
  RUBEE_SUPPORT = { "Rubee::Support::Hash" => Hash, "Rubee::Support::String" => String }
21
21
  end
22
22
 
23
- VERSION = '2.7.13'
23
+ VERSION = '2.7.14'
24
24
 
25
25
  require_relative 'rubee/router'
26
26
  require_relative 'rubee/logger'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ru.Bee
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.13
4
+ version: 2.7.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Saltykov