rubypitaya 2.9.0 → 2.9.1
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/rubypitaya +23 -1
- data/lib/rubypitaya.rb +14 -0
- data/lib/rubypitaya/app-template/Gemfile +1 -1
- data/lib/rubypitaya/app-template/Gemfile.lock +2 -2
- data/lib/rubypitaya/app-template/Makefile +4 -0
- data/lib/rubypitaya/core/path.rb +1 -0
- data/lib/rubypitaya/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ab54a69fe61d66985ab96ae5ae8352a5513f6d2421ae706baca351e7c52d9c3
|
4
|
+
data.tar.gz: 57aedd19e1426c1935224fa2510224856ef1cb3b79754eef9f9c4f237aba9aae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bbc810cac4352e074c6286b154c3a5b547783a4e81859a63d03fa08b78b2e15bdbdff4ec7a630f0aa8027fd07fb30002e55e4c82aa006def2b5d7d7674b01e2
|
7
|
+
data.tar.gz: caf3e3cc055e0498c219a97a516baa3c83c7f1e9054b68bc057312402fb660053d640d3d0530ed31d9be4617a507e27ff0751bdea64133470e7fe451d8b43fbc
|
data/bin/rubypitaya
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'rubypitaya'
|
4
4
|
|
5
|
-
COMMANDS = ['run', 'create', 'create-migration']
|
5
|
+
COMMANDS = ['run', 'create', 'create-migration', 'add-plugin']
|
6
6
|
|
7
7
|
def main
|
8
8
|
if ARGV.size == 0 || !COMMANDS.include?(ARGV[0])
|
@@ -23,6 +23,10 @@ def main
|
|
23
23
|
if command == 'create-migration'
|
24
24
|
command_create_migration(ARGV)
|
25
25
|
end
|
26
|
+
|
27
|
+
if command == 'add-plugin'
|
28
|
+
command_add_plugin(ARGV)
|
29
|
+
end
|
26
30
|
end
|
27
31
|
|
28
32
|
def command_run(argv)
|
@@ -57,6 +61,19 @@ def command_create_migration(argv)
|
|
57
61
|
puts "Migration #{migration_file_name} created!"
|
58
62
|
end
|
59
63
|
|
64
|
+
def command_add_plugin(argv)
|
65
|
+
if argv.size <= 1
|
66
|
+
show_help_add_plugin()
|
67
|
+
exit(-1)
|
68
|
+
end
|
69
|
+
|
70
|
+
plugin_git_link = argv[1]
|
71
|
+
|
72
|
+
plugin_name = RubyPitaya::RubyPitaya.add_plugin(plugin_git_link)
|
73
|
+
|
74
|
+
puts "Plugin #{plugin_name} added!"
|
75
|
+
end
|
76
|
+
|
60
77
|
def show_help
|
61
78
|
puts 'Usage: $ rubypitaya [COMMAND]'
|
62
79
|
puts 'COMMAND:'
|
@@ -76,4 +93,9 @@ def show_help_create_migration
|
|
76
93
|
puts ''
|
77
94
|
end
|
78
95
|
|
96
|
+
def show_help_add_plugin
|
97
|
+
puts 'Usage: $ rubypitaya create-migration [migration_name]'
|
98
|
+
puts ''
|
99
|
+
end
|
100
|
+
|
79
101
|
main
|
data/lib/rubypitaya.rb
CHANGED
@@ -37,5 +37,19 @@ module RubyPitaya
|
|
37
37
|
|
38
38
|
migration_file_name
|
39
39
|
end
|
40
|
+
|
41
|
+
def self.add_plugin(plugin_git_link)
|
42
|
+
Dir.mkdir(Path::PLUGINS_FOLDER_PATH) unless File.exists?(Path::PLUGINS_FOLDER_PATH)
|
43
|
+
|
44
|
+
plugin_name = plugin_git_link.scan(/.+\/(.+)\.git/).flatten.first
|
45
|
+
plugin_folder_path = File.join(Path::PLUGINS_FOLDER_PATH, plugin_name)
|
46
|
+
plugin_git_path = File.join(plugin_folder_path, '.git/')
|
47
|
+
|
48
|
+
FileUtils.rm_rf(plugin_folder_path) if File.exists?(plugin_folder_path)
|
49
|
+
`git -C #{Path::PLUGINS_FOLDER_PATH} clone #{plugin_git_link}`
|
50
|
+
FileUtils.rm_rf(plugin_git_path)
|
51
|
+
|
52
|
+
plugin_name
|
53
|
+
end
|
40
54
|
end
|
41
55
|
end
|
@@ -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.9.
|
72
|
+
rubypitaya (2.9.1)
|
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.9.
|
109
|
+
rubypitaya (= 2.9.1)
|
110
110
|
|
111
111
|
BUNDLED WITH
|
112
112
|
1.17.2
|
@@ -32,6 +32,10 @@ bash:
|
|
32
32
|
create-migration:
|
33
33
|
@docker-compose run --service-ports --rm rubypitaya-console bundle exec rubypitaya create-migration $(NAME)
|
34
34
|
|
35
|
+
## Add or update a plugim. GIT=[plugin-git-link]
|
36
|
+
add-plugin:
|
37
|
+
@docker-compose run --service-ports --rm rubypitaya-console bundle exec rubypitaya add-plugin $(GIT)
|
38
|
+
|
35
39
|
## Create database
|
36
40
|
db-create:
|
37
41
|
@docker-compose run --service-ports --rm rubypitaya bundle exec rake db:create
|
data/lib/rubypitaya/core/path.rb
CHANGED
@@ -11,6 +11,7 @@ module RubyPitaya
|
|
11
11
|
APP_CONFIG_FOLDER_PATH = File.join(Dir.pwd, 'app/config/')
|
12
12
|
APP_SETUP_FOLDER_PATH = File.join(Dir.pwd, 'app/setup/')
|
13
13
|
MIGRATIONS_FOLDER_PATH = File.join(Dir.pwd, 'db/migration/')
|
14
|
+
PLUGINS_FOLDER_PATH = File.join(Dir.pwd, 'plugins/')
|
14
15
|
|
15
16
|
ROUTES_FILE_PATH = File.join(Dir.pwd, 'config/routes.rb')
|
16
17
|
|
data/lib/rubypitaya/version.rb
CHANGED