makit 0.0.30 → 0.0.32

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: 43098ef20f3f3858d7446654d2eab8d135db42f93c8422e5667a6828a41a7f93
4
- data.tar.gz: 9c013464f74fdc1f7834189e0514d51ee8911d81de4aa79206f6a24a0564b6b9
3
+ metadata.gz: 7171c87f0672a845fabff8aafe834c249c5afc049b8b19b1617195db5d8f525d
4
+ data.tar.gz: 18f8bced0cf82178693dd01b0cc91c38091fcec8f3dea8daf710a2ddff1eefa6
5
5
  SHA512:
6
- metadata.gz: e0c03229bcc5ea60817a726ba2bae1416463c15b8a0a53a6afeeac816ed4924062be90906a90dd13a62b079b88315a72b3c57b0d154ca1542608858519c7b10d
7
- data.tar.gz: 80f8b3e0675491354c19a65dc2192656bee657245208370af1cfd7d7d858a7968c24e5f7b30574a9107e69e28f2378221aee8e653b88fd2ff53cca60193fdf24
6
+ metadata.gz: caa6f2dc113c62bacba9634674b05a2b8161e914db135064acc150445bc27a2cd3715f58ceb1fa238e94096e557c99f29bd3555375e68fbd46391018bc3dc1ac
7
+ data.tar.gz: a533113bac07e6ab8b0ce4834a7d2ec702d2a1b4312265103336d35849b6b26b2067139816a88eba5bae113dba4d25633747d31de5d623f0babb509953d44ffe
data/lib/makit/dotnet.rb CHANGED
@@ -16,8 +16,32 @@ module Makit
16
16
  "dotnet new #{template} --name #{name} --output #{output}".run
17
17
  end
18
18
  end
19
+
20
+ def find_project(project_hint)
21
+ matches = []
22
+ Dir.glob("**/*.csproj").each do |project_path|
23
+ project_name = File.basename(project_path, ".csproj")
24
+ if project_name.include?(project_hint)
25
+ matches << project_path
26
+ end
27
+ end
28
+ if matches.length == 1
29
+ return matches.first
30
+ elsif matches.length > 1
31
+ raise "Multiple projects found matching #{project_hint}".colorize(:red)
32
+ end
33
+ raise "No project found matching #{project_hint}".colorize(:red)
34
+ end
19
35
 
20
36
  def self.add_package(project_path, package_name)
37
+ if(!File.exist?(project_path))
38
+ actual_project_path = find_project(project_path)
39
+ if(!File.exist?(actual_project_path))
40
+ raise "Project #{project_path} does not exist".colorize(:red)
41
+ else
42
+ project_path = actual_project_path
43
+ end
44
+ end
21
45
  project_content = File.read(project_path)
22
46
  if (!project_content.include?("\"#{package_name}\""))
23
47
  "dotnet add #{project_path} package #{package_name}".run
@@ -26,6 +50,12 @@ module Makit
26
50
  end
27
51
  end
28
52
 
53
+ def self.add_packages(project_path, packages)
54
+ packages.each do |package|
55
+ add_package(project_path, package)
56
+ end
57
+ end
58
+
29
59
  def self.add_reference(project_path, reference_path)
30
60
  project_content = File.read(project_path)
31
61
  if (project_content.include?("<PackageReference Include=\"#{package}\""))
data/lib/makit/git.rb CHANGED
@@ -35,6 +35,12 @@ module Makit
35
35
  end
36
36
  end
37
37
 
38
+ def self.pull
39
+ if is_git_repo && !detached
40
+ "git pull".try
41
+ end
42
+ end
43
+
38
44
  def self.zip_source_files(zipfilename)
39
45
  "git archive --format zip --output #{zipfilename} HEAD".run
40
46
  end
data/lib/makit/show.rb CHANGED
@@ -50,6 +50,12 @@ module Makit
50
50
  "\u{1F4C1}"
51
51
  end
52
52
 
53
+ def task_symbol
54
+ # 🛠️ (U+1F6E0) Hammer and Wrench – Represents tools, suitable for tasks and automation.
55
+ "\u{1F6E0}"
56
+
57
+ end
58
+
53
59
  def size(path)
54
60
  if File.file?(path)
55
61
  puts "#{path} size is ".colorize(:grey) + "#{Makit::Humanize.get_humanized_size(File.size(path))}".colorize(:cyan)
@@ -61,7 +67,9 @@ module Makit
61
67
  end
62
68
 
63
69
  def task(task)
64
- puts ":#{task}".colorize(:green)
70
+ puts ("=" * 80).colorize(:grey)
71
+ puts " ".colorize(:grey) + "#{task}".colorize(:green)
72
+ #puts ("=" * 100).colorize(:grey)
65
73
  end
66
74
  end
67
75
  end
data/lib/makit/tasks.rb CHANGED
@@ -31,6 +31,11 @@ task :sync do
31
31
  Makit::Git.sync
32
32
  end
33
33
 
34
+ task :pull do
35
+ Makit::SHOW.task(:pull)
36
+ Makit::Git.pull
37
+ end
38
+
34
39
  desc "Format source code."
35
40
  task :format do
36
41
  puts ":format".colorize(:blue)
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.30"
4
+ VERSION = "0.0.32"
5
5
 
6
6
  class Version
7
7
  # given an array of version strings, return the highest version
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.30
4
+ version: 0.0.32
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-02 00:00:00.000000000 Z
11
+ date: 2024-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp