devops_assist 0.3.3 → 0.3.4

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: a94fff44947bd07b1d4c7910725c8fce1087f59d8fa3b4def053247c25bebb45
4
- data.tar.gz: 309bcac9863e931d30dc81bea711bdae626c92c2824a03f468e41083dcf702aa
3
+ metadata.gz: 6b5575312117dafd5eca9cae17c2671652bd9ed3bfd1a82441a972267aa6da04
4
+ data.tar.gz: c54728232443d37e0de8b723bb92c63463fb873353501efdfb89965ecd84f997
5
5
  SHA512:
6
- metadata.gz: e8be68bcaaa7588f487f1eaad1e6961feba147b12f4646373ca27552ce7ab6d2a8713475b86e2fd43475e4b6afb9e868d28f94f3e5855629b66e5da7fdf15a8a
7
- data.tar.gz: 3b621c532af465206a6833fadcfe5a8fd7b759f627b74102868e7d584ea3296a44cec0b13d240933187478dd182342db836b48557d42071fe0af018e50eddf75
6
+ metadata.gz: 8a2cb7d4992b9faa39f34e905b8d3ac077d70147553f9f54c3e4917e49cfd58048d3a5f3a137a6560a626204cd318c66950ee40643a5ca56ca72e674892ede04
7
+ data.tar.gz: 833da63cc73361babc7a0dcbe1374d46a7d55d0fc08cb957f53b45420f39e7c2e6b63eb07fea7f53afeabb3461aa9d49a1f6ddf1e81cf6e22fb01c300b197d89
data/.release_history.yml CHANGED
@@ -19,4 +19,8 @@ devops_assist:
19
19
  - :version: 0.3.1
20
20
  :timestamp: 1664976434.566908
21
21
  - :version: 0.3.2
22
- :timestamp: 1679541322.329349
22
+ :timestamp: 1679806218.9064217
23
+ - :version: 0.3.4
24
+ :timestamp: 1679814741.9125335
25
+ - :version: 0.3.4
26
+ :timestamp: 1679814912.2051551
data/Gemfile CHANGED
@@ -9,7 +9,8 @@ gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rspec", "~> 3.0"
11
11
 
12
- #gem "git_cli", git: "git_cli", branch: "master"
13
- #gem "git_cli_prompt", git: "git_cli_prompt", branch: "master"
12
+ #gem "git_cli", path: '../../git/git_cli'
13
+ #gem "git_cli_prompt", path: '../../git/git_cli_prompt'
14
14
  #
15
+ #gem 'toolrack', path: '../../WIP/toolrack'
15
16
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devops_assist (0.3.3)
4
+ devops_assist (0.3.1)
5
5
  git_cli
6
6
  git_cli_prompt
7
7
  gvcs
@@ -14,7 +14,7 @@ GEM
14
14
  specs:
15
15
  base58 (0.2.3)
16
16
  diff-lcs (1.5.0)
17
- git_cli (0.11.2)
17
+ git_cli (0.10.0)
18
18
  gvcs
19
19
  ptools (~> 1.4.0)
20
20
  teLogger
@@ -23,26 +23,26 @@ GEM
23
23
  teLogger
24
24
  toolrack
25
25
  tty-prompt
26
- gvcs (0.1.1)
26
+ gvcs (0.1.0)
27
27
  pastel (0.8.0)
28
28
  tty-color (~> 0.5)
29
- ptools (1.4.3)
29
+ ptools (1.4.2)
30
30
  rake (13.0.6)
31
- rspec (3.12.0)
32
- rspec-core (~> 3.12.0)
33
- rspec-expectations (~> 3.12.0)
34
- rspec-mocks (~> 3.12.0)
35
- rspec-core (3.12.1)
36
- rspec-support (~> 3.12.0)
37
- rspec-expectations (3.12.2)
31
+ rspec (3.11.0)
32
+ rspec-core (~> 3.11.0)
33
+ rspec-expectations (~> 3.11.0)
34
+ rspec-mocks (~> 3.11.0)
35
+ rspec-core (3.11.0)
36
+ rspec-support (~> 3.11.0)
37
+ rspec-expectations (3.11.1)
38
38
  diff-lcs (>= 1.2.0, < 2.0)
39
- rspec-support (~> 3.12.0)
40
- rspec-mocks (3.12.4)
39
+ rspec-support (~> 3.11.0)
40
+ rspec-mocks (3.11.1)
41
41
  diff-lcs (>= 1.2.0, < 2.0)
42
- rspec-support (~> 3.12.0)
43
- rspec-support (3.12.0)
44
- teLogger (0.2.2)
45
- toolrack (0.20.1)
42
+ rspec-support (~> 3.11.0)
43
+ rspec-support (3.11.1)
44
+ teLogger (0.2.0)
45
+ toolrack (0.19.1)
46
46
  base58
47
47
  tty-color (0.6.0)
48
48
  tty-cursor (0.7.1)
@@ -57,7 +57,6 @@ GEM
57
57
  wisper (2.0.1)
58
58
 
59
59
  PLATFORMS
60
- x86_64-darwin-21
61
60
  x86_64-linux
62
61
 
63
62
  DEPENDENCIES
data/lib/Rakefile CHANGED
@@ -4,5 +4,6 @@
4
4
 
5
5
  path = File.expand_path(File.dirname(__FILE__))
6
6
  Dir.glob("#{path}/../tasks/**/*.rake").each { |f|
7
+ #p f
7
8
  import f
8
9
  }
@@ -1,18 +1,19 @@
1
1
 
2
2
  require 'yaml'
3
3
 
4
- require_relative 'gemspec'
5
-
6
4
  module DevopsAssist
7
- module Gem
5
+ class GemUtils
8
6
  include TR::CondUtils
9
- include Gemspec
10
7
 
11
- class GemError < StandardError; end
8
+ class GemUtilsError < StandardError; end
9
+
10
+ def initialize(gemRoot)
11
+ @root = gemRoot
12
+ end
12
13
 
13
- def update_gem_version(root, newVersion, &block)
14
+ def update_gem_version(newVersion, &block)
14
15
 
15
- version_file = find_gem_version_file(root)
16
+ version_file = find_gem_version_file
16
17
 
17
18
  if version_file.length > 1
18
19
  if block
@@ -25,7 +26,7 @@ module DevopsAssist
25
26
  selVerFile = version_file.first
26
27
  end
27
28
 
28
- tmpFile = File.join(File.dirname(selVerFile),"version.rb.tmp")
29
+ tmpFile = File.join(File.dirname(selVerFile),"version-da.bak")
29
30
  FileUtils.mv(selVerFile,tmpFile)
30
31
 
31
32
  File.open(selVerFile,"w") do |f|
@@ -40,22 +41,18 @@ module DevopsAssist
40
41
  end
41
42
  end
42
43
 
43
- FileUtils.rm tmpFile
44
+ FileUtils.rm(tmpFile)
44
45
 
45
46
  selVerFile
46
47
 
47
48
  end
48
49
 
49
- def find_gem_version_file(root)
50
- if is_empty?(root)
51
- raise GemError, "Root path '#{root}' to find_gem_version_file is empty"
52
- else
53
- Dir.glob(File.join(root,"**/version.rb"))
54
- end
50
+ def find_gem_version_file
51
+ raise GemUtilsError, "Root path '#{@root}' to find_gem_version_file is empty" if is_empty?(@root)
52
+ Dir.glob(File.join(@root,"**/version.rb"))
55
53
  end
56
54
 
57
-
58
- def publish_gem(version, opts = { }, &block)
55
+ def self.publish_gem(version, opts = { }, &block)
59
56
 
60
57
  cred = find_rubygems_api_key
61
58
 
@@ -90,7 +87,7 @@ module DevopsAssist
90
87
 
91
88
  end
92
89
 
93
- def publish_gem_file(gemfile, opts = { }, &block)
90
+ def self.publish_gem_file(gemfile, opts = { }, &block)
94
91
 
95
92
  cred = find_rubygems_api_key
96
93
 
@@ -116,17 +113,43 @@ module DevopsAssist
116
113
 
117
114
  end
118
115
 
116
+ def gem_name
117
+ gemspec.name
118
+ end
119
+
120
+ def gem_version_string
121
+ gem_version.version
122
+ end
123
+
124
+ def gem_version
125
+ gemspec.version
126
+ end
127
+
128
+ def gemspec
129
+ raise GemUtilsError, "Root path is not given" if is_empty?(@root)
130
+
131
+ if @_gemSpec.nil?
132
+ @_gemSpec = ::Gem::Specification.load(Dir.glob(File.join(@root,"*.gemspec")).first)
133
+ raise GemUtilsError, "Cannot find gemspec from #{@root}" if @_gemSpec.nil?
134
+ end
135
+
136
+ @_gemSpec
137
+ end
119
138
 
120
139
  private
121
- def logger
140
+ def self.logger
122
141
  if @logger.nil?
123
142
  @logger = TeLogger::Tlogger.new
124
- @logger.tag = :gem
143
+ @logger.tag = :gem_utils
125
144
  end
126
145
  @logger
127
146
  end
128
147
 
129
- def find_rubygems_api_key
148
+ def logger
149
+ self.class.logger
150
+ end
151
+
152
+ def self.find_rubygems_api_key
130
153
  if TR::RTUtils.on_windows?
131
154
  credFile = File.join(ENV['USERPROFILE'],".gem","credentials")
132
155
  else
@@ -23,7 +23,7 @@ module DevopsAssist
23
23
  raise ReleaseLogError, "Release name cannot be empty" if is_empty?(relName)
24
24
  raise ReleaseLogError, "Version cannot be empty" if is_empty?(version)
25
25
 
26
- raise ReleaseLogError, "Version '#{version}' already in the log file for release '#{relName}'" if is_version_exist?(version, relName)
26
+ #raise ReleaseLogError, "Version '#{version}' already in the log file for release '#{relName}'" if is_version_exist?(version, relName)
27
27
 
28
28
  rec = { version: version, timestamp: Time.now.to_f }
29
29
  if block
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
1
+
2
2
 
3
3
  module DevopsAssist
4
- VERSION = "0.3.3"
4
+ VERSION = "0.3.4"
5
5
  end
@@ -3,12 +3,11 @@ require 'tty/prompt'
3
3
 
4
4
  module DevopsAssist
5
5
  module VersionManager
6
- extend DevopsAssist::Gem
7
6
  extend TR::VUtils
8
7
 
9
8
  def self.prompt_version(gemName, last_version = "0.1.0")
10
9
 
11
- begin
10
+ #begin
12
11
 
13
12
  last_version = "0.1.0" if is_empty?(last_version)
14
13
 
@@ -16,13 +15,10 @@ module DevopsAssist
16
15
  vers = possible_versions(last_version)
17
16
 
18
17
  vv = []
19
-
20
18
  vv << vers[2]
21
19
  vv << vers[1]
22
20
  vv << vers[0]
23
21
 
24
- #vers << "Custom"
25
- #vers << "Quit"
26
22
  vv << "Custom"
27
23
  vv << "Quit"
28
24
  #vers << [ \
@@ -31,6 +27,7 @@ module DevopsAssist
31
27
  #].sample
32
28
 
33
29
  vsel = pmt.select(" Please select one of the versions below:") do |menu|
30
+ menu.choice "#{last_version} (current version - no change in version)", :no_change
34
31
  #vers.each do |v|
35
32
  vv.each do |v|
36
33
  menu.choice v
@@ -38,6 +35,8 @@ module DevopsAssist
38
35
  end
39
36
 
40
37
  case vsel
38
+ when :no_change
39
+ vsel = last_version
41
40
  when "Custom"
42
41
  vsel = pmt.ask(" Please provide custom version no:", required: true)
43
42
  when vv[-1]
@@ -46,9 +45,9 @@ module DevopsAssist
46
45
 
47
46
  vsel
48
47
 
49
- rescue TTY::Reader::InputInterrupt
50
- raise DevopsAssist::Error
51
- end
48
+ #rescue TTY::Reader::InputInterrupt
49
+ # raise DevopsAssist::Error
50
+ #end
52
51
 
53
52
  end
54
53
 
data/lib/devops_assist.rb CHANGED
@@ -5,7 +5,7 @@ require_relative 'devops_assist/release_log/release_log'
5
5
 
6
6
  require_relative 'devops_assist/vcs/git/cli_prompt'
7
7
 
8
- require_relative 'devops_assist/gem/gem'
8
+ require_relative 'devops_assist/gem/gem_utils'
9
9
 
10
10
  require_relative 'devops_assist/version_manager'
11
11
 
@@ -19,23 +19,6 @@ module DevopsAssist
19
19
  EnvKey = "DEVOPS_ASSIST"
20
20
  EnvKeyGemReleasing = "#{EnvKey}_GEM_RELEASING"
21
21
 
22
- def self.is_debug_mode?
23
- val = ENV["DEVOPS_ASSIST_DEBUG"]
24
- (not val.nil? and val.downcase == "true")
25
- end
26
-
27
- def self.debug(msg)
28
- logger.tdebug(:devops_assist, msg) if is_debug_mode?
29
- end
30
-
31
- private
32
- def logger
33
- if @logger.nil?
34
- @logger = TeLogger::TLogger.new(STDOUT)
35
- end
36
- @logger
37
- end
38
-
39
22
  end
40
23
 
41
24
  # load the rake tasks
@@ -3,43 +3,42 @@
3
3
  require_relative '../lib/devops_assist'
4
4
  require 'tty/prompt'
5
5
 
6
+ include DevopsAssist
7
+
6
8
  namespace :devops do
7
9
 
8
- desc "Release gem file project"
9
- task :release do
10
+ desc "Initialize the directory"
11
+ task :init do
10
12
 
11
- if DevopsAssist.is_debug_mode?
12
- STDOUT.puts "\n *********** DEBUG MODE ACTIVATED *************\n\n"
13
- end
13
+ root = Dir.getwd
14
+
15
+ gu = GemUtils.new(root)
16
+
17
+ end
14
18
 
19
+ desc "Release gem file project"
20
+ task :release do
21
+
22
+ root = Dir.getwd
23
+ gu = GemUtils.new(root)
15
24
  begin
16
25
 
17
26
  pmt = TTY::Prompt.new
18
27
 
19
- root = Dir.getwd
20
28
 
21
29
  # let's mark the session to allow automated context switching
22
30
  ENV[DevopsAssist::EnvKeyGemReleasing] = "true"
23
31
 
24
- gemName = find_gem_name(root)
32
+ gemName = gu.gem_name
25
33
 
26
34
  pmt.say " Starting gem release for gem #{gemName}", color: :yellow
27
35
 
28
- DevopsAssist.debug "About to execute VCS Checkin"
29
- # check in source code
30
- res = Rake::Task["devops:vcs:checkin_changes"].execute
31
- pmt.say " Workspace check in done\n", color: :yellow
32
-
33
- proceed = pmt.yes?(" Proceed with release? ")
34
- raise GitCliPrompt::UserAborted if not proceed
35
-
36
- rl = DevopsAssist::ReleaseLogger.load
37
-
38
- # select version
39
- ver = DevopsAssist::VersionManager.prompt_version(gemName, rl.last_version_number(gemName))
36
+ # select version
37
+ #ver = DevopsAssist::VersionManager.prompt_version(gemName, rl.last_version_number(gemName))
38
+ ver = DevopsAssist::VersionManager.prompt_version(gemName, gu.gem_version_string)
40
39
  pmt.say " Version no. '#{ver}' chosen", color: :yellow
41
40
 
42
- selVerFile = update_gem_version(root, ver) do |*args|
41
+ selVerFile = gu.update_gem_version(ver) do |*args|
43
42
  ops = args.first
44
43
  case ops
45
44
  when :select_version_file
@@ -50,22 +49,66 @@ namespace :devops do
50
49
  end
51
50
  pmt.say " Version file updated", color: :yellow
52
51
 
53
- # build the gem
52
+
53
+ # check in source code
54
+ # Check in must be done 1st or else the 'gem build' process will fail
55
+ # because build will use git command. For any files that already deleted,
56
+ # the build will failed to find the files and throw exception
57
+ res = Rake::Task["devops:vcs:checkin_changes"].execute
58
+ pmt.say " Workspace check in done\n", color: :yellow
59
+
60
+ proceed = pmt.yes?(" Proceed to build the gem? ")
61
+ raise GitCliPrompt::UserAborted if not proceed
62
+
63
+
64
+ # test build the gem, make sure there is no error
65
+ # If error expected the scripts stops here
54
66
  Rake::Task["build"].execute
55
67
 
68
+ # Record the version number in the log files
69
+ # for reporting traceability
70
+ rl = DevopsAssist::ReleaseLogger.load
56
71
  rl.log_release(gemName, ver)
57
- pmt.say " Release version number is logged", color: :yellow
72
+ #pmt.say " Release version number is logged after successful test built", color: :yellow
73
+
74
+ ## If successfully built, following files shall be changed
75
+ #miscFiles = []
76
+ #miscFiles << selVerFile # version.rb
77
+ #miscFiles << DevopsAssist::ReleaseLogger::LOG_NAME # release_history.yml
78
+ #miscFiles << 'Gemfile.lock'
79
+ #Rake::Task["devops:vcs:checkin_misc_files"].execute({ root: root, files: miscFiles, version: ver })
80
+ #pmt.say " Updated files during release prep have committed into version control", color: :yellow
81
+
82
+ ## check in source code
83
+ #res = Rake::Task["devops:vcs:checkin_changes"].execute
84
+ #pmt.say " Workspace check in done\n", color: :yellow
85
+
86
+ #proceed = pmt.yes?(" Proceed with release? ")
87
+ #raise GitCliPrompt::UserAborted if not proceed
88
+
89
+ #
90
+ # Actual building the real gems build the gem
91
+ # Any possible reasons here error but not the one above?
92
+ #
93
+ # Main reason to do double build is to avoid to generate
94
+ # 2 log entries in Git for each build, which the 2nd (latest)
95
+ # log is just about the version updates (version pre 0.4.x way)
96
+ #
97
+ #Rake::Task["build"].execute
98
+
99
+ #rl.log_release(gemName, ver)
100
+ #pmt.say " Release version number is logged", color: :yellow
58
101
 
59
102
  # publish gem
60
103
  Rake::Task["devops:gem:publish_gem"].execute({ version: ver, pmt: pmt })
61
104
 
62
105
  # following files shall change when gem is built
63
- miscFiles = []
64
- miscFiles << selVerFile
65
- miscFiles << DevopsAssist::ReleaseLogger::LOG_NAME
66
- miscFiles << 'Gemfile.lock'
67
- Rake::Task["devops:vcs:checkin_misc_files"].execute({ root: root, files: miscFiles, version: ver })
68
- pmt.say " Updated files during release prep have committed into version control", color: :yellow
106
+ #miscFiles = []
107
+ #miscFiles << selVerFile
108
+ #miscFiles << DevopsAssist::ReleaseLogger::LOG_NAME
109
+ #miscFiles << 'Gemfile.lock'
110
+ #Rake::Task["devops:vcs:checkin_misc_files"].execute({ root: root, files: miscFiles, version: ver })
111
+ #pmt.say " Updated files during release prep have committed into version control", color: :yellow
69
112
 
70
113
  Rake::Task["devops:vcs:tag_source_code"].execute({ root: root, version: ver })
71
114
  pmt.say " Source code is tagged as version #{ver}", color: :yellow
@@ -73,10 +116,11 @@ namespace :devops do
73
116
  Rake::Task["devops:vcs:push_source_code"].execute({ root: root, pmt: pmt })
74
117
 
75
118
  rescue GitCliPrompt::UserAborted, GitCliPrompt::UserChangedMind, TTY::Reader::InputInterrupt
119
+ STDOUT.puts
76
120
  rescue Exception => ex
77
121
  STDERR.puts ex.message
78
- STDERR.puts ex.backtrace.join('\n') if DevopsAssist.is_debug_mode?
79
122
  STDOUT.puts "\n\nAborted\n"
123
+ #STDERR.puts ex.backtrace.join('\n')
80
124
  end
81
125
 
82
126
  end
data/tasks/gem.rake CHANGED
@@ -3,7 +3,7 @@ require_relative '../lib/devops_assist'
3
3
 
4
4
  require 'tty/prompt'
5
5
 
6
- include DevopsAssist::Gem
6
+ #include DevopsAssist::Gem
7
7
  include TR::VUtils
8
8
 
9
9
  namespace :devops do
@@ -14,7 +14,9 @@ namespace :devops do
14
14
 
15
15
  root = Dir.getwd
16
16
 
17
- selVerFile = update_gem_version(root, args) do |*args|
17
+ gu = GemUtils.new(root)
18
+
19
+ selVerFile = gu.update_gem_version(args) do |*args|
18
20
  ops = args.first
19
21
  case ops
20
22
  when :select_version_file
@@ -34,45 +36,40 @@ namespace :devops do
34
36
  pmt = args[:pmt]
35
37
  version = args[:version]
36
38
 
37
- begin
38
- ans = pmt.yes?(" Proceed to publish the gem to Rubygems?")
39
- if ans
40
- res, tg, out = publish_gem(version) do |*args|
41
- ops = args.first
42
- case ops
43
- when :multiple_rubygems_account
44
- acct = args[1]
45
- selAct = pmt.select(" Please select one of the Rubygems credential to release:") do |menu|
46
-
47
- acct.each do |k,v|
48
- menu.choice k, k
49
- end
50
-
51
- menu.choice "Skip", :skip
52
- menu.choice "Quit", :quit
53
-
39
+ ans = pmt.yes?(" Proceed to publish the gem to Rubygems?")
40
+ if ans
41
+ res, tg, out = GemUtils.publish_gem(version) do |*args|
42
+ ops = args.first
43
+ case ops
44
+ when :multiple_rubygems_account
45
+ acct = args[1]
46
+ selAct = pmt.select(" Please select one of the Rubygems credential to release:") do |menu|
47
+
48
+ acct.each do |k,v|
49
+ menu.choice k, k
54
50
  end
55
51
 
56
- raise DevopsAssist::Error, " Aborted. Have a nice day " if selAct == :quit
52
+ menu.choice "Skip", :skip
53
+ menu.choice "Quit", :quit
57
54
 
58
- selAct
59
55
  end
56
+
57
+ raise DevopsAssist::Error, " Aborted. Have a nice day " if selAct == :quit
58
+
59
+ selAct
60
60
  end
61
+ end
61
62
 
62
- pmt.say(" Gem publishing is skipped", color: :yellow) if res == :skipped
63
+ pmt.say(" Gem publishing is skipped", color: :yellow) if res == :skipped
63
64
 
64
- if res.respond_to?(:success?)
65
- if res.success?
66
- pmt.say " Gem published!\n", color: :yellow
67
- else
68
- pmt.say " Gem publishing failed. Return message :\n#{out}", color: :red
69
- end
65
+ if res.respond_to?(:success?)
66
+ if res.success?
67
+ pmt.say " Gem published!\n", color: :yellow
68
+ else
69
+ pmt.say " Gem publishing failed. Return message :\n#{out}", color: :red
70
70
  end
71
-
72
71
  end
73
72
 
74
- rescue Exception => ex
75
- pmt.error "Pushing to Rubygems failed. Error was : #{ex.message}\n\nPlease manually release to Rubygems"
76
73
  end
77
74
 
78
75
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devops_assist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Liaw
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-23 00:00:00.000000000 Z
11
+ date: 2023-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toolrack
@@ -112,8 +112,7 @@ files:
112
112
  - devops_assist.gemspec
113
113
  - lib/Rakefile
114
114
  - lib/devops_assist.rb
115
- - lib/devops_assist/gem/gem.rb
116
- - lib/devops_assist/gem/gemspec.rb
115
+ - lib/devops_assist/gem/gem_utils.rb
117
116
  - lib/devops_assist/release_log/release_log.rb
118
117
  - lib/devops_assist/vcs/git/cli_prompt.rb
119
118
  - lib/devops_assist/vcs/vcs.rb
@@ -125,7 +124,7 @@ files:
125
124
  homepage: ''
126
125
  licenses: []
127
126
  metadata: {}
128
- post_install_message:
127
+ post_install_message:
129
128
  rdoc_options: []
130
129
  require_paths:
131
130
  - lib
@@ -141,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
140
  version: '0'
142
141
  requirements: []
143
142
  rubygems_version: 3.4.6
144
- signing_key:
143
+ signing_key:
145
144
  specification_version: 4
146
145
  summary: ''
147
146
  test_files: []
@@ -1,28 +0,0 @@
1
-
2
-
3
- module DevopsAssist
4
- module Gem
5
- module Gemspec
6
- include TR::CondUtils
7
-
8
- class GemspecError < StandardError; end
9
-
10
- def find_gem_name(root)
11
- spec = find_gemspec(root)
12
- s = ::Gem::Specification.load(spec)
13
- s.name
14
- end
15
-
16
- private
17
- def find_gemspec(root)
18
- if is_empty?(root)
19
- raise GemspecError, "Root path '#{root}' to find_gemspec is empty"
20
- else
21
- Dir.glob(File.join(root,"*.gemspec")).first
22
- end
23
- end
24
-
25
- end
26
- end
27
- end
28
-