release-gem 0.1.19 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 202609b5d35c97c90c385ae3fb8274890e67f5915ada45caa9a4890eb54df1bd
4
- data.tar.gz: 700111e9dc6350722dea412d457f2a8afb651b90a77e145ad7a3091b1aeb7740
3
+ metadata.gz: 5e99a850660fbeceb687202dde98b387761d0d686654c8f8626edfc874d86612
4
+ data.tar.gz: '09f7162e2573e3db54862fa56cc4710e17534f488468c5b0871cc2f9d8536128'
5
5
  SHA512:
6
- metadata.gz: a33040c0945714ad931e897a71be1b87a6651682ed321cd1341268f86d0e60ff51ef41f78523b3535bb153504439d25670bbaad03f6b4e4a6b426f3dc80e44e3
7
- data.tar.gz: ed9b0f24c27713a4e3a6b43027f95b538e7a939b271ec63c1e87973b14c4250783e8c6c5d93891f1e38c63a5872e55dd657d912ffe04402533a0c76313834776
6
+ metadata.gz: 26407d95ef36b6cdd0789668cdc8ea6af6f6423d6bc4bc43a51938428b41a60fa1449e7a54d8f3a6b9fb7c97c941cc584ac10fcbde1488837097cf816f1d14a1
7
+ data.tar.gz: c18e9471f316b30e67e99f76ca934e3605ddb815322baca311a87c0c4ec2874a4abf13e0d61eab535f8313c34d1b194f1a954b987bbf224a315261961fdf858d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- release-gem (0.1.19)
4
+ release-gem (0.1.20)
5
5
  colorize
6
6
  git_cli
7
7
  gvcs
@@ -15,8 +15,7 @@ GEM
15
15
  specs:
16
16
  colorize (0.8.1)
17
17
  diff-lcs (1.5.0)
18
- git_cli (0.11.4)
19
- gvcs
18
+ git_cli (0.12.0)
20
19
  ptools (~> 1.4.0)
21
20
  teLogger
22
21
  toolrack
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Release::Gem
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/release/gem`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Release-gem is the release assistance toolkit for Rubygems.
6
4
 
7
5
  ## Installation
8
6
 
@@ -219,10 +219,42 @@ module Release
219
219
  end
220
220
 
221
221
  cp "Given gem version '#{gemVer}' to install"
222
- res = TTY::Command.new.run!("gem install pkg/#{gemspec.name}-#{gemVer}.gem") do |out, err|
223
- cp out if not_empty?(out)
224
- ce err if not_empty?(err)
222
+ target = Dir.glob(File.join(Dir.getwd,"**/*.gem")).select { |sf|
223
+ sf =~ /\w*-#{gemVer}\w*/
224
+ }.first
225
+
226
+ if not_empty?(target)
227
+
228
+ if target.length > 1
229
+ if block
230
+ st = {}
231
+ target.each do |t|
232
+ st[Pathname.new(t).relative_path_from(@root)] = t
233
+ end
234
+ selGemFile = block.call(:multiple_target_gems_found, st)
235
+ #res = TTY::Command.new.run!("gem install pkg/#{gemspec.name}-#{gemVer}.gem") do |out, err|
236
+ res = TTY::Command.new.run!("gem install #{selGemFile}") do |out, err|
237
+ cp out if not_empty?(out)
238
+ ce err if not_empty?(err)
239
+ end
240
+ block.call(:gem_file_installed, Pathname.new(selGemFile).relative_path_from(@root))
241
+ else
242
+ raise GemActionError, "Multiple target gem found. Please provide a block for gem selection"
243
+ end
244
+ end
245
+
246
+ else
247
+ if block
248
+ block.call(:target_gem_not_found, gemVer)
249
+ else
250
+ raise GemActionError, "Target gem carry the version '#{gemVer}' not found"
251
+ end
225
252
  end
253
+
254
+ #res = TTY::Command.new.run!("gem install pkg/#{gemspec.name}-#{gemVer}.gem") do |out, err|
255
+ # cp out if not_empty?(out)
256
+ # ce err if not_empty?(err)
257
+ #end
226
258
 
227
259
  end # install
228
260
 
@@ -240,7 +240,29 @@ module Release
240
240
 
241
241
  sysInst = @pmt.yes?(pmsg("\n Install release into system? "))
242
242
  if sysInst
243
- @inst.install(*args)
243
+ @inst.install(*args) do |ops, *args|
244
+ case ops
245
+ when :multiple_target_gems_found
246
+ files = args.first
247
+ res = @pmt.select("\n It seems there are more than 1 gem files with the same version name : ".yellow) do |m|
248
+ files.each do |k,v|
249
+ m.choice k,v
250
+ end
251
+ m.choice "Abort", :abort
252
+ end
253
+
254
+ raise Gem::Release::Abort, "Abort by user" if res == :abort
255
+
256
+ res
257
+
258
+ when :gem_file_installed
259
+ @pmt.puts "\n Gem file #{args.first} installed successfully ".green
260
+
261
+ when :target_gem_not_found
262
+ @pmt.puts "\n There is no gem file fould that has the version '#{args.first}' in its name. Please try again\n".red
263
+
264
+ end
265
+ end
244
266
  end
245
267
 
246
268
  end # install
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Release
4
4
  module Gem
5
- VERSION = "0.1.19"
5
+ VERSION = "0.1.20"
6
6
  end
7
7
  end
@@ -3,7 +3,7 @@
3
3
  require 'release/gem'
4
4
 
5
5
  puts "\n Standard GEM CLI release flow version #{Release::Gem::VERSION}".yellow
6
- puts "\n Your current location : #{Dir.getwd}\n".yellow
6
+ puts " Current location : #{Dir.getwd}\n".yellow
7
7
 
8
8
  Release::Gem.engine(:gem, root: Dir.getwd) do
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: release-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.19
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-06 00:00:00.000000000 Z
11
+ date: 2023-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toolrack