ru.Bee 1.9.11 → 1.9.12

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: 6943917dd749518abbf2713483ef1ef969717235159cabf67f5f59b868691c35
4
- data.tar.gz: 065ee4dc8c293bb742e7a3c08efbc37999a5750ca2bfd55b66701c062447c3c5
3
+ metadata.gz: eb5bb19ded65d916b743f77c4ac36e1cfc1e90f3c049490ec11c86532863fb11
4
+ data.tar.gz: 1e2793a785114f3dc18b890e1934bccc53d415ed0e0e456259a4825e2de5764d
5
5
  SHA512:
6
- metadata.gz: 9bf232de88ee04cbf5efa697a04b6af0c8ad952f4141c55e49e9572d0daf3ff72834cd2de39a24d5482d7d4927e8835534e2b900974f5dd9b89722c38148a5be
7
- data.tar.gz: a5f250547b602fbd94e0d283e325a4409e923c2c0d8afd2d74f031138aaa3fb49839655c46f060aac30f652a812297d93cf302075b70d7de2782c28484229f1a
6
+ metadata.gz: 81a9a261a539fe64f458211d2bd279c76598f44450aafe8760ec773133ed394bfc6ca426778f167e2c3f2c1ad7b822c2c9ad95dd45f8e6f34dc2b4740cd98c1b
7
+ data.tar.gz: 649ad8dec2d61a49ba48adb14e509fd66eff6a9aaee5b16921626c05cada66f0c2b4bd613d495d31270e787953dc98c76a85e36849a1ed5a6075f95e19814b7e
@@ -29,7 +29,7 @@ module Rubee
29
29
 
30
30
  def authentificated_user
31
31
  # User model must be created with email and password properties at least
32
- if !@request.cookies['jwt'] && params[:email] && params[:password]
32
+ if params[:email] && params[:password]
33
33
  @authentificated_user ||= ::User.where(email: params[:email], password: params[:password]).first
34
34
  elsif @request.cookies['jwt'] && valid_token?
35
35
  token = @request.cookies['jwt']
@@ -6,56 +6,62 @@ module Rubee
6
6
  end
7
7
 
8
8
  module ClassMethods
9
- def before(method, handler, **options)
10
- hooks = Module.new do
11
- define_method(method) do |*args, &block|
12
- if conditions_met?(options[:if], options[:unless])
13
- handler.respond_to?(:call) ? handler.call : send(handler)
14
- end
9
+ def before(*methods, handler, **options)
10
+ methods.each do |method|
11
+ hooks = Module.new do
12
+ define_method(method) do |*args, &block|
13
+ if conditions_met?(options[:if], options[:unless])
14
+ handler.respond_to?(:call) ? handler.call : send(handler)
15
+ end
15
16
 
16
- super(*args, &block)
17
+ super(*args, &block)
18
+ end
17
19
  end
20
+ prepend(hooks)
18
21
  end
19
- prepend(hooks)
20
22
  end
21
23
 
22
- def after(method, handler, **options)
23
- hooks = Module.new do
24
- define_method(method) do |*args, &block|
25
- result = super(*args, &block)
24
+ def after(*methods, handler, **options)
25
+ methods.each do |method|
26
+ hooks = Module.new do
27
+ define_method(method) do |*args, &block|
28
+ result = super(*args, &block)
26
29
 
27
- if conditions_met?(options[:if], options[:unless])
28
- handler.respond_to?(:call) ? handler.call : send(handler)
29
- end
30
+ if conditions_met?(options[:if], options[:unless])
31
+ handler.respond_to?(:call) ? handler.call : send(handler)
32
+ end
30
33
 
31
- result
34
+ result
35
+ end
32
36
  end
37
+ prepend(hooks)
33
38
  end
34
- prepend(hooks)
35
39
  end
36
40
 
37
- def around(method, handler, **options)
38
- hooks = Module.new do
39
- define_method(method) do |*args, &block|
40
- if conditions_met?(options[:if], options[:unless])
41
- if handler.respond_to?(:call)
42
- result = nil
43
- handler.call do
44
- result = super(*args, &block)
45
- end
41
+ def around(*methods, handler, **options)
42
+ methods.each do |method|
43
+ hooks = Module.new do
44
+ define_method(method) do |*args, &block|
45
+ if conditions_met?(options[:if], options[:unless])
46
+ if handler.respond_to?(:call)
47
+ result = nil
48
+ handler.call do
49
+ result = super(*args, &block)
50
+ end
46
51
 
47
- result
48
- else
49
- return send(handler) do
50
- super(*args, &block)
52
+ result
53
+ else
54
+ send(handler) do
55
+ super(*args, &block)
56
+ end
51
57
  end
58
+ else
59
+ super(*args, &block)
52
60
  end
53
- else
54
- super(*args, &block)
55
61
  end
56
62
  end
63
+ prepend(hooks)
57
64
  end
58
- prepend(hooks)
59
65
  end
60
66
  end
61
67
 
data/lib/rubee.rb CHANGED
@@ -16,7 +16,7 @@ module Rubee
16
16
  JS_DIR = File.join(APP_ROOT, LIB, 'js') unless defined?(JS_DIR)
17
17
  CSS_DIR = File.join(APP_ROOT, LIB, 'css') unless defined?(CSS_DIR)
18
18
  ROOT_PATH = File.expand_path(File.join(__dir__, '..')) unless defined?(ROOT_PATH)
19
- VERSION = '1.9.11'
19
+ VERSION = '1.9.12'
20
20
 
21
21
  require_relative 'rubee/router'
22
22
  require_relative 'rubee/logger'
data/lib/tests/test.db CHANGED
Binary file
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: 1.9.11
4
+ version: 1.9.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Saltykov
@@ -300,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
300
300
  - !ruby/object:Gem::Version
301
301
  version: '0'
302
302
  requirements: []
303
- rubygems_version: 3.6.8
303
+ rubygems_version: 3.6.9
304
304
  specification_version: 4
305
305
  summary: Fast and lightweight Ruby application server designed for minimalism and
306
306
  flexibility