ru.Bee 1.5.3 → 1.5.4
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 +4 -4
- data/bin/rubee +2 -2
- data/lib/config/base_configuration.rb +3 -0
- data/lib/config/routes.rb +0 -1
- data/lib/inits/charged_string.rb +6 -6
- data/lib/rubee/async/thread_pool.rb +22 -14
- data/lib/rubee/models/sequel_object.rb +4 -0
- data/lib/rubee.rb +5 -1
- data/lib/tests/async/thread_async_test.rb +32 -0
- data/lib/tests/rubee_generator_test.rb +66 -62
- data/lib/tests/test.db +0 -0
- data/lib/tests/test_helper.rb +11 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb5cbb674c5bfbfd6bc0d577039a3ca53fb46f013b62e5e004ef4a9f2c500514
|
4
|
+
data.tar.gz: abd0447b9655b22a85fed893e74c524f97d2d0ecf757eeb3b1730c799ae0e3d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53195541a6b75bb6bf98ff8e8d54cc6d9fea4c5a8d5232f79c0e5cbe085b0afa48e06e17e717a314fb44fbac92c6ae375e18cbc8f4cc2aba8152fec568c59545
|
7
|
+
data.tar.gz: 193de59c021b3ca2265e816f6c80fc54a0b714c37f02b59194a4dafb6d01b1bc2edf9180d0c932d8a9b2d4dc23954b052926874a691f0a1aaedfbc5870906c34
|
data/bin/rubee
CHANGED
@@ -60,8 +60,8 @@ elsif command == 'react'
|
|
60
60
|
exec('npm run watch')
|
61
61
|
end
|
62
62
|
else
|
63
|
-
color_puts
|
64
|
-
exit
|
63
|
+
color_puts("Unknown command: #{command}", color: :red)
|
64
|
+
exit(1)
|
65
65
|
end
|
66
66
|
elsif command == 'project'
|
67
67
|
project_name = ARGV[1]
|
@@ -1,5 +1,6 @@
|
|
1
1
|
Rubee::Configuration.setup(env = :development) do |config|
|
2
2
|
config.database_url = { url: 'sqlite://db/development.db', env: }
|
3
|
+
config.thread_pool_limit = { env:, value: 5 }
|
3
4
|
|
4
5
|
# Uncomment, if you want to use react
|
5
6
|
# config.react = { on: true, env: }
|
@@ -7,6 +8,7 @@ end
|
|
7
8
|
|
8
9
|
Rubee::Configuration.setup(env = :test) do |config|
|
9
10
|
config.database_url = { url: 'sqlite://db/test.db', env: }
|
11
|
+
config.thread_pool_limit = { env:, value: 5 }
|
10
12
|
|
11
13
|
# Uncomment, if you want to use react
|
12
14
|
# config.react = { on: true, env: } # required if you want to use react
|
@@ -14,6 +16,7 @@ end
|
|
14
16
|
|
15
17
|
Rubee::Configuration.setup(env = :production) do |config|
|
16
18
|
config.database_url = { url: 'sqlite://db/production.db', env: }
|
19
|
+
config.thread_pool_limit = { env:, value: 5 }
|
17
20
|
|
18
21
|
# Uncomment,if you want to use react
|
19
22
|
# config.react = { on: true, env: } # required if you want to use react
|
data/lib/config/routes.rb
CHANGED
data/lib/inits/charged_string.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module ChargedString
|
2
2
|
refine String do
|
3
3
|
def pluralize
|
4
|
-
if
|
4
|
+
if end_with?('y') && !%w[a e i o u].include?(self[-2])
|
5
5
|
"#{self[0..-2]}ies" # Replace "y" with "ies"
|
6
|
-
elsif
|
6
|
+
elsif end_with?('s', 'x', 'z', 'ch', 'sh')
|
7
7
|
"#{self}es" # Add "es" for certain endings
|
8
8
|
else
|
9
9
|
"#{self}s" # Default to adding "s"
|
@@ -11,7 +11,7 @@ module ChargedString
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def plural?
|
14
|
-
return true if
|
14
|
+
return true if end_with?('s') && !end_with?('ss')
|
15
15
|
|
16
16
|
false
|
17
17
|
end
|
@@ -21,11 +21,11 @@ module ChargedString
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def singularize
|
24
|
-
if
|
24
|
+
if end_with?('ies') && length > 3
|
25
25
|
"#{self[0..-4]}y" # Convert "ies" to "y"
|
26
|
-
elsif
|
26
|
+
elsif end_with?('es') && %w[s x z ch sh].any? { |ending| self[-(ending.length + 2)..-3] == ending }
|
27
27
|
self[0..-3] # Remove "es" for selfs like "foxes", "buses"
|
28
|
-
elsif
|
28
|
+
elsif end_with?('s') && length > 1
|
29
29
|
self[0..-2] # Remove "s" for regular plurals
|
30
30
|
else
|
31
31
|
self # Return as-is if no plural form is detected
|
@@ -3,50 +3,58 @@ require 'singleton'
|
|
3
3
|
module Rubee
|
4
4
|
class ThreadPool
|
5
5
|
include Singleton
|
6
|
-
|
6
|
+
THREAD_POOL_LIMIT = Rubee::Configuration.get_thread_pool_limit || 10 # adjust as needed
|
7
7
|
|
8
8
|
def initialize
|
9
9
|
@queue = Queue.new
|
10
10
|
@workers = []
|
11
11
|
@running = true
|
12
|
-
@mutex = Mutex.new
|
13
12
|
spawn_workers
|
14
13
|
end
|
15
14
|
|
16
15
|
def enqueue(task, args)
|
17
16
|
@queue << { task: task, args: args }
|
17
|
+
run_next
|
18
18
|
end
|
19
19
|
|
20
20
|
def bulk_enqueue(tasks)
|
21
21
|
@queue << tasks
|
22
|
+
run_next
|
22
23
|
end
|
23
24
|
|
24
25
|
def shutdown
|
25
26
|
@running = false
|
26
|
-
|
27
|
-
@workers.each(&:join)
|
27
|
+
@queue.clear
|
28
28
|
end
|
29
29
|
|
30
30
|
private
|
31
31
|
|
32
|
+
def run_next
|
33
|
+
@workers.each do |fiber|
|
34
|
+
fiber.resume if fiber.alive? && !@queue.empty?
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
32
38
|
def spawn_workers
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
THREAD_POOL_LIMIT.times do
|
40
|
+
fiber = Fiber.new do
|
41
|
+
loop do
|
42
|
+
Fiber.yield unless @running
|
43
|
+
job = @queue.shift
|
44
|
+
break unless job
|
45
|
+
|
46
|
+
task = job[:task]
|
47
|
+
args = job[:args]
|
42
48
|
|
43
49
|
begin
|
44
50
|
task.new.perform(**args)
|
45
|
-
rescue
|
51
|
+
rescue => e
|
46
52
|
puts "ThreadPool Error: #{e.message}"
|
47
53
|
end
|
48
54
|
end
|
49
55
|
end
|
56
|
+
|
57
|
+
@workers << fiber
|
50
58
|
end
|
51
59
|
end
|
52
60
|
end
|
data/lib/rubee.rb
CHANGED
@@ -15,7 +15,7 @@ module Rubee
|
|
15
15
|
IMAGE_DIR = File.join(APP_ROOT, LIB, 'images') unless defined?(IMAGE_DIR)
|
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
|
-
VERSION = '1.5.
|
18
|
+
VERSION = '1.5.4'
|
19
19
|
|
20
20
|
class Application
|
21
21
|
include Singleton
|
@@ -80,6 +80,10 @@ module Rubee
|
|
80
80
|
@configuraiton[args[:env].to_sym][:async_adapter] = args[:async_adapter]
|
81
81
|
end
|
82
82
|
|
83
|
+
def thread_pool_limit=(args)
|
84
|
+
@configuraiton[args[:env].to_sym][:thread_pool_limit] = args[:thread_pool_limit]
|
85
|
+
end
|
86
|
+
|
83
87
|
def react=(args)
|
84
88
|
@configuraiton[args[:env].to_sym][:react] ||= { on: false }
|
85
89
|
@configuraiton[args[:env].to_sym][:react].merge!(on: args[:on])
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative '../test_helper'
|
2
|
+
|
3
|
+
class TestAsyncRunnner
|
4
|
+
include Rubee::Asyncable
|
5
|
+
|
6
|
+
def perform(options)
|
7
|
+
User.create(email: options['email'], password: options['password'])
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
describe 'TestAsyncRunnner' do
|
12
|
+
describe 'async' do
|
13
|
+
after do
|
14
|
+
Rubee::ThreadPool.instance.shutdown
|
15
|
+
User.destroy_all
|
16
|
+
end
|
17
|
+
|
18
|
+
subject do
|
19
|
+
5.times do |n|
|
20
|
+
TestAsyncRunnner.new.perform_async(options: {"email"=> "new#{n}@new.com", "password"=> "123"})
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'creates 5 users' do
|
25
|
+
assert_difference(-> { User.count }, 5) { subject }
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'does it async' do
|
29
|
+
# TODO
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -37,92 +37,95 @@ describe 'Rubee::Generator' do
|
|
37
37
|
generator = Rubee::Generator.new(nil, nil, nil, nil)
|
38
38
|
generator.call
|
39
39
|
|
40
|
-
_(File.exist?('lib/db/create_apples.rb')).must_equal
|
40
|
+
_(File.exist?('lib/db/create_apples.rb')).must_equal(false)
|
41
41
|
end
|
42
42
|
|
43
43
|
it 'with a model only' do
|
44
44
|
generator = Rubee::Generator.new('apple', nil, 'apples', nil)
|
45
45
|
generator.call
|
46
46
|
|
47
|
-
_(File.exist?('lib/db/create_apples.rb')).must_equal
|
47
|
+
_(File.exist?('lib/db/create_apples.rb')).must_equal(true)
|
48
48
|
|
49
49
|
lines = File.readlines('lib/db/create_apples.rb').map(&:chomp).join("\n")
|
50
50
|
|
51
|
-
_(lines.include?('class CreateApples')).must_equal
|
52
|
-
_(lines.include?('def call')).must_equal
|
53
|
-
_(lines.include?('return if Rubee::SequelObject::DB.tables.include?(:apples)')).must_equal
|
54
|
-
_(lines.include?('Rubee::SequelObject::DB.create_table(:apples) do')).must_equal
|
55
|
-
_(lines.include?('String')).must_equal
|
56
|
-
_(lines.include?('end')).must_equal
|
51
|
+
_(lines.include?('class CreateApples')).must_equal(true)
|
52
|
+
_(lines.include?('def call')).must_equal(true)
|
53
|
+
_(lines.include?('return if Rubee::SequelObject::DB.tables.include?(:apples)')).must_equal(true)
|
54
|
+
_(lines.include?('Rubee::SequelObject::DB.create_table(:apples) do')).must_equal(true)
|
55
|
+
_(lines.include?('String')).must_equal(false)
|
56
|
+
_(lines.include?('end')).must_equal(true)
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'with a model with attributes' do
|
60
|
-
generator = Rubee::Generator.new('apple', [{ name: 'title', type: :string }, {name: 'content', type: :text }],
|
60
|
+
generator = Rubee::Generator.new('apple', [{ name: 'title', type: :string }, { name: 'content', type: :text }],
|
61
|
+
'apples', nil)
|
61
62
|
generator.call
|
62
63
|
|
63
|
-
_(File.exist?('lib/db/create_apples.rb')).must_equal
|
64
|
+
_(File.exist?('lib/db/create_apples.rb')).must_equal(true)
|
64
65
|
|
65
66
|
lines = File.readlines('lib/db/create_apples.rb').map(&:chomp).join("\n")
|
66
67
|
|
67
|
-
_(lines.include?('class CreateApples')).must_equal
|
68
|
-
_(lines.include?('def call')).must_equal
|
69
|
-
_(lines.include?('return if Rubee::SequelObject::DB.tables.include?(:apples)')).must_equal
|
70
|
-
_(lines.include?('Rubee::SequelObject::DB.create_table(:apples) do')).must_equal
|
71
|
-
_(lines.include?('String :title')).must_equal
|
72
|
-
_(lines.include?('String :content, text: true')).must_equal
|
73
|
-
_(lines.include?('end')).must_equal
|
68
|
+
_(lines.include?('class CreateApples')).must_equal(true)
|
69
|
+
_(lines.include?('def call')).must_equal(true)
|
70
|
+
_(lines.include?('return if Rubee::SequelObject::DB.tables.include?(:apples)')).must_equal(true)
|
71
|
+
_(lines.include?('Rubee::SequelObject::DB.create_table(:apples) do')).must_equal(true)
|
72
|
+
_(lines.include?('String :title')).must_equal(true)
|
73
|
+
_(lines.include?('String :content, text: true')).must_equal(true)
|
74
|
+
_(lines.include?('end')).must_equal(true)
|
74
75
|
end
|
75
76
|
|
76
77
|
it 'with a model with different attributes' do
|
77
|
-
generator = Rubee::Generator.new('apple',
|
78
|
+
generator = Rubee::Generator.new('apple',
|
79
|
+
[{ name: 'id', type: :bigint }, { name: 'colour', type: :string }, { name: 'weight', type: :integer }], 'apples', nil)
|
78
80
|
generator.call
|
79
81
|
|
80
|
-
_(File.exist?('lib/db/create_apples.rb')).must_equal
|
82
|
+
_(File.exist?('lib/db/create_apples.rb')).must_equal(true)
|
81
83
|
|
82
84
|
lines = File.readlines('lib/db/create_apples.rb').map(&:chomp).join("\n")
|
83
85
|
|
84
|
-
_(lines.include?('class CreateApples')).must_equal
|
85
|
-
_(lines.include?('def call')).must_equal
|
86
|
-
_(lines.include?('return if Rubee::SequelObject::DB.tables.include?(:apples)')).must_equal
|
87
|
-
_(lines.include?('Rubee::SequelObject::DB.create_table(:apples) do')).must_equal
|
88
|
-
_(lines.include?('Bignum :id')).must_equal
|
89
|
-
_(lines.include?('String :colour')).must_equal
|
90
|
-
_(lines.include?('Integer :weight')).must_equal
|
91
|
-
_(lines.include?('end')).must_equal
|
86
|
+
_(lines.include?('class CreateApples')).must_equal(true)
|
87
|
+
_(lines.include?('def call')).must_equal(true)
|
88
|
+
_(lines.include?('return if Rubee::SequelObject::DB.tables.include?(:apples)')).must_equal(true)
|
89
|
+
_(lines.include?('Rubee::SequelObject::DB.create_table(:apples) do')).must_equal(true)
|
90
|
+
_(lines.include?('Bignum :id')).must_equal(true)
|
91
|
+
_(lines.include?('String :colour')).must_equal(true)
|
92
|
+
_(lines.include?('Integer :weight')).must_equal(true)
|
93
|
+
_(lines.include?('end')).must_equal(true)
|
92
94
|
end
|
93
95
|
|
94
96
|
it 'with a model with an attribute with multiple names' do
|
95
|
-
generator = Rubee::Generator.new('apple',
|
97
|
+
generator = Rubee::Generator.new('apple',
|
98
|
+
[{ name: ['blue_id', 'shoe_id'], type: :foreign_key, table: 'blue_and_shoe_join_tb' }], 'apples', nil)
|
96
99
|
generator.call
|
97
100
|
|
98
|
-
_(File.exist?('lib/db/create_apples.rb')).must_equal
|
101
|
+
_(File.exist?('lib/db/create_apples.rb')).must_equal(true)
|
99
102
|
|
100
103
|
lines = File.readlines('lib/db/create_apples.rb').map(&:chomp).join("\n")
|
101
104
|
|
102
|
-
_(lines.include?('class CreateApples')).must_equal
|
103
|
-
_(lines.include?('def call')).must_equal
|
104
|
-
_(lines.include?('return if Rubee::SequelObject::DB.tables.include?(:apples)')).must_equal
|
105
|
-
_(lines.include?('Rubee::SequelObject::DB.create_table(:apples) do')).must_equal
|
106
|
-
_(lines.include?('foreign_key [:blue_id, :shoe_id]')).must_equal
|
107
|
-
_(lines.include?(':blue_and_shoe_join_tb')).must_equal
|
108
|
-
_(lines.include?('end')).must_equal
|
105
|
+
_(lines.include?('class CreateApples')).must_equal(true)
|
106
|
+
_(lines.include?('def call')).must_equal(true)
|
107
|
+
_(lines.include?('return if Rubee::SequelObject::DB.tables.include?(:apples)')).must_equal(true)
|
108
|
+
_(lines.include?('Rubee::SequelObject::DB.create_table(:apples) do')).must_equal(true)
|
109
|
+
_(lines.include?('foreign_key [:blue_id, :shoe_id]')).must_equal(true)
|
110
|
+
_(lines.include?(':blue_and_shoe_join_tb')).must_equal(true)
|
111
|
+
_(lines.include?('end')).must_equal(true)
|
109
112
|
end
|
110
113
|
|
111
114
|
it 'with a model with a foreign_key without table' do
|
112
115
|
generator = Rubee::Generator.new('apple', [{ name: 'blue_id', type: :foreign_key }], 'apples', nil)
|
113
116
|
generator.call
|
114
117
|
|
115
|
-
_(File.exist?('lib/db/create_apples.rb')).must_equal
|
118
|
+
_(File.exist?('lib/db/create_apples.rb')).must_equal(true)
|
116
119
|
|
117
120
|
lines = File.readlines('lib/db/create_apples.rb').map(&:chomp).join("\n")
|
118
121
|
|
119
|
-
_(lines.include?('class CreateApples')).must_equal
|
120
|
-
_(lines.include?('def call')).must_equal
|
121
|
-
_(lines.include?('return if Rubee::SequelObject::DB.tables.include?(:apples)')).must_equal
|
122
|
-
_(lines.include?('Rubee::SequelObject::DB.create_table(:apples) do')).must_equal
|
123
|
-
_(lines.include?('foreign_key :blue_id')).must_equal
|
124
|
-
_(lines.include?(':replace_with_table_name')).must_equal
|
125
|
-
_(lines.include?('end')).must_equal
|
122
|
+
_(lines.include?('class CreateApples')).must_equal(true)
|
123
|
+
_(lines.include?('def call')).must_equal(true)
|
124
|
+
_(lines.include?('return if Rubee::SequelObject::DB.tables.include?(:apples)')).must_equal(true)
|
125
|
+
_(lines.include?('Rubee::SequelObject::DB.create_table(:apples) do')).must_equal(true)
|
126
|
+
_(lines.include?('foreign_key :blue_id')).must_equal(true)
|
127
|
+
_(lines.include?(':replace_with_table_name')).must_equal(true)
|
128
|
+
_(lines.include?('end')).must_equal(true)
|
126
129
|
end
|
127
130
|
end
|
128
131
|
|
@@ -136,53 +139,54 @@ describe 'Rubee::Generator' do
|
|
136
139
|
generator = Rubee::Generator.new(nil, nil, nil, nil)
|
137
140
|
generator.call
|
138
141
|
|
139
|
-
_(File.exist?('lib/app/models/apple.rb')).must_equal
|
142
|
+
_(File.exist?('lib/app/models/apple.rb')).must_equal(false)
|
140
143
|
end
|
141
144
|
|
142
145
|
it 'with a model only' do
|
143
146
|
generator = Rubee::Generator.new('apple', nil, 'apples', nil)
|
144
147
|
generator.call
|
145
148
|
|
146
|
-
_(File.exist?('lib/app/models/apple.rb')).must_equal
|
149
|
+
_(File.exist?('lib/app/models/apple.rb')).must_equal(true)
|
147
150
|
|
148
151
|
lines = File.readlines('lib/app/models/apple.rb').map(&:chomp).join("\n")
|
149
152
|
|
150
|
-
_(lines.include?('class Apple < Rubee::SequelObject')).must_equal
|
151
|
-
_(lines.include?('attr_accessor')).must_equal
|
152
|
-
_(lines.include?('end')).must_equal
|
153
|
+
_(lines.include?('class Apple < Rubee::SequelObject')).must_equal(true)
|
154
|
+
_(lines.include?('attr_accessor')).must_equal(false)
|
155
|
+
_(lines.include?('end')).must_equal(true)
|
153
156
|
end
|
154
157
|
|
155
158
|
it 'with a model with attributes' do
|
156
|
-
generator = Rubee::Generator.new('apple', [{ name: 'title', type: :string }, {name: 'content', type: :text }],
|
159
|
+
generator = Rubee::Generator.new('apple', [{ name: 'title', type: :string }, { name: 'content', type: :text }],
|
160
|
+
'apples', nil)
|
157
161
|
generator.call
|
158
162
|
|
159
|
-
_(File.exist?('lib/app/models/apple.rb')).must_equal
|
163
|
+
_(File.exist?('lib/app/models/apple.rb')).must_equal(true)
|
160
164
|
|
161
165
|
lines = File.readlines('lib/app/models/apple.rb').map(&:chomp).join("\n")
|
162
166
|
|
163
|
-
_(lines.include?('class Apple < Rubee::SequelObject')).must_equal
|
164
|
-
_(lines.include?('attr_accessor')).must_equal
|
165
|
-
_(lines.include?(':title, :content')).must_equal
|
166
|
-
_(lines.include?('end')).must_equal
|
167
|
+
_(lines.include?('class Apple < Rubee::SequelObject')).must_equal(true)
|
168
|
+
_(lines.include?('attr_accessor')).must_equal(true)
|
169
|
+
_(lines.include?(':title, :content')).must_equal(true)
|
170
|
+
_(lines.include?('end')).must_equal(true)
|
167
171
|
end
|
168
172
|
|
169
173
|
it 'with a model with different attributes' do
|
170
|
-
generator = Rubee::Generator.new('apple',
|
174
|
+
generator = Rubee::Generator.new('apple',
|
175
|
+
[{ name: 'id', type: :bigInt }, { name: 'colour', type: :string }, { name: 'weight', type: :integer }], 'apples', nil)
|
171
176
|
generator.call
|
172
177
|
|
173
|
-
_(File.exist?('lib/app/models/apple.rb')).must_equal
|
178
|
+
_(File.exist?('lib/app/models/apple.rb')).must_equal(true)
|
174
179
|
|
175
180
|
lines = File.readlines('lib/app/models/apple.rb').map(&:chomp).join("\n")
|
176
181
|
|
177
|
-
_(lines.include?('class Apple < Rubee::SequelObject')).must_equal
|
178
|
-
_(lines.include?('attr_accessor')).must_equal
|
179
|
-
_(lines.include?(':id, :colour, :weight')).must_equal
|
180
|
-
_(lines.include?('end')).must_equal
|
182
|
+
_(lines.include?('class Apple < Rubee::SequelObject')).must_equal(true)
|
183
|
+
_(lines.include?('attr_accessor')).must_equal(true)
|
184
|
+
_(lines.include?(':id, :colour, :weight')).must_equal(true)
|
185
|
+
_(lines.include?('end')).must_equal(true)
|
181
186
|
end
|
182
187
|
end
|
183
188
|
|
184
189
|
describe 'generates View file' do
|
185
|
-
|
186
190
|
end
|
187
191
|
|
188
192
|
describe 'generates Controller file' do
|
data/lib/tests/test.db
CHANGED
Binary file
|
data/lib/tests/test_helper.rb
CHANGED
@@ -10,3 +10,14 @@ Rubee::Configuration.setup(env = :test) do |config|
|
|
10
10
|
config.database_url = { url: 'sqlite://lib/tests/test.db', env: }
|
11
11
|
end
|
12
12
|
Rubee::SequelObject.reconnect!
|
13
|
+
|
14
|
+
def assert_difference(expression, difference = 1)
|
15
|
+
before = expression.call
|
16
|
+
yield
|
17
|
+
after = expression.call
|
18
|
+
actual_diff = after - before
|
19
|
+
|
20
|
+
assert_equal difference, actual_diff,
|
21
|
+
"Expected change of #{difference}, but got #{actual_diff}"
|
22
|
+
end
|
23
|
+
|
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.5.
|
4
|
+
version: 1.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Saltykov
|
@@ -241,6 +241,7 @@ files:
|
|
241
241
|
- lib/rubee/models/database_objectable.rb
|
242
242
|
- lib/rubee/models/sequel_object.rb
|
243
243
|
- lib/tests/account_model_test.rb
|
244
|
+
- lib/tests/async/thread_async_test.rb
|
244
245
|
- lib/tests/auth_tokenable_test.rb
|
245
246
|
- lib/tests/comment_model_test.rb
|
246
247
|
- lib/tests/example_models/account.rb
|