ru.Bee 1.9.7 → 1.9.10

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: 03af86ee565e361f05a02908203f132f44c2e897d5b5bacf97d69d6b2856399c
4
- data.tar.gz: 9d1cf27fc856d40fe10c057521f17be4916e840999babfa6797a64827b53a053
3
+ metadata.gz: 7805c4792f55f480b720a6747dcaef3cd4f757df40fa0d64c28ddf7e861a44ab
4
+ data.tar.gz: deab881e9d463c26b3f41bf5e26b5c3c170a0dc77e999424a93f5ab0e58335fd
5
5
  SHA512:
6
- metadata.gz: 1375122c1165ede82010e967be939d884064b45290947ab68a109e94d7cd218f5e479aa6cae6cbf86e592765c223e422a500a8e8959cb7ee94514ab10175dc2e
7
- data.tar.gz: 1509444ec809f496adf8a9e4552de7b96769845db2e68574876d0f90a7311a0765de62ec222c5ee2a3a937ad259b83b1de84a5ea75ed1ace5715a038413dc2fb
6
+ metadata.gz: d133e680a6c780d9ead48a6485a63b081bed90d694e11719394fbded1b051c6e89cdd67b6c5aaa755d43b3c3f1d36e71e8a8b7a26f6d3bcf09f8e08360585a1d
7
+ data.tar.gz: e61df271d59b85025afe5408f78e1281a35ae1803a0fd5506015eec8c1700a8604b8d0d0bf6ff15837bfe01a00bff9711711f8eac4a8e6615d3fb7ca09c9dd73
@@ -106,6 +106,7 @@ module Rubee
106
106
  gem 'pry-byebug'
107
107
  gem 'puma'
108
108
  gem 'json'
109
+ gem 'jwt'
109
110
 
110
111
  group :development do
111
112
  gem 'rerun'
@@ -73,7 +73,7 @@ module Rubee
73
73
  view_file_name = self.class.name.split('Controller').first.gsub('::', '').snakeize
74
74
  erb_file = render_view ? render_view.to_s : "#{view_file_name}_#{@route[:action]}"
75
75
  lib = Rubee::PROJECT_NAME == 'rubee' ? 'lib/' : ''
76
- path_parts = self.class.instance_method(@route[:action]).source_location[0].split('/').reverse
76
+ path_parts = Module.const_source_location(self.class.name)&.first&.split('/')&.reverse
77
77
  controller_index = path_parts.find_index { |part| part == 'controllers' }
78
78
  app_name = path_parts[controller_index + 1]
79
79
  view = render_template(erb_file, { object:, **(options[:locals] || {}) }, app_name:)
@@ -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
- @authentificated_user ||= User.where(email: params[:email], password: params[:password]).first
32
+ @authentificated_user ||= ::User.where(email: params[:email], password: params[:password]).first
33
33
  end
34
34
 
35
35
  def authentificate!
@@ -37,7 +37,7 @@ module Rubee
37
37
 
38
38
  # Generate token
39
39
  payload = { username: params[:email], exp: Time.now.to_i + EXPIRE }
40
- @token = JWT.encode(payload, KEY, 'HS256')
40
+ @token = ::JWT.encode(payload, KEY, 'HS256')
41
41
  # Set jwt token to the browser within cookie, so next browser request will include it.
42
42
  # make sure it passed to response_with headers options
43
43
  @token_header = { 'set-cookie' => "jwt=#{@token}; path=/; httponly; secure" }
@@ -31,12 +31,12 @@ module Rubee
31
31
  hash = decode_jwt(token)
32
32
  email = hash[:username]
33
33
 
34
- User.where(email:)&.any? if email
34
+ ::User.where(email:)&.any? if email
35
35
  end
36
36
 
37
37
  def decode_jwt(token)
38
38
  decoded_array = begin
39
- JWT.decode(token, AuthTokenable::KEY, true, { algorithm: 'HS256' })
39
+ ::JWT.decode(token, AuthTokenable::KEY, true, { algorithm: 'HS256' })
40
40
  rescue StandardError
41
41
  []
42
42
  end
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.7'
19
+ VERSION = '1.9.10'
20
20
 
21
21
  require_relative 'rubee/router'
22
22
  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: 1.9.7
4
+ version: 1.9.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Saltykov
@@ -44,10 +44,8 @@ files:
44
44
  - lib/app/controllers/welcome_controller.rb
45
45
  - lib/app/models/user.rb
46
46
  - lib/app/views/App.tsx
47
- - lib/app/views/apples_.erb
48
47
  - lib/app/views/index.html
49
48
  - lib/app/views/layout.erb
50
- - lib/app/views/s_.erb
51
49
  - lib/app/views/utils/redirectToBackend.tsx
52
50
  - lib/app/views/welcome_header.erb
53
51
  - lib/app/views/welcome_show.erb
@@ -1 +0,0 @@
1
- <h1>apples_ View</h1>
data/lib/app/views/s_.erb DELETED
@@ -1 +0,0 @@
1
- <h1>s_ View</h1>