rubypitaya 2.11.2 → 2.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubypitaya.rb +11 -0
- data/lib/rubypitaya/app-template/.gitlab-ci.yml +0 -1
- data/lib/rubypitaya/app-template/Gemfile +1 -1
- data/lib/rubypitaya/app-template/Gemfile.lock +2 -2
- data/lib/rubypitaya/app-template/Makefile +9 -9
- data/lib/rubypitaya/app-template/docker-compose.yml +6 -0
- data/lib/rubypitaya/app-template/features/step_definitions/rubypitaya_steps.rb +11 -7
- data/lib/rubypitaya/app-template/features/support/env.rb +7 -0
- data/lib/rubypitaya/core/templates/template_migration.rb.erb +1 -1
- 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: 545395137fd805934f481bfd80cbe531579a968923a755b3ad715c2d585222d2
|
4
|
+
data.tar.gz: 126432e40f15067cd120f36213819076ec2480c9d84365621b11aa8c918f2e4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e2560d693758d519856c75f15acc9c8b66314b7fb27b4ebd2b866ae510770eff0f1ec287e80800d316efb904a2da02969f80d046311a6c0f284d75b2153d908
|
7
|
+
data.tar.gz: 2392c071b2a0e0673faf4b155e510dc0c07645e5c9dd494eecc45189be92b4eabaafe9b4d82395055560c86aace25a0c5bf67afac30a3f8009b4d523561e7a25
|
data/lib/rubypitaya.rb
CHANGED
@@ -49,6 +49,17 @@ module RubyPitaya
|
|
49
49
|
`git -C #{Path::PLUGINS_FOLDER_PATH} clone #{plugin_git_link}`
|
50
50
|
FileUtils.rm_rf(plugin_git_path)
|
51
51
|
|
52
|
+
plugin_migrations_path = File.join(plugin_folder_path, 'db/migration/')
|
53
|
+
plugin_migrations_files = Dir[File.join(plugin_migrations_path, '*')]
|
54
|
+
base_migration_timestamp = Time.now.utc.to_i
|
55
|
+
|
56
|
+
plugin_migrations_files.each_with_index do |migration_file, i|
|
57
|
+
migration_timestamp = base_migration_timestamp + i
|
58
|
+
new_file = migration_file.gsub(/^(.+\/migration\/)\d+(_.+)$/, "\\1#{migration_timestamp}\\2")
|
59
|
+
|
60
|
+
File.rename(migration_file, new_file)
|
61
|
+
end
|
62
|
+
|
52
63
|
plugin_name
|
53
64
|
end
|
54
65
|
end
|
@@ -84,7 +84,7 @@ GEM
|
|
84
84
|
rspec-support (~> 3.8.0)
|
85
85
|
rspec-support (3.8.3)
|
86
86
|
ruby2_keywords (0.0.2)
|
87
|
-
rubypitaya (2.
|
87
|
+
rubypitaya (2.12.0)
|
88
88
|
activerecord (= 6.0.2)
|
89
89
|
etcdv3 (= 0.10.2)
|
90
90
|
eventmachine (= 1.2.7)
|
@@ -123,7 +123,7 @@ DEPENDENCIES
|
|
123
123
|
listen (= 3.2.1)
|
124
124
|
pry (= 0.12.2)
|
125
125
|
rspec (= 3.8.0)
|
126
|
-
rubypitaya (= 2.
|
126
|
+
rubypitaya (= 2.12.0)
|
127
127
|
|
128
128
|
BUNDLED WITH
|
129
129
|
1.17.2
|
@@ -47,41 +47,41 @@ update-dependencies:
|
|
47
47
|
|
48
48
|
## Create new migrgation. NAME=[migration-name]
|
49
49
|
create-migration:
|
50
|
-
@docker-compose run --service-ports --rm rubypitaya-
|
50
|
+
@docker-compose run --service-ports --rm rubypitaya-commands bundle exec rubypitaya create-migration $(NAME)
|
51
51
|
|
52
52
|
## Add or update a plugim. GIT=[plugin-git-link]
|
53
53
|
add-plugin:
|
54
|
-
@docker-compose run --service-ports --rm rubypitaya-
|
54
|
+
@docker-compose run --service-ports --rm rubypitaya-commands bundle exec rubypitaya add-plugin $(GIT)
|
55
55
|
|
56
56
|
## + Database Commands
|
57
57
|
|
58
58
|
## Create database
|
59
59
|
db-create:
|
60
|
-
@docker-compose run --service-ports --rm rubypitaya bundle exec rake db:create
|
60
|
+
@docker-compose run --service-ports --rm rubypitaya-commands bundle exec rake db:create
|
61
61
|
|
62
62
|
## Run migrations to database
|
63
63
|
db-migrate:
|
64
|
-
@docker-compose run --service-ports --rm rubypitaya bundle exec rake db:migrate
|
64
|
+
@docker-compose run --service-ports --rm rubypitaya-commands bundle exec rake db:migrate
|
65
65
|
|
66
66
|
## Show migrations status on database
|
67
67
|
db-migrate-status:
|
68
|
-
@docker-compose run --service-ports --rm rubypitaya bundle exec rake db:status
|
68
|
+
@docker-compose run --service-ports --rm rubypitaya-commands bundle exec rake db:status
|
69
69
|
|
70
70
|
## Rollback migrations STEP=1
|
71
71
|
db-rollback:
|
72
|
-
@docker-compose run --service-ports --rm -e STEP="$(STEP)" rubypitaya bundle exec rake db:rollback
|
72
|
+
@docker-compose run --service-ports --rm -e STEP="$(STEP)" rubypitaya-commands bundle exec rake db:rollback
|
73
73
|
|
74
74
|
## Drop database
|
75
75
|
db-drop:
|
76
|
-
@docker-compose run --service-ports --rm rubypitaya bundle exec rake db:drop
|
76
|
+
@docker-compose run --service-ports --rm rubypitaya-commands bundle exec rake db:drop
|
77
77
|
|
78
78
|
## Reset database
|
79
79
|
db-reset:
|
80
|
-
@docker-compose run --service-ports --rm rubypitaya bundle exec rake db:reset
|
80
|
+
@docker-compose run --service-ports --rm rubypitaya-commands bundle exec rake db:reset
|
81
81
|
|
82
82
|
## Setup test database
|
83
83
|
db-test-setup:
|
84
|
-
@docker-compose run --service-ports --rm rubypitaya bundle exec rake db:test:setup
|
84
|
+
@docker-compose run --service-ports --rm rubypitaya-commands bundle exec rake db:test:setup
|
85
85
|
|
86
86
|
## + Deployment commands
|
87
87
|
|
@@ -1,10 +1,3 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
|
3
|
-
ENV['RUBYPITAYA_ENV'] = 'test'
|
4
|
-
|
5
|
-
require 'rubypitaya/core/helpers/setup_helper'
|
6
|
-
require 'rubypitaya/core/spec-helpers/handler_spec_helper_class'
|
7
|
-
|
8
1
|
Given(/^[Cc]lient call route ["'](.+)["']$/) do |route|
|
9
2
|
@handler_helper.request(route)
|
10
3
|
end
|
@@ -30,10 +23,21 @@ Given(/^[Cc]onfig key ["'](.+)["'] is ["'](.+)["']$/) do |key, value|
|
|
30
23
|
@handler_helper.add_config(key, value)
|
31
24
|
end
|
32
25
|
|
26
|
+
Given(/^[Cc]onfig is the following json[:]*$/) do |config_json|
|
27
|
+
config = JSON.parse(config_json)
|
28
|
+
@handler_helper.set_config(config)
|
29
|
+
end
|
30
|
+
|
33
31
|
Given(/^[Pp]rint server response$/) do
|
34
32
|
puts "response: #{@handler_helper.response}"
|
35
33
|
end
|
36
34
|
|
35
|
+
Given(/^(?:[Nn]ow\s)?[Tt]oday is ["'](.+)["']$/) do |date_text|
|
36
|
+
time_now = date_text.to_time
|
37
|
+
|
38
|
+
Time.stub(:now).and_return(time_now)
|
39
|
+
end
|
40
|
+
|
37
41
|
Before do
|
38
42
|
ActiveRecord::Base.descendants.each { |c| c.delete_all unless c == ActiveRecord::SchemaMigration }
|
39
43
|
@handler_helper = RubyPitaya::HandlerSpecHelperClass.new('cucumber')
|
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.12.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: 2021-01-
|
11
|
+
date: 2021-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|