raykit 0.0.343 → 0.0.344

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: 928940e4a04947b45084a0ab4304e10986c6546ac9e443a69e36902710b92f51
4
- data.tar.gz: 3298230170d281b269cdf360a337f0c5ecebd904f13e22ee0bfeb5a8770a5318
3
+ metadata.gz: d17cec758489d7b6c13828ea09c3ec55d444f4059b792c0e0678d80d4ad1d894
4
+ data.tar.gz: 7c9aeaa87bde1eaa27d864ec2a83af22f1a599edca04461f5a346bd6060cb3dc
5
5
  SHA512:
6
- metadata.gz: 065f886c5218ab37bd4657548ea0165b4bbc3c5c45063316fc3fcc366ec749db28a1165c17648530b3ecb1bba49c48d3bdcc5f1fc2e41bdade216e4b676ba907
7
- data.tar.gz: 31524ca7dd028b405188747d975e7809d8c038eb164bae0542627c3650125d8718c0079e75ff0b66dcaa4275a5a050768a0da79386e324c36f7ebf19854d9081
6
+ metadata.gz: 0cbef39e3f3efa66222a2e994a586912b61e94a97207c62d03c4d255aeac6c443baff2ce93ef5c1a3e27291dd16d77fab322f7fd10ee716db5fc7cab0500240c
7
+ data.tar.gz: 5761889cffd011f173d58342d03e83685adc1ceeb57c10d0456dfb62b4e27b957097554b7dd2c431e52e776cd13cad104bdd01091fd2562a14bb2b12bd930133
@@ -33,6 +33,7 @@ module Raykit
33
33
  end
34
34
 
35
35
  def initialize(command)
36
+ #def initialize(command, timeout = 0, success_log_level = Logger::DEBUG, logging_enabled = true)
36
37
  timeout = 0
37
38
  success_log_level = nil
38
39
  logging_enabled = false
@@ -42,7 +43,9 @@ module Raykit
42
43
  @logging_enabled = logging_enabled
43
44
  @command = command
44
45
  @timeout = timeout
46
+ #t = Time.now
45
47
  @elapsed = 0
48
+ #run if @command.length.positive?
46
49
  self
47
50
  end
48
51
 
@@ -52,6 +55,7 @@ module Raykit
52
55
  end
53
56
 
54
57
  def run
58
+ # puts '---running---'
55
59
  @start_time = Time.now
56
60
  @elapsed = 0
57
61
  timer = Timer.new
@@ -95,6 +99,7 @@ module Raykit
95
99
  if @exitstatus != 0
96
100
  to_log_event.to_seq
97
101
  else
102
+ # puts '---logging---'
98
103
  unless @success_log_level.nil?
99
104
  e = to_log_event
100
105
  e["Level"] = "Verbose" if @success_log_level == "Verbose"
@@ -137,7 +142,7 @@ module Raykit
137
142
  "#{msg}\n"
138
143
  end
139
144
  secrets = Secrets.new
140
- msg = secrets.hide(@command)
145
+ msg = secrets.hide(@command) # "?"# self.summary(false)
141
146
  level = "Verbose"
142
147
  level = "Warning" if @exitstatus != 0
143
148
  event = Raykit::LogEvent.new(level, msg, {
@@ -182,7 +187,7 @@ module Raykit
182
187
  symbol = Rainbow(error.encode("utf-8")).red if @exitstatus != 0
183
188
  cmd = "#{Rainbow(SECRETS.hide(@command)).yellow}"
184
189
  if show_directory
185
- puts "#{symbol} #{cmd} " + Rainbow("#{elapsed_str}").cyan
190
+ puts "#{symbol} #{cmd} " + Rainbow("#{elapsed_str}").cyan #(#{@directory},#{elapsed_str})"
186
191
  puts Rainbow(" #{@directory}").cyan
187
192
  else
188
193
  puts "#{symbol} #{Rainbow(SECRETS.hide(@command)).yellow} (#{elapsed_str})"
@@ -201,6 +206,10 @@ module Raykit
201
206
  puts " " + line
202
207
  end
203
208
  end
209
+ # summary
210
+ #puts @output
211
+ #puts @error
212
+ #puts
204
213
  end
205
214
 
206
215
  def save
@@ -250,6 +259,7 @@ module Raykit
250
259
  end
251
260
 
252
261
  def self.parse_yaml_commands(yaml)
262
+ # commands=Array.new()
253
263
  data = YAML.safe_load(yaml)
254
264
  commands = get_script_commands(data)
255
265
  end
@@ -82,6 +82,8 @@ module Raykit
82
82
  verb_descriptions.each do |k, v|
83
83
  puts "#{k.ljust(15, " ")} - #{v}"
84
84
  end
85
+ # puts @opts
86
+ # puts "verbs: " + verbs.to_s
85
87
  0
86
88
  end
87
89
 
@@ -280,3 +282,5 @@ module Raykit
280
282
  end
281
283
  end
282
284
  end
285
+
286
+ # CONSOLE=Raykit::Console.new
@@ -36,11 +36,15 @@ module Raykit
36
36
  def self.get_dev_dir(name)
37
37
  dir = Pathname.new("#{Environment.root_dir}/#{name}")
38
38
  dir.mkpath
39
- dir.to_s.gsub("//", "/")
39
+ if(dir.to_s.include?("https:") || dir.to_s.include?("http:"))
40
+ dir.to_s.gsub("https://", ".").gsub("http://",".").gsub("//", "/")
41
+ else
42
+ dir
43
+ end
40
44
  end
41
45
 
42
46
  def self.get_work_dir(url)
43
- "#{Raykit::Environment.get_dev_dir("work")}/#{url.gsub("://", "/").gsub(".git", "")}"
47
+ "#{Raykit::Environment.get_dev_dir("work")}/#{url.gsub(".git", "").gsub("://", ".")}"
44
48
  end
45
49
 
46
50
  # Get the size of a directory and its contents
@@ -284,7 +284,7 @@ module Raykit
284
284
 
285
285
  def run(command, quit_on_failure = true)
286
286
  if command.is_a?(Array)
287
- command.each { |subcommand| run(subcommand, quit_on_failure, success_log_level) }
287
+ command.each { |subcommand| run(subcommand, quit_on_failure) }
288
288
  else
289
289
  cmd = Command.new(command).set_timeout(0).run
290
290
  cmd.summary
data/lib/raykit/zip.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ require "zip"
2
3
 
3
4
  module Raykit
4
5
  class Zip
@@ -34,11 +35,28 @@ module Raykit
34
35
  path = File.dirname(@filename)
35
36
  FileUtils.mkdir_p(path) unless Dir.exist?(path)
36
37
 
38
+ files_to_archive = Array::new()
37
39
  Dir.chdir(@source_dir) do
38
- include_files = []
40
+ #include_files = []
39
41
  @include_globs.each do |include_glob|
42
+ Dir.glob(include_glob) { |f|
43
+ puts "\n" + f
44
+ files_to_archive << f
45
+ }
40
46
  end
41
47
  end
48
+
49
+ ::Zip::File::open(@filename, ::Zip::File::CREATE) { |zipfile|
50
+ files_to_archive.each do |file|
51
+ zipfile.get_output_stream(file) { |f|
52
+ fr = ::File.open("#{@source_dir}/#{file}", "rb")
53
+ f.puts(fr.read)
54
+ fr.close()
55
+ f.close()
56
+ }
57
+ end
58
+ zipfile.close
59
+ }
42
60
  end
43
61
  end
44
62
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raykit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.343
4
+ version: 0.0.344
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-25 00:00:00.000000000 Z
11
+ date: 2022-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -93,7 +93,6 @@ files:
93
93
  - lib/raykit/logging.rb
94
94
  - lib/raykit/msbuild.rb
95
95
  - lib/raykit/nugetpackage.rb
96
- - lib/raykit/nunit.rb
97
96
  - lib/raykit/project.rb
98
97
  - lib/raykit/rake.rb
99
98
  - lib/raykit/runner.rb
@@ -126,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
125
  - !ruby/object:Gem::Version
127
126
  version: '0'
128
127
  requirements: []
129
- rubygems_version: 3.2.15
128
+ rubygems_version: 3.2.22
130
129
  signing_key:
131
130
  specification_version: 4
132
131
  summary: ruby gem to support rake ci/cd tasks
data/lib/raykit/nunit.rb DELETED
@@ -1,7 +0,0 @@
1
- module Raykit
2
- class NUnit
3
- def self.nunit3console_path(version)
4
- "#{Environment.home_dir}/.nuget/packages/nunit.consolerunner/#{version}/tools"
5
- end
6
- end
7
- end