rubypitaya 2.7.5 → 2.8.0
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/lib/rubypitaya/app-template/Gemfile +1 -1
- data/lib/rubypitaya/app-template/Gemfile.lock +2 -2
- data/lib/rubypitaya/app-template/Makefile +5 -0
- data/lib/rubypitaya/app-template/Rakefile +19 -0
- data/lib/rubypitaya/app-template/app/app_initializer.rb +4 -1
- data/lib/rubypitaya/app-template/bin/console +8 -4
- data/lib/rubypitaya/app-template/kubernetes/deployment-rubypitaya.yaml +2 -2
- data/lib/rubypitaya/core/initializer_base.rb +4 -0
- data/lib/rubypitaya/core/initializer_broadcast.rb +18 -0
- data/lib/rubypitaya/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29b7ecc7e113e398e9295133b97a79f04af607848ba185db0005027af86b70c9
|
4
|
+
data.tar.gz: 6ae5d8f4b78041e30bf8d362f443ce18a22bdc3fd1f909afb037622b9b4201b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a4209c6106cca1ecd8f88cb7dc6db0615c4bb3e1455d5b4319a986cb76c96a9359edd2f1189292724e64b2f8e4b38f5156854f2ba42476fa1fda9d4ae68c1b1
|
7
|
+
data.tar.gz: 4fee00de34828c2810b64f4af518987c48963e5a9b48dd2e25b46accd31413b852e5f41ebcd55f989c467a342212c3f9888c07114147fee98371e18772497986
|
@@ -69,7 +69,7 @@ GEM
|
|
69
69
|
rspec-support (~> 3.8.0)
|
70
70
|
rspec-support (3.8.3)
|
71
71
|
ruby2_keywords (0.0.2)
|
72
|
-
rubypitaya (2.
|
72
|
+
rubypitaya (2.8.0)
|
73
73
|
activerecord (= 6.0.2)
|
74
74
|
etcdv3 (= 0.10.2)
|
75
75
|
eventmachine (= 1.2.7)
|
@@ -106,7 +106,7 @@ DEPENDENCIES
|
|
106
106
|
listen (= 3.2.1)
|
107
107
|
pry (= 0.12.2)
|
108
108
|
rspec (= 3.8.0)
|
109
|
-
rubypitaya (= 2.
|
109
|
+
rubypitaya (= 2.8.0)
|
110
110
|
|
111
111
|
BUNDLED WITH
|
112
112
|
1.17.2
|
@@ -2,6 +2,7 @@ IMAGE_TAG ?= latest
|
|
2
2
|
IMAGE_REGISTRY ?= [put-your-registry-here]
|
3
3
|
KUBE_NAMESPACE ?= [put-your-namespace-here]
|
4
4
|
KUBE_DEPLOYMENT_SERVER ?= rubypitaya
|
5
|
+
KUBECONTEXT ?= ''
|
5
6
|
|
6
7
|
## Run ruby pitaya metagame project
|
7
8
|
run:
|
@@ -35,6 +36,10 @@ db-create:
|
|
35
36
|
db-migrate:
|
36
37
|
@docker-compose run --service-ports --rm rubypitaya bundle exec rake db:migrate
|
37
38
|
|
39
|
+
## Show migrations status on database
|
40
|
+
db-migrate-status:
|
41
|
+
@docker-compose run --service-ports --rm rubypitaya bundle exec rake db:status
|
42
|
+
|
38
43
|
## Rollback migrations STEP=1
|
39
44
|
db-rollback:
|
40
45
|
@docker-compose run --service-ports --rm -e STEP="$(STEP)" rubypitaya bundle exec rake db:rollback
|
@@ -75,6 +75,25 @@ namespace :db do
|
|
75
75
|
puts 'Database deleted.'
|
76
76
|
end
|
77
77
|
|
78
|
+
desc 'migration status'
|
79
|
+
task :status do
|
80
|
+
environment_name = ENV.fetch("RUBYPITAYA_ENV") { 'development' }
|
81
|
+
database_config = RubyPitaya::DatabaseConfig.new(environment_name, RubyPitaya::Path::DATABASE_CONFIG_PATH)
|
82
|
+
connection_data = database_config.connection_data
|
83
|
+
migrations_paths = [RubyPitaya::Path::Core::MIGRATIONS_FOLDER_PATH]
|
84
|
+
migrations_paths += RubyPitaya::Path::Plugins::MIGRATIONS_FOLDER_PATHS
|
85
|
+
migrations_paths += [RubyPitaya::Path::MIGRATIONS_FOLDER_PATH]
|
86
|
+
|
87
|
+
ActiveRecord::Base.establish_connection(connection_data)
|
88
|
+
ActiveRecord::Migrator.migrations_paths = migrations_paths
|
89
|
+
ActiveRecord::Base.connection.migration_context.migrations_status.each do |status, version, name|
|
90
|
+
puts "#{status.center(8)} #{version.ljust(14)} #{name}"
|
91
|
+
end
|
92
|
+
ActiveRecord::Base.connection.close
|
93
|
+
|
94
|
+
puts 'Rollback done.'
|
95
|
+
end
|
96
|
+
|
78
97
|
desc 'Reset the database'
|
79
98
|
task :reset do
|
80
99
|
Rake::Task['db:drop'].invoke
|
@@ -34,7 +34,6 @@ module MyApp
|
|
34
34
|
# - info
|
35
35
|
# - log information
|
36
36
|
|
37
|
-
|
38
37
|
def run(initializer_content)
|
39
38
|
bll = initializer_content.bll
|
40
39
|
|
@@ -42,5 +41,9 @@ module MyApp
|
|
42
41
|
|
43
42
|
bll.add_instance(:player, playerBll)
|
44
43
|
end
|
44
|
+
|
45
|
+
def self.path
|
46
|
+
__FILE__
|
47
|
+
end
|
45
48
|
end
|
46
49
|
end
|
@@ -18,10 +18,14 @@ Gem.find_files('rubypitaya/**/*.rb').each do |path|
|
|
18
18
|
path.include?('app-template')
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
app_folder_paths = RubyPitaya::Path::Plugins::APP_FOLDER_PATHS + [RubyPitaya::Path::APP_FOLDER_PATH]
|
22
|
+
app_folder_paths.each do |app_folder_path|
|
23
|
+
app_files_path = File.join(app_folder_path, '**/*.rb')
|
24
|
+
|
25
|
+
Dir[app_files_path].each do |path|
|
26
|
+
require path unless path.end_with?('spec.rb') ||
|
27
|
+
path.include?('db/migration')
|
28
|
+
end
|
25
29
|
end
|
26
30
|
|
27
31
|
require 'irb'
|
@@ -16,7 +16,7 @@ spec:
|
|
16
16
|
spec:
|
17
17
|
containers:
|
18
18
|
- name: rubypitaya
|
19
|
-
image:
|
19
|
+
image: registry.gitlab.com/lucianopc/ruby-pitaya:latest
|
20
20
|
command: ["bundle", "exec", "rubypitaya", "run"]
|
21
21
|
ports:
|
22
22
|
- containerPort: 4567
|
@@ -45,4 +45,4 @@ spec:
|
|
45
45
|
- name: DATABASE_NAME
|
46
46
|
value: "ruby_pitaya"
|
47
47
|
imagePullSecrets:
|
48
|
-
- name: gitlab-registry
|
48
|
+
- name: gitlab-registry
|
@@ -6,7 +6,25 @@ module RubyPitaya
|
|
6
6
|
class InitializerBroadcast
|
7
7
|
|
8
8
|
def run(initializer_content)
|
9
|
+
app_classes = []
|
10
|
+
plugin_classes = []
|
11
|
+
|
9
12
|
ObjectSpace.each_object(InitializerBase.singleton_class) do |klass|
|
13
|
+
is_plugin_class = klass.path.include?('plugins')
|
14
|
+
|
15
|
+
if is_plugin_class
|
16
|
+
plugin_classes << klass
|
17
|
+
else
|
18
|
+
app_classes << klass
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
plugin_classes.each do |klass|
|
23
|
+
instance = klass.new
|
24
|
+
instance.run(initializer_content)
|
25
|
+
end
|
26
|
+
|
27
|
+
app_classes.each do |klass|
|
10
28
|
instance = klass.new
|
11
29
|
instance.run(initializer_content)
|
12
30
|
end
|
data/lib/rubypitaya/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubypitaya
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luciano Prestes Cavalcanti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|