ru.Bee 1.3.1 → 1.3.3

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: ebf21ac6ef45f604f75860b65395f858e4280b604bc4277593aaf0eece82c50f
4
- data.tar.gz: '0870effab9dd0bb5201f3794a2158f1af632ab43b676f64df22a1858541f02fd'
3
+ metadata.gz: 0c9143f1fb0adabb978d0e9d8c718e5ccfa21c89830c227b64ee50f5931cb1c3
4
+ data.tar.gz: c64568ec8bab9baef9a9b7600174c3d730aacdda28567704290008cdcb8406d6
5
5
  SHA512:
6
- metadata.gz: 1ac7736c735d2b32bffe2d3ecf8bdadc7e23e2ead0978eaf694cbed15833eb785650c77d721b90773c88a36e18f93ede8929f7e1237b4e819cface7132b0c44d
7
- data.tar.gz: eaa51c7226fc5d9e9b84b5d19ca5a2e009c51e7d7a3341d7812c9ed5143a37d055f7d6e39e260782905c92cf5b6547e21db438c0917d0f4194235fdc5ca2ed24
6
+ metadata.gz: a2af204207bb589f143e1aca1d659fea3910760e02e871dcca7423e98a5d1176cd64eeea4762ba1fcd893cd06d27b08bbe90d4bbc21035328139fbff782762cb
7
+ data.tar.gz: cbad5d5d54c97d93341b1d95eb1f37ba2fe695c9b89591ab0b3b227cbd754169dbfc11c0ab787d8da3e4d8c43a46f26f7da9a57b915a70f3ca3ee77d976dd1c6
data/bin/rubee CHANGED
@@ -1,14 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'fileutils'
4
- require 'date'
5
- require 'irb'
6
- require 'sequel'
7
- require 'sqlite3'
8
- require 'json'
9
- require 'rack'
10
- require 'rackup'
11
-
12
3
  require_relative '../lib/inits/print_colors'
13
4
  require_relative '../lib/rubee'
14
5
 
@@ -29,42 +20,42 @@ LOGO
29
20
  command = ARGV.first
30
21
 
31
22
  def print_logo
32
- puts "\e[36m" + (LOGO % Rubee::VERSION) + "\e[0m" # Cyan color
23
+ puts "\e[36m#{LOGO % Rubee::VERSION}\e[0m" # Cyan color
33
24
  end
34
25
 
35
26
  if command =~ /^(start)$|^(start:(\d+))$/
36
- command, port = ARGV.first&.split(':')
27
+ _, port = ARGV.first&.split(':')
37
28
 
38
- port ||= "7000"
29
+ port ||= '7000'
39
30
  print_logo
40
31
  color_puts "Starting takeoff of ruBee server on port #{port}...", color: :yellow
41
32
  exec("rackup #{ENV['RACKUP_FILE']} -p #{port}")
42
33
  elsif command =~ /^(start_dev)$|^(start_dev:(\d+))$/
43
- command, port = ARGV.first&.split(':')
34
+ _, port = ARGV.first&.split(':')
44
35
 
45
- port ||= "7000"
36
+ port ||= '7000'
46
37
  print_logo
47
38
 
48
39
  color_puts "Starting takeoff of ruBee server on port #{port} in dev mode...", color: :yellow
49
40
 
50
41
  exec("rerun -- rackup --port #{port} #{ENV['RACKUP_FILE']}")
51
- elsif command == "stop"
52
- exec("pkill -f rubee")
53
- elsif command == "status"
54
- exec("ps aux | grep rubee")
55
- elsif command == "project"
42
+ elsif command == 'stop'
43
+ exec('pkill -f rubee')
44
+ elsif command == 'status'
45
+ exec('ps aux | grep rubee')
46
+ elsif command == 'project'
56
47
  project_name = ARGV[1]
57
48
  if project_name.nil?
58
- color_puts "Please indicate project name.", color: :red
49
+ color_puts 'Please indicate project name.', color: :red
59
50
  exit 1
60
51
  end
61
52
 
62
- if project_name == "rubee"
53
+ if project_name == 'rubee'
63
54
  color_puts "Error: Project 'rubee' is reserved", color: :red
64
55
  exit 1
65
56
  end
66
57
 
67
- source_dir = File.expand_path("../lib", __dir__)
58
+ source_dir = File.expand_path('../lib', __dir__)
68
59
  target_dir = File.expand_path("./#{project_name}", Dir.pwd)
69
60
 
70
61
  if Dir.exist?(target_dir)
@@ -76,12 +67,13 @@ elsif command == "project"
76
67
  FileUtils.mkdir_p(target_dir)
77
68
 
78
69
  # Define blacklist
79
- blacklist_files = %w[rubee.rb print_colors.rb version.rb config.ru test_helper.rb Gemfile.lock test.yml test.db development.db production.db]
70
+ blacklist_files = %w[rubee.rb print_colors.rb version.rb config.ru test_helper.rb Gemfile.lock test.yml test.db
71
+ development.db production.db]
80
72
  blacklist_dirs = %w[rubee tests .git .github .idea]
81
73
 
82
74
  # Copy files, excluding blacklisted ones
83
75
  Dir.glob("#{source_dir}/**/*", File::FNM_DOTMATCH).each do |file|
84
- relative_path = file.sub("#{source_dir}/", "")
76
+ relative_path = file.sub("#{source_dir}/", '')
85
77
 
86
78
  # Skip blacklisted directories
87
79
  next if blacklist_dirs.any? { |dir| relative_path.split('/').include?(dir) }
@@ -104,24 +96,24 @@ elsif command == "project"
104
96
 
105
97
  # create a gemfile context
106
98
  gemfile = <<~GEMFILE
107
- source 'https://rubygems.org'
108
-
109
- gem 'ru.Bee'
110
- gem 'sequel'
111
- gem 'sqlite3'
112
- gem 'rake'
113
- gem 'rack'
114
- gem 'rackup'
115
- gem 'pry'
116
- gem 'pry-byebug'
117
- gem 'puma'
118
- gem 'json'
119
-
120
- group :development do
121
- gem 'rerun'
122
- gem 'minitest'
123
- gem 'rack-test'
124
- end
99
+ source 'https://rubygems.org'
100
+
101
+ gem 'ru.Bee'
102
+ gem 'sequel'
103
+ gem 'sqlite3'
104
+ gem 'rake'
105
+ gem 'rack'
106
+ gem 'rackup'
107
+ gem 'pry'
108
+ gem 'pry-byebug'
109
+ gem 'puma'
110
+ gem 'json'
111
+
112
+ group :development do
113
+ gem 'rerun'
114
+ gem 'minitest'
115
+ gem 'rack-test'
116
+ end
125
117
  GEMFILE
126
118
  # create a gemfile
127
119
  File.open("#{target_dir}/Gemfile", 'w') do |file|
@@ -130,14 +122,14 @@ elsif command == "project"
130
122
 
131
123
  # create test_helper.rb file
132
124
  test_helper = <<~TESTHELPER
133
- require "bundler/setup"
134
- Bundler.require(:test)
125
+ require "bundler/setup"
126
+ Bundler.require(:test)
135
127
 
136
- require 'minitest/autorun'
137
- require 'rack/test'
138
- require 'rubee'
128
+ require 'minitest/autorun'
129
+ require 'rack/test'
130
+ require 'rubee'
139
131
 
140
- Rubee::Autoload.call
132
+ Rubee::Autoload.call
141
133
  TESTHELPER
142
134
 
143
135
  File.open("#{target_dir}/tests/test_helper.rb", 'w') do |file|
@@ -146,9 +138,9 @@ elsif command == "project"
146
138
 
147
139
  color_puts "Project #{project_name} created successfully at #{target_dir}", color: :green
148
140
 
149
- elsif command == "version"
141
+ elsif command == 'version'
150
142
  color_puts "ru.Bee v#{Rubee::VERSION}", color: :yellow
151
- elsif command == "test"
143
+ elsif command == 'test'
152
144
 
153
145
  ENV['RACK_ENV'] = 'test'
154
146
  file_name = ARGV[1] # Get the first argument
@@ -157,10 +149,10 @@ elsif command == "test"
157
149
  color_puts "Running #{file_name} test ...", color: :yellow
158
150
  exec("ruby -Itest -e \"require '.#{lib}/tests/#{file_name}'\"")
159
151
  else
160
- color_puts "Running all tests ...", color: :yellow
152
+ color_puts 'Running all tests ...', color: :yellow
161
153
  exec("ruby -Itest -e \"Dir.glob('.#{lib}/tests/**/*_test.rb').each { |file| require file }\"")
162
154
  end
163
- elsif ['generate', 'gen'].include? command
155
+ elsif %w[generate gen].include?(command)
164
156
  method, path = ARGV[1..2]
165
157
  ENV['RACK_ENV'] ||= 'development'
166
158
 
@@ -174,14 +166,14 @@ elsif ['generate', 'gen'].include? command
174
166
  "#{route[:controller]&.capitalize}Controller",
175
167
  route[:action]
176
168
  ).call
177
- elsif command == "db"
169
+ elsif command == 'db'
178
170
  Rubee::Autoload.call
179
171
  ENV['RACK_ENV'] ||= 'development'
180
172
 
181
173
  command, file_name = ARGV[1]&.split(':')
182
174
  if Rubee::PROJECT_NAME == 'rubee'
183
- Rubee::Configuration.setup(env=:test) do |config|
184
- config.database_url = { url: "sqlite://lib/tests/test.db", env: }
175
+ Rubee::Configuration.setup(env = :test) do |config|
176
+ config.database_url = { url: 'sqlite://lib/tests/test.db', env: }
185
177
  end
186
178
  Rubee::SequelObject.reconnect! unless command == 'init'
187
179
  end
@@ -189,29 +181,29 @@ elsif command == "db"
189
181
  def ensure_database_exists(db_url)
190
182
  uri = URI.parse(db_url)
191
183
  case uri.scheme
192
- when "sqlite"
184
+ when 'sqlite'
193
185
  begin
194
186
  Sequel.connect(db_url)
195
- color_puts "Database #{ENV['RACK_ENV']} exists", color: :cyan
196
- rescue Exception => e
197
- if File.exist?(db_path = db_url.sub(/^sqlite:\/\//, ''))
198
- color_puts "Database #{ENV['RACK_ENV']} exists", color: :cyan
187
+ color_puts("Database #{ENV['RACK_ENV']} exists", color: :cyan)
188
+ rescue Exception
189
+ if File.exist?(db_path = db_url.sub(%r{^sqlite://}, ''))
190
+ color_puts("Database #{ENV['RACK_ENV']} exists", color: :cyan)
199
191
  else
200
192
  Sequel.sqlite(db_path)
201
- color_puts "Database #{ENV['RACK_ENV']} created", color: :green
193
+ color_puts("Database #{ENV['RACK_ENV']} created", color: :green)
202
194
  end
203
195
  end
204
- when "postgres"
196
+ when 'postgres'
205
197
  begin
206
198
  Sequel.connect(db_url)
207
- color_puts "Database #{ENV['RACK_ENV']} exists", color: :cyan
208
- rescue => _
209
- con = Sequel.connect(Rubee::Configuration.get_database_url.gsub(/(\/test|\/development|\/production)/, ''))
199
+ color_puts("Database #{ENV['RACK_ENV']} exists", color: :cyan)
200
+ rescue StandardError => _e
201
+ con = Sequel.connect(Rubee::Configuration.get_database_url.gsub(%r{(/test|/development|/production)}, ''))
210
202
  con.run("CREATE DATABASE #{ENV['RACK_ENV']}")
211
- color_puts "Database #{ENV['RACK_ENV']} created", color: :green
203
+ color_puts("Database #{ENV['RACK_ENV']} created", color: :green)
212
204
  end
213
205
  else
214
- color_puts "Unsupported database type: #{db_url}", color: :red
206
+ color_puts("Unsupported database type: #{db_url}", color: :red)
215
207
  end
216
208
  end
217
209
 
@@ -226,52 +218,54 @@ elsif command == "db"
226
218
  end
227
219
  end
228
220
  formatted_hash = JSON.pretty_generate(schema_hash)
229
- .gsub(/\"(\w+)\":/, '\1:') # Convert keys to symbols
230
- .gsub(': null', ': nil') # Convert `null` to `nil`
221
+ .gsub(/"(\w+)":/, '\1:') # Convert keys to symbols
222
+ .gsub(': null', ': nil') # Convert `null` to `nil`
231
223
 
232
- File.open("db/structure.rb", 'w') do |file|
224
+ File.open('db/structure.rb', 'w') do |file|
233
225
  file.puts "STRUCTURE = #{formatted_hash}"
234
226
  end
235
227
 
236
- color_puts "db/structure.rb updated", color: :green
228
+ color_puts('db/structure.rb updated', color: :green)
237
229
  end
238
230
 
239
-
240
- if command == 'run'
231
+ case command
232
+ when 'run'
241
233
  Rubee::Autoload.call
242
234
  file_names = if file_name == 'all'
243
235
  lib = Rubee::PROJECT_NAME == 'rubee' ? '/lib' : ''
244
- Dir.glob(".#{lib}/db/*.rb").map { |file| File.basename(file, '.rb') }.select { |file| file != 'structure' }
236
+ Dir.glob(".#{lib}/db/*.rb").map do |file|
237
+ File.basename(file, '.rb')
238
+ end.reject { |file| file == 'structure' }
245
239
  else
246
240
  [file_name]
247
241
  end
248
242
  Rubee::Configuration.envs.each do |env|
249
243
  ENV['RACK_ENV'] = env.to_s
250
244
  file_names.each do |file_name|
251
- color_puts "Run #{file_name} file for #{env} env", color: :cyan
245
+ color_puts("Run #{file_name} file for #{env} env", color: :cyan)
252
246
  Object.const_get(file_name.split('_').map(&:capitalize).join).new.call
253
247
  end
254
248
  end
255
- color_puts "Migration for #{file_name} completed", color: :green
249
+ color_puts("Migration for #{file_name} completed", color: :green)
256
250
  unless Rubee::PROJECT_NAME == 'rubee'
257
- color_puts "Regenerate schema file", color: :cyan
251
+ color_puts('Regenerate schema file', color: :cyan)
258
252
  generate_structure
259
253
  end
260
- elsif command == 'init'
254
+ when 'init'
261
255
  ensure_database_exists(Rubee::Configuration.get_database_url)
262
- elsif command == 'structure'
256
+ when 'structure'
263
257
  generate_structure
264
258
  else
265
- color_puts "Unknown command: #{command}", color: :red
259
+ color_puts("Unknown command: #{command}", color: :red)
266
260
  end
267
- elsif ['console'].include? command
261
+ elsif ['console'].include?(command)
268
262
  ARGV.clear
269
263
  ENV['RACK_ENV'] ||= 'development'
270
264
 
271
265
  Rubee::Autoload.call
272
266
  if Rubee::PROJECT_NAME == 'rubee'
273
- Rubee::Configuration.setup(env=:test) do |config|
274
- config.database_url = { url: "sqlite://lib/tests/test.db", env: }
267
+ Rubee::Configuration.setup(env = :test) do |config|
268
+ config.database_url = { url: 'sqlite://lib/tests/test.db', env: }
275
269
  end
276
270
  Rubee::Autoload.call
277
271
  Rubee::SequelObject.reconnect!
@@ -279,13 +273,13 @@ elsif ['console'].include? command
279
273
 
280
274
  def reload
281
275
  app_files = Dir["./#{Rubee::APP_ROOT}/**/*.rb"]
282
- app_files.each { |file| load file }
283
- color_puts "Reloaded ..", color: :green
276
+ app_files.each { |file| load(file) }
277
+ color_puts('Reloaded ..', color: :green)
284
278
  end
285
279
  begin
286
280
  # Start IRB
287
281
  IRB.start
288
- rescue Exception => e
282
+ rescue Exception
289
283
  IRB.start
290
284
  end
291
285
  else
@@ -1,11 +1,11 @@
1
- Rubee::Configuration.setup(env=:development) do |config|
2
- config.database_url = { url: "sqlite://db/development.db", env: }
1
+ Rubee::Configuration.setup(env = :development) do |config|
2
+ config.database_url = { url: 'sqlite://db/development.db', env: }
3
3
  end
4
4
 
5
- Rubee::Configuration.setup(env=:test) do |config|
6
- config.database_url = { url: "sqlite://db/test.db", env: }
5
+ Rubee::Configuration.setup(env = :test) do |config|
6
+ config.database_url = { url: 'sqlite://db/test.db', env: }
7
7
  end
8
8
 
9
- Rubee::Configuration.setup(env=:production) do |config|
10
- config.database_url = { url: "sqlite://db/production.db", env: }
9
+ Rubee::Configuration.setup(env = :production) do |config|
10
+ config.database_url = { url: 'sqlite://db/production.db', env: }
11
11
  end
data/lib/config/routes.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  Rubee::Router.draw do |router|
2
- router.get "/", to: "welcome#show" # override it for your app
2
+ router.get('/', to: 'welcome#show') # override it for your app
3
3
  end
@@ -1,14 +1,14 @@
1
1
  class CreateAccounts
2
2
  def call
3
- unless Rubee::SequelObject::DB.tables.include?(:accounts)
4
- Rubee::SequelObject::DB.create_table :accounts do
5
- primary_key :id
6
- String :addres
7
- foreign_key :user_id, :users
8
- end
3
+ return if Rubee::SequelObject::DB.tables.include?(:accounts)
9
4
 
10
- Account.create(addres: "13th Ave, NY", user_id: User.all.first.id)
11
- Account.create(addres: "14th Ave, NY", user_id: User.all.last.id)
5
+ Rubee::SequelObject::DB.create_table(:accounts) do
6
+ primary_key(:id)
7
+ String(:addres)
8
+ foreign_key(:user_id, :users)
12
9
  end
10
+
11
+ Account.create(addres: '13th Ave, NY', user_id: User.all.first.id)
12
+ Account.create(addres: '14th Ave, NY', user_id: User.all.last.id)
13
13
  end
14
14
  end
@@ -1,13 +1,13 @@
1
1
  class CreateComments
2
2
  def call
3
- unless Rubee::SequelObject::DB.tables.include?(:comments)
4
- Rubee::SequelObject::DB.create_table :comments do
5
- primary_key :id
6
- String :text
7
- Integer :user_id
8
- end
3
+ return if Rubee::SequelObject::DB.tables.include?(:comments)
9
4
 
10
- User.create(email: "ok@ok.com", password: "password")
5
+ Rubee::SequelObject::DB.create_table(:comments) do
6
+ primary_key(:id)
7
+ String(:text)
8
+ Integer(:user_id)
11
9
  end
10
+
11
+ User.create(email: 'ok@ok.com', password: 'password')
12
12
  end
13
13
  end
@@ -1,14 +1,14 @@
1
1
  class CreatePosts
2
2
  def call
3
- unless Rubee::SequelObject::DB.tables.include?(:posts)
4
- Rubee::SequelObject::DB.create_table :posts do
5
- primary_key :id
6
- foreign_key :user_id, :users
7
- foreign_key :comment_id, :comments
8
- end
3
+ return if Rubee::SequelObject::DB.tables.include?(:posts)
9
4
 
10
- Post.create(user_id: User.all.first.id, comment_id: Comment.all.first.id)
11
- Post.create(user_id: User.all.last.id, comment_id: Comment.all.last.id)
5
+ Rubee::SequelObject::DB.create_table(:posts) do
6
+ primary_key(:id)
7
+ foreign_key(:user_id, :users)
8
+ foreign_key(:comment_id, :comments)
12
9
  end
10
+
11
+ Post.create(user_id: User.all.first.id, comment_id: Comment.all.first.id)
12
+ Post.create(user_id: User.all.last.id, comment_id: Comment.all.last.id)
13
13
  end
14
14
  end
@@ -2,15 +2,15 @@
2
2
  # Please make sure you executed it before using AuthTokenable module
3
3
  class CreateUsers
4
4
  def call
5
- unless Rubee::SequelObject::DB.tables.include?(:users)
6
- Rubee::SequelObject::DB.create_table :users do
7
- primary_key :id
8
- String :email
9
- String :password
10
- index :email
11
- end
5
+ return if Rubee::SequelObject::DB.tables.include?(:users)
12
6
 
13
- User.create(email: "ok@ok.com", password: "password")
7
+ Rubee::SequelObject::DB.create_table(:users) do
8
+ primary_key(:id)
9
+ String(:email)
10
+ String(:password)
11
+ index(:email)
14
12
  end
13
+
14
+ User.create(email: 'ok@ok.com', password: 'password')
15
15
  end
16
16
  end
data/lib/db/structure.rb CHANGED
@@ -4,123 +4,123 @@ STRUCTURE = {
4
4
  generated: false,
5
5
  allow_null: false,
6
6
  default: nil,
7
- db_type: "INTEGER",
7
+ db_type: 'INTEGER',
8
8
  primary_key: true,
9
9
  auto_increment: true,
10
- type: "integer",
11
- ruby_default: nil
10
+ type: 'integer',
11
+ ruby_default: nil,
12
12
  },
13
13
  email: {
14
14
  generated: false,
15
15
  allow_null: true,
16
16
  default: nil,
17
- db_type: "varchar(255)",
17
+ db_type: 'varchar(255)',
18
18
  primary_key: false,
19
- type: "string",
19
+ type: 'string',
20
20
  ruby_default: nil,
21
- max_length: 255
21
+ max_length: 255,
22
22
  },
23
23
  password: {
24
24
  generated: false,
25
25
  allow_null: true,
26
26
  default: nil,
27
- db_type: "varchar(255)",
27
+ db_type: 'varchar(255)',
28
28
  primary_key: false,
29
- type: "string",
29
+ type: 'string',
30
30
  ruby_default: nil,
31
- max_length: 255
32
- }
31
+ max_length: 255,
32
+ },
33
33
  },
34
34
  accounts: {
35
35
  id: {
36
36
  generated: false,
37
37
  allow_null: false,
38
38
  default: nil,
39
- db_type: "INTEGER",
39
+ db_type: 'INTEGER',
40
40
  primary_key: true,
41
41
  auto_increment: true,
42
- type: "integer",
43
- ruby_default: nil
42
+ type: 'integer',
43
+ ruby_default: nil,
44
44
  },
45
45
  addres: {
46
46
  generated: false,
47
47
  allow_null: true,
48
48
  default: nil,
49
- db_type: "varchar(255)",
49
+ db_type: 'varchar(255)',
50
50
  primary_key: false,
51
- type: "string",
51
+ type: 'string',
52
52
  ruby_default: nil,
53
- max_length: 255
53
+ max_length: 255,
54
54
  },
55
55
  user_id: {
56
56
  generated: false,
57
57
  allow_null: true,
58
58
  default: nil,
59
- db_type: "INTEGER",
59
+ db_type: 'INTEGER',
60
60
  primary_key: false,
61
- type: "integer",
62
- ruby_default: nil
63
- }
61
+ type: 'integer',
62
+ ruby_default: nil,
63
+ },
64
64
  },
65
65
  posts: {
66
66
  id: {
67
67
  generated: false,
68
68
  allow_null: false,
69
69
  default: nil,
70
- db_type: "INTEGER",
70
+ db_type: 'INTEGER',
71
71
  primary_key: true,
72
72
  auto_increment: true,
73
- type: "integer",
74
- ruby_default: nil
73
+ type: 'integer',
74
+ ruby_default: nil,
75
75
  },
76
76
  user_id: {
77
77
  generated: false,
78
78
  allow_null: true,
79
79
  default: nil,
80
- db_type: "INTEGER",
80
+ db_type: 'INTEGER',
81
81
  primary_key: false,
82
- type: "integer",
83
- ruby_default: nil
82
+ type: 'integer',
83
+ ruby_default: nil,
84
84
  },
85
85
  comment_id: {
86
86
  generated: false,
87
87
  allow_null: true,
88
88
  default: nil,
89
- db_type: "INTEGER",
89
+ db_type: 'INTEGER',
90
90
  primary_key: false,
91
- type: "integer",
92
- ruby_default: nil
93
- }
91
+ type: 'integer',
92
+ ruby_default: nil,
93
+ },
94
94
  },
95
95
  comments: {
96
96
  id: {
97
97
  generated: false,
98
98
  allow_null: false,
99
99
  default: nil,
100
- db_type: "INTEGER",
100
+ db_type: 'INTEGER',
101
101
  primary_key: true,
102
102
  auto_increment: true,
103
- type: "integer",
104
- ruby_default: nil
103
+ type: 'integer',
104
+ ruby_default: nil,
105
105
  },
106
106
  text: {
107
107
  generated: false,
108
108
  allow_null: true,
109
109
  default: nil,
110
- db_type: "varchar(255)",
110
+ db_type: 'varchar(255)',
111
111
  primary_key: false,
112
- type: "string",
112
+ type: 'string',
113
113
  ruby_default: nil,
114
- max_length: 255
114
+ max_length: 255,
115
115
  },
116
116
  user_id: {
117
117
  generated: false,
118
118
  allow_null: true,
119
119
  default: nil,
120
- db_type: "INTEGER",
120
+ db_type: 'INTEGER',
121
121
  primary_key: false,
122
- type: "integer",
123
- ruby_default: nil
124
- }
125
- }
126
- }
122
+ type: 'integer',
123
+ ruby_default: nil,
124
+ },
125
+ },
126
+ }.freeze
@@ -19,6 +19,6 @@ def color_puts(text, color: :nil, background: :nil, style: :normal)
19
19
  color_code = colors[color]
20
20
  bg_code = backgrounds[background]
21
21
  style_code = styles[style]
22
- options = [style_code, color_code, bg_code].compact.join(";")
22
+ options = [style_code, color_code, bg_code].compact.join(';')
23
23
  puts "\e[#{options}m#{text}\e[0m"
24
24
  end
@@ -1,5 +1,5 @@
1
1
  unless defined?(Rubee)
2
- require_relative '../../../../rubee.rb'
2
+ require_relative '../../../../rubee'
3
3
  Rubee::Autoload.call
4
4
  end
5
5
 
@@ -11,7 +11,7 @@ module Rubee
11
11
  end
12
12
 
13
13
  def adapter
14
- @adapter ||= (Rubee::Configuration.get_async_adapter || ThreadAsync)
14
+ @adapter ||= Rubee::Configuration.get_async_adapter || ThreadAsync
15
15
  end
16
16
  end
17
17
  end