rubypitaya 2.23.0 → 2.24.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: 3622a8779af46681d3a25d677021ef477a968e2a538d3dc7712c54a3bb5cd01d
4
- data.tar.gz: d3357dc303db00fc1d29c208557547d60def38e432558a8286313dce4a9776df
3
+ metadata.gz: 42695632f5f5199cbce5586b5600ef0297b4dad059397c523a5bf975cb192896
4
+ data.tar.gz: 37a55fabac4729035ef2d5129734e178745dcc3cb3056ab1b6c290cc68c2db93
5
5
  SHA512:
6
- metadata.gz: 7f253dd21e9999acbe8ca3e6f64795f5c434a392cc7ad58749d5d0ac964fd1261e1440ef28a676489ce545bc406f39d5e1547242cee04575b666acfbe9dac4cb
7
- data.tar.gz: 8ea11f029554fbb21abecb2f12dd69f6a40f6bff2dcb326e1bb28812be9261318bb650f8ff783b010fd68f5ac430de311263338d725b44e9715da914cc4ed2d6
6
+ metadata.gz: 296d521e0de245fbaa1895de1fa1298bbac7653e4419d36fec27166737e595a434b96e64020d203e0a6375ff445753cfd989d8242f11b11cb75644aea5952c0a
7
+ data.tar.gz: 11d0cbe5dbc539fa914fc6faae7ced4f13a908c7ecd6decef96168b9dbe7109a78b02ff34eb644514fb1015a84aca77f2e27361b00897ab5253e4fc467ec08fe
data/bin/rubypitaya CHANGED
@@ -67,9 +67,10 @@ def command_add_plugin(argv)
67
67
  exit(-1)
68
68
  end
69
69
 
70
- plugin_git_link = argv[1]
70
+ plugin_git_url = argv[1]
71
+ branch_name = argv[2] || ""
71
72
 
72
- plugin_name = RubyPitaya::RubyPitaya.add_plugin(plugin_git_link)
73
+ plugin_name = RubyPitaya::RubyPitaya.add_plugin(plugin_git_url, branch_name)
73
74
 
74
75
  puts "Plugin #{plugin_name} added!"
75
76
  end
@@ -94,7 +95,7 @@ def show_help_create_migration
94
95
  end
95
96
 
96
97
  def show_help_add_plugin
97
- puts 'Usage: $ rubypitaya add-plugin [plugin_git_link]'
98
+ puts 'Usage: $ rubypitaya add-plugin [plugin_git_link] [branch_name:optional]'
98
99
  puts ''
99
100
  end
100
101
 
data/lib/rubypitaya.rb CHANGED
@@ -38,15 +38,19 @@ module RubyPitaya
38
38
  migration_file_name
39
39
  end
40
40
 
41
- def self.add_plugin(plugin_git_link)
41
+ def self.add_plugin(plugin_git_url, branch_name)
42
42
  Dir.mkdir(Path::PLUGINS_FOLDER_PATH) unless File.exists?(Path::PLUGINS_FOLDER_PATH)
43
43
 
44
- plugin_name = plugin_git_link.scan(/.+\/(.+)\.git/).flatten.first
44
+ plugin_name = plugin_git_url.scan(/.+\/(.+)\.git/).flatten.first
45
45
  plugin_folder_path = File.join(Path::PLUGINS_FOLDER_PATH, plugin_name)
46
46
  plugin_git_path = File.join(plugin_folder_path, '.git/')
47
47
 
48
+ branch_command = ""
49
+ branch_command = "--branch #{branch_name}" unless branch_name.blank?
50
+
48
51
  FileUtils.rm_rf(plugin_folder_path) if File.exists?(plugin_folder_path)
49
- `git -C #{Path::PLUGINS_FOLDER_PATH} clone #{plugin_git_link}`
52
+ puts "git -C #{Path::PLUGINS_FOLDER_PATH} clone --depth 1 #{branch_command} #{plugin_git_url}"
53
+ `git -C #{Path::PLUGINS_FOLDER_PATH} clone --depth 1 #{branch_command} #{plugin_git_url}`
50
54
  FileUtils.rm_rf(plugin_git_path)
51
55
 
52
56
  Dir.entries(plugin_folder_path).each do |entry|
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'rubypitaya', '2.23.0'
3
+ gem 'rubypitaya', '2.24.0'
4
4
 
5
5
  group :development do
6
6
  gem 'pry', '0.14.0'
@@ -111,7 +111,7 @@ GEM
111
111
  rspec-support (~> 3.10.0)
112
112
  rspec-support (3.10.2)
113
113
  ruby2_keywords (0.0.5)
114
- rubypitaya (2.23.0)
114
+ rubypitaya (2.24.0)
115
115
  activerecord (= 6.1.3)
116
116
  etcdv3 (= 0.10.2)
117
117
  mongo (= 2.15.0)
@@ -152,7 +152,7 @@ DEPENDENCIES
152
152
  listen (= 3.4.1)
153
153
  pry (= 0.14.0)
154
154
  rspec (= 3.10.0)
155
- rubypitaya (= 2.23.0)
155
+ rubypitaya (= 2.24.0)
156
156
 
157
157
  BUNDLED WITH
158
158
  2.1.4
@@ -49,9 +49,9 @@ update-dependencies:
49
49
  create-migration:
50
50
  @docker-compose run --service-ports --rm rubypitaya-commands bundle exec rubypitaya create-migration $(NAME)
51
51
 
52
- ## Add or update a plugin. GIT=[plugin-http-git-link]
52
+ ## Add or update a plugin. GIT=[plugin-http-git-link] BRANCH=[branch-name:optional]
53
53
  add-plugin:
54
- @docker-compose run --service-ports --rm rubypitaya-commands bundle exec rubypitaya add-plugin $(GIT)
54
+ @docker-compose run --service-ports --rm rubypitaya-commands bundle exec ruby ../../../bin/rubypitaya add-plugin $(GIT) $(BRANCH)
55
55
 
56
56
  ## + Database Commands
57
57
 
@@ -1,3 +1,3 @@
1
1
  module RubyPitaya
2
- VERSION = '2.23.0'
2
+ VERSION = '2.24.0'
3
3
  end
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.23.0
4
+ version: 2.24.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-07-19 00:00:00.000000000 Z
11
+ date: 2021-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg