makit 0.0.33 → 0.0.35

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: d00a0a0efde9ee45b2cd4363c527eef69c127424743837dd5c5cfc8a00622342
4
- data.tar.gz: a8835534858f96b289c737801a6d8e924027a485c221aa257d20e36f0932949f
3
+ metadata.gz: a79c18c93c439b527f46d64e9689594f70bb2acf3fe9a9b44d453509dc3621b7
4
+ data.tar.gz: 6d7aa7f2db172dab97275258f2dde38e11e896232be3a6270e67b0990e384f5c
5
5
  SHA512:
6
- metadata.gz: e7efd7efcaacc88cd3517d8033a88bb95012a5dbd8acc86c7336e9545b9e90d1d8c72618fe78e65d9f5de765c25bb11c85fc88ddc075b46ed78d2e366d3c5edf
7
- data.tar.gz: 44a398646bb2cfa2e4d4ea94242c2887d03c2c64bd2f0409ed6a51f7ff4e3469f6ff9e4e7650bb880eaa8669ffe9117e2ed5a39944c74830c484f2b6dc9e7fa7
6
+ metadata.gz: d99bf18acad1e3278e382b8b83484c19ccbcd3bf2e6e2f7aed4fcb4cbc0b1bdce8f8a9d74d5130d67cb65f5d2d9a876b06965b5c3c212db5219c1b9f7f8b1106
7
+ data.tar.gz: 96ef113e6ae16f1e378b18d13ccf28749affe9430ae05e0a55c359150c4176ccd57d27c7751a8a270b402d6af8fbb5daadfdd5c3808e98ad50110a020c4c857f
data/lib/makit/dotnet.rb CHANGED
@@ -17,11 +17,11 @@ module Makit
17
17
  end
18
18
  end
19
19
 
20
- def find_project(project_hint)
20
+ def self.find_project(project_hint)
21
21
  matches = []
22
22
  Dir.glob("**/*.csproj").each do |project_path|
23
- project_name = File.basename(project_path, ".csproj")
24
- if project_name.include?(project_hint)
23
+ #project_name = File.basename(project_path, ".csproj")
24
+ if project_path.include?(project_hint)
25
25
  matches << project_path
26
26
  end
27
27
  end
@@ -35,7 +35,7 @@ module Makit
35
35
 
36
36
  def self.add_package(project_path, package_name)
37
37
  if(!File.exist?(project_path))
38
- actual_project_path = Makit::DotNet.find_project(project_path)
38
+ actual_project_path = Makit::DotNet::find_project(project_path)
39
39
  if(!File.exist?(actual_project_path))
40
40
  raise "Project #{project_path} does not exist".colorize(:red)
41
41
  else
@@ -57,14 +57,36 @@ module Makit
57
57
  end
58
58
 
59
59
  def self.add_reference(project_path, reference_path)
60
+ if(!File.exist?(project_path))
61
+ actual_project_path = Makit::DotNet::find_project(project_path)
62
+ if(!File.exist?(actual_project_path))
63
+ raise "Project #{project_path} does not exist".colorize(:red)
64
+ else
65
+ project_path = actual_project_path
66
+ end
67
+ end
68
+ if(!File.exist?(reference_path))
69
+ actual_reference_path = Makit::DotNet::find_project(reference_path)
70
+ if(!File.exist?(actual_reference_path))
71
+ raise "Project #{reference_path} does not exist".colorize(:red)
72
+ else
73
+ reference_path = actual_reference_path
74
+ end
75
+ end
60
76
  project_content = File.read(project_path)
61
- if (project_content.include?("<PackageReference Include=\"#{package}\""))
77
+ if (project_content.include?(File.basename(reference_path)))
62
78
  #puts " reference ".colorize(:grey) + "#{reference_path}".colorize(:yellow) + " is in ".colorize(:grey) + "#{project_path}".colorize(:yellow)
63
79
  else
64
80
  "dotnet add #{project_path} reference #{reference_path}".run
65
81
  end
66
82
  end
67
83
 
84
+ def self.add_references(project_path, references)
85
+ references.each do |reference|
86
+ add_reference(project_path, reference)
87
+ end
88
+ end
89
+
68
90
  def self.new_solution(name)
69
91
  if File.exist? "#{name}.sln"
70
92
  #puts "Solution #{name}.sln already exists".colorize(:yellow)
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.33"
4
+ VERSION = "0.0.35"
5
5
 
6
6
  class Version
7
7
  # given an array of version strings, return the highest version
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.33
4
+ version: 0.0.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow