makit 0.0.37 → 0.0.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/makit/directory.rb +16 -0
- data/lib/makit/git.rb +1 -0
- data/lib/makit/humanize.rb +23 -6
- data/lib/makit/show.rb +12 -2
- data/lib/makit/tasks.rb +5 -5
- data/lib/makit/v1/makit.v1_pb.rb +34 -33
- data/lib/makit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00a910919a3d30aa63047cf34010704ad858bd98d85611ff1f2b585136a1c842
|
4
|
+
data.tar.gz: 8bffb696c8e877b7eab6ea9ed78536c7d11b64b051e0827c56636b64f21534f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 070f58a0a20a0d2bee67ee86baab4ce859941f3a886e6e5c9ddc67b1080f544085d79e11aee498ce3c8c614bf03c891ed875a923fcf5568c3754a568d5fd3961
|
7
|
+
data.tar.gz: b1ae014a0136aa190b7eb737bd8e120921f44e4e8cce78eeba0b9318ebf0473ef3c162683c183d55f9ed0534adddbcababedf364419c7b6ffa53e9afd4556f51
|
data/lib/makit/directory.rb
CHANGED
@@ -180,5 +180,21 @@ module Makit
|
|
180
180
|
end
|
181
181
|
end
|
182
182
|
end
|
183
|
+
|
184
|
+
def self.remove_empty_directories(dir)
|
185
|
+
Find.find(dir) do |path|
|
186
|
+
if File.directory?(path) && Dir.empty?(path)
|
187
|
+
FileUtils.rm_rf(path)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
def self.remove_empty_directories_recursively(dir)
|
193
|
+
Find.find(dir) do |path|
|
194
|
+
if File.directory?(path) && Dir.empty?(path)
|
195
|
+
FileUtils.rm_rf(path)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
183
199
|
end
|
184
200
|
end
|
data/lib/makit/git.rb
CHANGED
data/lib/makit/humanize.rb
CHANGED
@@ -91,21 +91,38 @@ module Makit
|
|
91
91
|
"#{hours}h #{minutes}m #{seconds}s"
|
92
92
|
end
|
93
93
|
|
94
|
-
def self.get_humanized_duration(
|
95
|
-
minutes = (
|
96
|
-
seconds = (
|
94
|
+
def self.get_humanized_duration(seconds_value)
|
95
|
+
minutes = (seconds_value / 60).to_i
|
96
|
+
seconds = (seconds_value % 60).to_i
|
97
97
|
hours = (minutes / 60).to_i
|
98
98
|
minutes = minutes % 60
|
99
99
|
days = (hours / 24).to_i
|
100
100
|
hours = hours % 24
|
101
|
-
milliseconds = (
|
101
|
+
milliseconds = (seconds_value % 1 * 1000).to_i
|
102
102
|
|
103
103
|
parts = []
|
104
104
|
parts << "#{days} days" if days > 0
|
105
105
|
parts << "#{hours} hours" if hours > 0
|
106
|
-
|
107
|
-
|
106
|
+
if(minutes > 0)
|
107
|
+
if(minutes == 1)
|
108
|
+
parts << "1 minute"
|
109
|
+
else
|
110
|
+
parts << "#{minutes} minutes"
|
111
|
+
end
|
112
|
+
end
|
113
|
+
if(seconds > 0)
|
114
|
+
if(seconds == 1)
|
115
|
+
parts << "1 second"
|
116
|
+
else
|
117
|
+
parts << "#{seconds} seconds"
|
118
|
+
end
|
119
|
+
end
|
120
|
+
#parts << "#{seconds} seconds" if seconds > 0
|
108
121
|
parts << "#{milliseconds} milliseconds" if milliseconds > 0 && seconds < 1
|
122
|
+
|
123
|
+
if(parts.length == 0)
|
124
|
+
parts << "0 seconds"
|
125
|
+
end
|
109
126
|
parts.join(", ")
|
110
127
|
end
|
111
128
|
end
|
data/lib/makit/show.rb
CHANGED
@@ -34,7 +34,8 @@ module Makit
|
|
34
34
|
if File.file?(path)
|
35
35
|
modified = File.mtime(path)
|
36
36
|
age = (Time.now - modified).to_f
|
37
|
-
|
37
|
+
humanized_size = Makit::Humanize.get_humanized_size(File.size(path))
|
38
|
+
puts "#{file_symbol} ".colorize(:grey) + "#{humanized_size.rjust(10)} ".colorize(:cyan) +" #{path} ".colorize(:grey)
|
38
39
|
else
|
39
40
|
puts "#{path} does not exist"
|
40
41
|
end
|
@@ -42,7 +43,8 @@ module Makit
|
|
42
43
|
|
43
44
|
def file_symbol
|
44
45
|
#📄 (U+1F4C4) – "Page with Curl"
|
45
|
-
"\u{1F4C4}"
|
46
|
+
#"\u{1F4C4}"
|
47
|
+
"@"
|
46
48
|
end
|
47
49
|
|
48
50
|
def directory_symbol
|
@@ -70,6 +72,14 @@ module Makit
|
|
70
72
|
puts " ".colorize(:grey) + "#{task}".colorize(:green)
|
71
73
|
#puts ("=" * 100).colorize(:grey)
|
72
74
|
end
|
75
|
+
|
76
|
+
def info(text)
|
77
|
+
puts " ".colorize(:grey) + "#{text}".colorize(:cyan)
|
78
|
+
end
|
79
|
+
|
80
|
+
def success(text)
|
81
|
+
puts " ".colorize(:grey) + "#{text}".colorize(:green)
|
82
|
+
end
|
73
83
|
end
|
74
84
|
end
|
75
85
|
|
data/lib/makit/tasks.rb
CHANGED
@@ -15,19 +15,19 @@ end
|
|
15
15
|
|
16
16
|
desc "Remove any temporary products."
|
17
17
|
task :clean do
|
18
|
-
|
18
|
+
Makit::SHOW.task(:blue)
|
19
19
|
Makit::RUNNER.run(Makit::RUNNER.parse_command_request("git clean -dXf"))
|
20
20
|
end
|
21
21
|
|
22
22
|
desc "Integrate changes into the git repository."
|
23
23
|
task :integrate do
|
24
|
-
|
24
|
+
Makit::SHOW.task(:integrate)
|
25
25
|
Makit::Git.integrate
|
26
26
|
end
|
27
27
|
|
28
28
|
desc "Sync changes with the git repository."
|
29
29
|
task :sync do
|
30
|
-
|
30
|
+
Makit::SHOW.task(:blue)
|
31
31
|
Makit::Git.sync
|
32
32
|
end
|
33
33
|
|
@@ -38,13 +38,13 @@ end
|
|
38
38
|
|
39
39
|
desc "Format source code."
|
40
40
|
task :format do
|
41
|
-
|
41
|
+
Makit::SHOW.task(:blue)
|
42
42
|
Makit::RUNNER.try("rufo .") if File.exist?("Gemfile") || File.exist?("Rakefile")
|
43
43
|
end
|
44
44
|
|
45
45
|
desc "Update dependencies."
|
46
46
|
task :update do
|
47
|
-
|
47
|
+
Makit::SHOW.task(:blue)
|
48
48
|
system("bundle update") if File.exist?("Gemfile")
|
49
49
|
# glob all *.csproj files
|
50
50
|
Dir.glob("**/*.csproj").each do |file|
|
data/lib/makit/v1/makit.v1_pb.rb
CHANGED
@@ -1,33 +1,34 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
-
# source: lib/makit/v1/makit.v1.proto
|
4
|
-
|
5
|
-
require
|
6
|
-
|
7
|
-
require
|
8
|
-
require
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
pool.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: lib/makit/v1/makit.v1.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/protobuf/timestamp_pb'
|
8
|
+
require 'google/protobuf/duration_pb'
|
9
|
+
|
10
|
+
|
11
|
+
descriptor_data = "\n\x1blib/makit/v1/makit.v1.proto\x12\x08makit.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/duration.proto\"\x92\x02\n\rDotNetProject\x12\x10\n\x08template\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06output\x18\x03 \x01(\t\x12\x10\n\x08packages\x18\x04 \x03(\t\x12\x12\n\nreferences\x18\x05 \x03(\t\x12\n\n\x02os\x18\x06 \x01(\t\x12\x10\n\x08\x63ommands\x18\x07 \x03(\t\x12-\n\nbuild_args\x18\x08 \x03(\x0b\x32\x19.makit.v1.DotNetBuildArgs\x12\x31\n\x0cpublish_args\x18\t \x03(\x0b\x32\x1b.makit.v1.DotNetPublishArgs\x12+\n\ttest_args\x18\n \x03(\x0b\x32\x18.makit.v1.DotNetTestArgs\"8\n\x0f\x44otNetBuildArgs\x12\x15\n\rconfiguration\x18\x01 \x01(\t\x12\x0e\n\x06output\x18\x02 \x01(\t\":\n\x11\x44otNetPublishArgs\x12\x15\n\rconfiguration\x18\x01 \x01(\t\x12\x0e\n\x06output\x18\x02 \x01(\t\"7\n\x0e\x44otNetTestArgs\x12\x15\n\rconfiguration\x18\x01 \x01(\t\x12\x0e\n\x06output\x18\x02 \x01(\t\"\xa8\x01\n\x07Project\x12\x16\n\x0egit_remote_url\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tartifacts\x18\x03 \x03(\t\x12\x32\n\x10\x63ommand_requests\x18\x04 \x03(\x0b\x32\x18.makit.v1.CommandRequest\x12\x30\n\x0f\x64otnet_projects\x18\x05 \x03(\x0b\x32\x17.makit.v1.DotNetProject\"\xa5\x01\n\x0e\x43ommandRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\targuments\x18\x02 \x03(\t\x12+\n\x07timeout\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x11\n\tdirectory\x18\x04 \x01(\t\x12\x0c\n\x04task\x18\x05 \x01(\t\x12\r\n\x05input\x18\x06 \x01(\x0c\x12\x15\n\rexit_on_error\x18\x07 \x01(\x08\"\x91\x02\n\x07\x43ommand\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\targuments\x18\x03 \x03(\t\x12\x11\n\texit_code\x18\x04 \x01(\x05\x12\r\n\x05input\x18\x05 \x01(\x0c\x12\x0e\n\x06output\x18\x06 \x01(\x0c\x12\r\n\x05\x65rror\x18\x07 \x01(\x0c\x12.\n\nstarted_at\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x08\x64uration\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04user\x18\n \x01(\t\x12\x0e\n\x06\x64\x65vice\x18\x0b \x01(\t\x12\n\n\x02os\x18\x0c \x01(\t\x12\x11\n\tdirectory\x18\r \x01(\t\"I\n\rConfiguration\x12\x0c\n\x04name\x18\x01 \x01(\t\x12*\n\x08\x63ommands\x18\x02 \x03(\x0b\x32\x18.makit.v1.CommandRequest\"3\n\rGitRepository\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x15\n\rrelative_path\x18\x02 \x01(\t\"h\n\x0bGitLogEntry\x12\x0e\n\x06\x63ommit\x18\x01 \x01(\t\x12\x0e\n\x06\x61uthor\x18\x02 \x01(\t\x12(\n\x04\x64\x61te\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07message\x18\x04 \x01(\t\"\xc8\x01\n\nMakeResult\x12\x12\n\nrepository\x18\x01 \x01(\t\x12\x0e\n\x06\x63ommit\x18\x02 \x01(\t\x12\x0e\n\x06\x62ranch\x18\x03 \x01(\t\x12\x0b\n\x03tag\x18\x04 \x01(\t\x12\x0e\n\x06\x64\x65vice\x18\x05 \x01(\t\x12\x1a\n\x12runtime_identifier\x18\x06 \x01(\t\x12#\n\x08\x63ommands\x18\x07 \x03(\x0b\x32\x11.makit.v1.Command\x12\x14\n\x0cinitial_size\x18\x08 \x01(\x05\x12\x12\n\nfinal_size\x18\t \x01(\x05\"?\n\rDotNetNewArgs\x12\x10\n\x08template\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06output\x18\x03 \x01(\t\"^\n\rManifestEntry\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x31\n\rlast_modified\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0c\n\x04size\x18\x03 \x01(\x03**\n\x08Language\x12\x08\n\x04RUBY\x10\x00\x12\n\n\x06\x43SHARP\x10\x01\x12\x08\n\x04RUST\x10\x02*,\n\x0bPackageType\x12\x07\n\x03GEM\x10\x00\x12\t\n\x05NUGET\x10\x01\x12\t\n\x05\x43RATE\x10\x03\x32H\n\x0e\x43ommandService\x12\x36\n\x07\x45xecute\x12\x18.makit.v1.CommandRequest\x1a\x11.makit.v1.Commandb\x06proto3"
|
12
|
+
|
13
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
14
|
+
pool.add_serialized_file(descriptor_data)
|
15
|
+
|
16
|
+
module Makit
|
17
|
+
module V1
|
18
|
+
DotNetProject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.DotNetProject").msgclass
|
19
|
+
DotNetBuildArgs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.DotNetBuildArgs").msgclass
|
20
|
+
DotNetPublishArgs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.DotNetPublishArgs").msgclass
|
21
|
+
DotNetTestArgs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.DotNetTestArgs").msgclass
|
22
|
+
Project = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.Project").msgclass
|
23
|
+
CommandRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.CommandRequest").msgclass
|
24
|
+
Command = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.Command").msgclass
|
25
|
+
Configuration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.Configuration").msgclass
|
26
|
+
GitRepository = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.GitRepository").msgclass
|
27
|
+
GitLogEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.GitLogEntry").msgclass
|
28
|
+
MakeResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.MakeResult").msgclass
|
29
|
+
DotNetNewArgs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.DotNetNewArgs").msgclass
|
30
|
+
ManifestEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.ManifestEntry").msgclass
|
31
|
+
Language = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.Language").enummodule
|
32
|
+
PackageType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("makit.v1.PackageType").enummodule
|
33
|
+
end
|
34
|
+
end
|
data/lib/makit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: makit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lou Parslow
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|