makit 0.0.12 → 0.0.13
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 +4 -0
- data/lib/makit/dotnet.rb +1 -1
- data/lib/makit/mp/string_mp.rb +21 -0
- data/lib/makit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f39460448bac4ce031da8056f71e2463224bb71962a381838c13493a32301fa
|
4
|
+
data.tar.gz: c4e56572edf0ce96be33cf4eafbd0bc7406d089c3abc5b163627535b4dea307c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6ad560c7e79326e6786d157ac14a419d126d61067b332822d5d40db36e1e97e8a923de99390b446c4563a6a8491c56288619da227a28d5b4e324f612402cd58
|
7
|
+
data.tar.gz: fe4eaae6ebfe9237e291f307d69396531823d05715a2057cce83d214fca86c9d5ec673f655b99058120a91a67301944b7105cc19a02114f882b4228ec60092b3
|
data/lib/makit/directory.rb
CHANGED
@@ -101,6 +101,10 @@ module Makit
|
|
101
101
|
get_git_tracked_files(directory_path).select { |f| File.file?(f) }.max_by { |f| File.mtime(f) }
|
102
102
|
end
|
103
103
|
|
104
|
+
def self.get_newest_git_file_timestamp(directory_path)
|
105
|
+
get_newest_git_file(directory_path).nil? ? Time.now : File.mtime(get_newest_git_file(directory_path))
|
106
|
+
end
|
107
|
+
|
104
108
|
def self.get_newest_file_timestamp(directory_path)
|
105
109
|
newest_file = get_git_tracked_files(directory_path).select { |f| File.file?(f) }.max_by { |f| File.mtime(f) }
|
106
110
|
newest_file.nil? ? Time.now : File.mtime(newest_file)
|
data/lib/makit/dotnet.rb
CHANGED
@@ -92,7 +92,7 @@ module Makit
|
|
92
92
|
Dir.glob("**/*.csproj").each do |project_path|
|
93
93
|
project_name = File.basename(project_path, ".csproj")
|
94
94
|
if (sln_content.include?("\"#{project_name}\""))
|
95
|
-
puts " #{project_name}".colorize(:green) + " is in ".colorize(:grey) + "#{sln_path}".colorize(:green)
|
95
|
+
#puts " #{project_name}".colorize(:green) + " is in ".colorize(:grey) + "#{sln_path}".colorize(:green)
|
96
96
|
#puts "Project #{project_name} already exists in #{sln_path}".colorize(:yellow)
|
97
97
|
else
|
98
98
|
"dotnet sln #{sln_path} add #{project_path}".run
|
data/lib/makit/mp/string_mp.rb
CHANGED
@@ -35,6 +35,27 @@ class String
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
def cache_run(args = nil, timestamp = nil)
|
39
|
+
|
40
|
+
if timestamp.nil?
|
41
|
+
timestamp = Makit::Directory.get_newest_git_file_timestamp(Makit::Directories::PROJECT_ROOT)
|
42
|
+
#timestamp = Makit::Timestamp.now
|
43
|
+
end
|
44
|
+
if args.nil?
|
45
|
+
command = self
|
46
|
+
Makit::RUNNER.cache_run(Makit::RUNNER::parse_command_request(command), timestamp)
|
47
|
+
else
|
48
|
+
command = self
|
49
|
+
request = Makit::RUNNER.parse_args(command)
|
50
|
+
if args.is_a?(Hash)
|
51
|
+
args.each do |key, value|
|
52
|
+
request.send("#{key}=", value)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
Makit::RUNNER.cache_run(request, timestamp)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
38
59
|
# Read a value from a JSON file
|
39
60
|
# key is a string with the key to read, e.g. "AzureAd.Authority"
|
40
61
|
def get_json_value(key)
|
data/lib/makit/version.rb
CHANGED