rubypitaya 3.10.0 → 3.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c504da4f358b8b73e07c17883c293bf185c6ca2328d4a13bba0a88523b85e9cf
4
- data.tar.gz: f850e834117933afd8db27dc771dc3326c8953083db06facdec0a839872c7a00
3
+ metadata.gz: bad9c41d62bb4942b96dfff5b40dc4ae4ca1d8eba3ee2707721bdf59739c0182
4
+ data.tar.gz: da92de658a771d3a37008412964e3f5d976fab512c804de1147bfc6afdc5208d
5
5
  SHA512:
6
- metadata.gz: d5f8c32268f3e0a943b65601483f30f560f3e2ae0bac19efcd65705215e84d6f61b10355096d606a804c0f9967654806b105ea195dc05dc4878e534d2e0245b0
7
- data.tar.gz: f9ee5fcefa9e332e015ac228e5dcdaa09b1ad66b20222942660df14f72d6cd09cbc2c1b1c8c6c4a749b143331b68c3bf50d8513aecfd86ac7c611265cd472794
6
+ metadata.gz: a635d4835b2d1115615a586c96062437ec81c216c617c92284a863fc7859fce75c0e3b537b34c11f2a2e05460f464698122cc6c7916038ec39cc9c8166725797
7
+ data.tar.gz: 952703d5f8b7febd62567805ae45ae3bc26e9a06dc8fbcaa1494a205478d277b062b92c7a4f773ca4baecff0a2fced207d41e4f1cbc28e80af5778ea09dd34be
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'rubypitaya', '3.10.0'
3
+ gem 'rubypitaya', '3.11.0'
4
4
 
5
5
  group :development do
6
6
  gem 'pry', '0.14.1'
@@ -11,7 +11,6 @@ GEM
11
11
  i18n (>= 1.6, < 2)
12
12
  minitest (>= 5.1)
13
13
  tzinfo (~> 2.0)
14
- bson (4.14.1)
15
14
  builder (3.2.4)
16
15
  coderay (1.1.3)
17
16
  concurrent-ruby (1.1.9)
@@ -65,8 +64,6 @@ GEM
65
64
  mime-types-data (~> 3.2015)
66
65
  mime-types-data (3.2022.0105)
67
66
  minitest (5.15.0)
68
- mongo (2.17.0)
69
- bson (>= 4.8.2, < 5.0.0)
70
67
  multi_json (1.15.0)
71
68
  multi_test (0.1.2)
72
69
  mustermann (1.1.1)
@@ -99,11 +96,10 @@ GEM
99
96
  rspec-support (~> 3.11.0)
100
97
  rspec-support (3.11.0)
101
98
  ruby2_keywords (0.0.5)
102
- rubypitaya (3.10.0)
99
+ rubypitaya (3.11.0)
103
100
  activerecord (= 7.0.2)
104
101
  etcdv3 (= 0.11.5)
105
102
  google-protobuf (= 3.19.4)
106
- mongo (= 2.17.0)
107
103
  nats-pure (= 2.0.0)
108
104
  ostruct (= 0.5.3)
109
105
  pg (= 1.3.1)
@@ -138,7 +134,7 @@ DEPENDENCIES
138
134
  listen (= 3.7.1)
139
135
  pry (= 0.14.1)
140
136
  rspec (= 3.11.0)
141
- rubypitaya (= 3.10.0)
137
+ rubypitaya (= 3.11.0)
142
138
  sinatra-contrib (= 2.1.0)
143
139
 
144
140
  BUNDLED WITH
@@ -1,4 +1,3 @@
1
- require 'rubypitaya/core/app/services/mongo_service'
2
1
  require 'rubypitaya/core/app/services/redis_service'
3
2
 
4
3
  class AppInitializer < RubyPitaya::InitializerBase
@@ -30,17 +29,15 @@ class AppInitializer < RubyPitaya::InitializerBase
30
29
  #
31
30
  # services:
32
31
  # - redis
33
- # - link: https://github.com/redis/redis-rb/
32
+ # - link:
33
+ # - https://github.com/redis/redis-rb/
34
+ # - https://gitlab.com/LucianoPC/ruby-pitaya/-/blob/master/lib/rubypitaya/core/app/services/redis_service.rb
34
35
  #
35
- # - mongo
36
- # - class: Mongo::Client
37
- # - link: https://docs.mongodb.com/ruby-driver/current/tutorials/quick-start/
38
36
 
39
37
  def run(initializer_content)
40
38
  setup = initializer_content.setup
41
39
  services = initializer_content.services
42
40
 
43
- services.add(:mongo, RubyPitaya::MongoService.new(setup))
44
41
  services.add(:redis, RubyPitaya::RedisService.new(setup))
45
42
 
46
43
  playerBll = PlayerBLL.new
@@ -40,11 +40,10 @@ class PlayerHandler < RubyPitaya::HandlerBase
40
40
  #
41
41
  # - @services:
42
42
  # - redis
43
- # - link: https://github.com/redis/redis-rb/
43
+ # - link:
44
+ # - https://github.com/redis/redis-rb/
45
+ # - https://gitlab.com/LucianoPC/ruby-pitaya/-/blob/master/lib/rubypitaya/core/app/services/redis_service.rb
44
46
  #
45
- # - mongo
46
- # - class: Mongo::Client
47
- # - link: https://docs.mongodb.com/ruby-driver/current/tutorials/quick-start/
48
47
 
49
48
  non_authenticated_actions :authenticate
50
49
 
@@ -21,12 +21,6 @@ database:
21
21
  password: 'postgres'
22
22
  name: 'ruby_pitaya'
23
23
 
24
- mongo:
25
- url: mongo:27017
26
- user: 'user'
27
- pass: 'password'
28
- database: admin
29
-
30
24
  http:
31
25
  auth:
32
26
  user: 'user'
@@ -26,28 +26,6 @@ services:
26
26
  ports:
27
27
  - '9100:5432'
28
28
 
29
- mongo:
30
- image: mongo:5.0.3
31
- restart: always
32
- ports:
33
- - 27017:27017
34
- environment:
35
- MONGO_INITDB_ROOT_USERNAME: user
36
- MONGO_INITDB_ROOT_PASSWORD: password
37
-
38
- mongo-express:
39
- depends_on:
40
- - 'mongo'
41
- image: mongo-express:0.54.0
42
- restart: always
43
- ports:
44
- - 8081:8081
45
- environment:
46
- ME_CONFIG_MONGODB_ADMINUSERNAME: user
47
- ME_CONFIG_MONGODB_ADMINPASSWORD: password
48
- ME_CONFIG_MONGODB_SERVER: 'mongo'
49
- ME_CONFIG_MONGODB_PORT: '27017'
50
-
51
29
  connector:
52
30
  image: 'registry.gitlab.com/lucianopc/pitaya-connector:0.1.0'
53
31
  depends_on:
@@ -71,8 +49,6 @@ services:
71
49
  - 'nats'
72
50
  - 'etcd'
73
51
  - 'redis'
74
- - 'mongo'
75
- - 'mongo-express'
76
52
  - 'connector'
77
53
  build:
78
54
  context: '.'
@@ -29,7 +29,9 @@ module RubyPitaya
29
29
  @redis
30
30
  end
31
31
 
32
- def clear_all_data
32
+ protected
33
+
34
+ def on_clear_all_data
33
35
  @redis.flushall
34
36
  end
35
37
  end
@@ -10,12 +10,21 @@ module RubyPitaya
10
10
  raise "Service disconnect method not implemented"
11
11
  end
12
12
 
13
- # def get_service_instance
14
- # raise "Service get_service_instance method not implemented"
15
- # end
13
+ def client
14
+ raise "Service client method not implemented"
15
+ end
16
16
 
17
17
  def clear_all_data
18
- raise "Service disconnect method not implemented"
18
+ environment_name = ENV.fetch('RUBYPITAYA_SERVER_ENVIRONMENT', 'development')
19
+ is_test_environment = environment_name == 'test'
20
+
21
+ on_clear_all_data if is_test_environment
22
+ end
23
+
24
+ protected
25
+
26
+ def on_clear_all_data
27
+ raise "Service on_clear_all_data method not implemented"
19
28
  end
20
29
  end
21
30
  end
@@ -1,3 +1,3 @@
1
1
  module RubyPitaya
2
- VERSION = '3.10.0'
2
+ VERSION = '3.11.0'
3
3
  end
data/lib/rubypitaya.rb CHANGED
@@ -57,8 +57,10 @@ module RubyPitaya
57
57
 
58
58
  Dir.entries(plugin_folder_path).each do |entry|
59
59
  entry_path = File.join(plugin_folder_path, entry)
60
- FileUtils.rm_rf(entry_path) unless entry == 'app' ||
61
- entry == '.' ||
60
+ FileUtils.rm_rf(entry_path) unless entry == 'app' ||
61
+ entry == 'spec' ||
62
+ entry == 'features' ||
63
+ entry == '.' ||
62
64
  entry == '..'
63
65
  end
64
66
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubypitaya
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0
4
+ version: 3.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luciano Prestes Cavalcanti
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 13.0.6
41
- - !ruby/object:Gem::Dependency
42
- name: mongo
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '='
46
- - !ruby/object:Gem::Version
47
- version: 2.17.0
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '='
53
- - !ruby/object:Gem::Version
54
- version: 2.17.0
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: redis
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -340,7 +326,6 @@ files:
340
326
  - "./lib/rubypitaya/app-template/spec/spec_helper.rb"
341
327
  - "./lib/rubypitaya/core/app/migrations/0000000001_create_user_migration.rb"
342
328
  - "./lib/rubypitaya/core/app/models/user.rb"
343
- - "./lib/rubypitaya/core/app/services/mongo_service.rb"
344
329
  - "./lib/rubypitaya/core/app/services/redis_service.rb"
345
330
  - "./lib/rubypitaya/core/application_files_importer.rb"
346
331
  - "./lib/rubypitaya/core/config.rb"
@@ -1,35 +0,0 @@
1
- require 'mongo'
2
- require 'rubypitaya/core/service_base'
3
-
4
- module RubyPitaya
5
-
6
- class MongoService < ServiceBase
7
-
8
- def initialize(setup)
9
- @mongo = nil
10
- @mongo_address = setup['rubypitaya.mongo.url']
11
- @mongo_user = setup['rubypitaya.mongo.user']
12
- @mongo_password = setup['rubypitaya.mongo.pass']
13
- @mongo_database_name = setup['rubypitaya.mongo.database']
14
- end
15
-
16
- def connect
17
- @mongo = Mongo::Client.new([@mongo_address],
18
- user: @mongo_user,
19
- password: @mongo_password,
20
- database: @mongo_database_name)
21
- end
22
-
23
- def disconnect
24
- # TODO: implement it
25
- end
26
-
27
- def client
28
- @mongo
29
- end
30
-
31
- def clear_all_data
32
- # TODO: implement it
33
- end
34
- end
35
- end