makit 0.0.47 → 0.0.49

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: 13595d385d61aded5a1b070143d89cc2454b4791e1bdec3cddbbf415ef4d8835
4
- data.tar.gz: f6c7b0892cae10ba34183bde1fd6f78a7b4fb7ac8d7fbed45c69f8ae660f23d2
3
+ metadata.gz: c1126dba0ea27b77b9b5d9fb32689f47878419506aee8eb9a4b177b632148832
4
+ data.tar.gz: e388dc96e51162a816d97ea373241edf0ff9b7eaecd640763a3a4196ddd038ef
5
5
  SHA512:
6
- metadata.gz: 15930c7a638107807b538ace1ae3c698efa7479df1b9e695edaf4eaf0bfd100ca763aeb265939924b0d4b4821fe05aadae2cf92c8188f54f84411128748d1255
7
- data.tar.gz: 0db3b5372728fc41293a93f155f3e62c05ca463a4d849260e6f6f2b6fde0f01f25987b893420d15695114d017a2a6fbd84f82d656e3b356483c62f3838047dba
6
+ metadata.gz: bae18f395ed21a74a5c75dc5b039ca92e495083a15f469bda845dd35873f8f481a0768532984719091baeb16be5f458b4733df48b2beff58cdb5733ff0c6fb5a
7
+ data.tar.gz: d535921e763f176a56c0432ce7dc22240b43eacf4a032e08da1de3b14b17b6030dfbad6851f8e83be0b92c0652a61b91c4a120c9a73fb5c26960c57b2a6389b4
@@ -124,8 +124,6 @@ module Makit
124
124
  command
125
125
  end
126
126
 
127
-
128
-
129
127
  def show_command(command)
130
128
  if command.exit_code != 0
131
129
  puts Makit::CommandRunner.get_command_summary(command) + " (exit code #{command.exit_code})".colorize(:default)
@@ -185,6 +183,7 @@ module Makit
185
183
  def cache_try(command_request)
186
184
  cache_try(command_request, @default_modified)
187
185
  end
186
+
188
187
  def cache_try(command_request, timestamp)
189
188
  command_request.exit_on_error = false
190
189
  cache_run(command_request, timestamp)
data/lib/makit/dotnet.rb CHANGED
@@ -21,6 +21,13 @@ module Makit
21
21
  end
22
22
  end
23
23
 
24
+ def self.set_project_target_framework(project_hint, target_framework)
25
+ project_path = find_project(project_hint)
26
+ project_content = File.read(project_path)
27
+ project_content.gsub!(/<TargetFramework>.*<\/TargetFramework>/, "<TargetFramework>#{target_framework}</TargetFramework>")
28
+ File.write(project_path, project_content)
29
+ end
30
+
24
31
  def self.find_project(project_hint)
25
32
  matches = []
26
33
  Dir.glob("**/*.csproj").each do |project_path|
@@ -103,15 +103,15 @@ module Makit
103
103
  parts = []
104
104
  parts << "#{days} days" if days > 0
105
105
  parts << "#{hours} hours" if hours > 0
106
- if(minutes > 0)
107
- if(minutes == 1)
106
+ if (minutes > 0)
107
+ if (minutes == 1)
108
108
  parts << "1 minute"
109
109
  else
110
110
  parts << "#{minutes} minutes"
111
111
  end
112
112
  end
113
- if(seconds > 0)
114
- if(seconds == 1)
113
+ if (seconds > 0)
114
+ if (seconds == 1)
115
115
  parts << "1 second"
116
116
  else
117
117
  parts << "#{seconds} seconds"
@@ -120,7 +120,7 @@ module Makit
120
120
  #parts << "#{seconds} seconds" if seconds > 0
121
121
  parts << "#{milliseconds} milliseconds" if milliseconds > 0 && seconds < 1
122
122
 
123
- if(parts.length == 0)
123
+ if (parts.length == 0)
124
124
  parts << "0 seconds"
125
125
  end
126
126
  parts.join(", ")
@@ -19,8 +19,6 @@ class String
19
19
  end
20
20
  end
21
21
 
22
-
23
-
24
22
  def cache_run()
25
23
  command = self
26
24
  Makit::RUNNER.cache_run(Makit::RUNNER::parse_command_request(command))
@@ -67,7 +65,6 @@ class String
67
65
  Makit::RUNNER.cache_try(Makit::RUNNER::parse_command_request(command), timestamp)
68
66
  end
69
67
 
70
-
71
68
  # Read a value from a JSON file
72
69
  # key is a string with the key to read, e.g. "AzureAd.Authority"
73
70
  def get_json_value(key)
data/lib/makit/show.rb CHANGED
@@ -35,7 +35,7 @@ module Makit
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
+ puts "#{file_symbol} ".colorize(:grey) + "#{humanized_size.rjust(10)} ".colorize(:cyan) + " #{path} ".colorize(:grey)
39
39
  else
40
40
  puts "#{path} does not exist"
41
41
  end
@@ -93,16 +93,14 @@ module Makit
93
93
  #case switch
94
94
  #if extension == ".csproj"
95
95
  # version = Makit::Version.detect_from_file(path, /<Version>([-\w\d.]+)</)
96
- # if version.empty?
97
- # puts "no version found in #{path}"
98
- # else
99
- # puts " #{version}".colorize(:green) + " found in #{path}".colorize(:grey)
100
- # end
101
- # else
102
- ## puts "unrecognized file type"
96
+ # if version.empty?
97
+ # puts "no version found in #{path}"
98
+ # else
99
+ # puts " #{version}".colorize(:green) + " found in #{path}".colorize(:grey)
100
+ # end
101
+ # else
102
+ ## puts "unrecognized file type"
103
103
  #end
104
104
  end
105
105
  end
106
106
  end
107
-
108
-
@@ -2,11 +2,10 @@
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
3
  # source: lib/makit/v1/makit.v1.proto
4
4
 
5
- require 'google/protobuf'
6
-
7
- require 'google/protobuf/timestamp_pb'
8
- require 'google/protobuf/duration_pb'
5
+ require "google/protobuf"
9
6
 
7
+ require "google/protobuf/timestamp_pb"
8
+ require "google/protobuf/duration_pb"
10
9
 
11
10
  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
11
 
data/lib/makit/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Makit
4
- VERSION = "0.0.47"
4
+ VERSION = "0.0.49"
5
5
 
6
6
  class Version
7
7
  # given an array of version strings, return the highest version
@@ -10,7 +10,7 @@ module Makit
10
10
  end
11
11
 
12
12
  def self.get_version_from_file(path)
13
- if(!File.exist?(path))
13
+ if (!File.exist?(path))
14
14
  raise "file #{path}does not exist"
15
15
  end
16
16
 
@@ -24,7 +24,7 @@ module Makit
24
24
  Makit::Version.detect_from_file(path, /<Version>([-\w\d.]+)</)
25
25
  when ".wxs"
26
26
  Makit::Version.detect_from_file(path, / Version="([\d\.]+)"/)
27
- else
27
+ else
28
28
  raise "unrecognized file type"
29
29
  end
30
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: makit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.47
4
+ version: 0.0.49
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow