lib/makit/mp/string_mp.rb in makit-0.0.12 vs lib/makit/mp/string_mp.rb in makit-0.0.13

- old
+ new

@@ -33,9 +33,30 @@ end Makit::RUNNER.try(request) end end + def cache_run(args = nil, timestamp = nil) + + if timestamp.nil? + timestamp = Makit::Directory.get_newest_git_file_timestamp(Makit::Directories::PROJECT_ROOT) + #timestamp = Makit::Timestamp.now + end + if args.nil? + command = self + Makit::RUNNER.cache_run(Makit::RUNNER::parse_command_request(command), timestamp) + else + command = self + request = Makit::RUNNER.parse_args(command) + if args.is_a?(Hash) + args.each do |key, value| + request.send("#{key}=", value) + end + end + Makit::RUNNER.cache_run(request, timestamp) + end + end + # Read a value from a JSON file # key is a string with the key to read, e.g. "AzureAd.Authority" def get_json_value(key) json = File.read(self) data = JSON.parse(json)