makit 0.0.48 → 0.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/makit/v1/makit.v1_pb.rb +34 -0
  3. data/lib/generated/makit/v1/web/link_pb.rb +20 -0
  4. data/lib/makit/apache.rb +32 -32
  5. data/lib/makit/cli/clean.rb +14 -14
  6. data/lib/makit/cli/clone.rb +59 -59
  7. data/lib/makit/cli/init.rb +38 -38
  8. data/lib/makit/cli/main.rb +33 -33
  9. data/lib/makit/cli/make.rb +54 -54
  10. data/lib/makit/cli/new.rb +37 -37
  11. data/lib/makit/cli/nuget_cache.rb +38 -38
  12. data/lib/makit/cli/pull.rb +31 -31
  13. data/lib/makit/cli/setup.rb +71 -71
  14. data/lib/makit/cli/work.rb +21 -21
  15. data/lib/makit/command_runner.rb +399 -391
  16. data/lib/makit/commands.rb +21 -21
  17. data/lib/makit/content/default_gitignore.rb +5 -5
  18. data/lib/makit/content/default_rakefile.rb +11 -11
  19. data/lib/makit/content/gem_rakefile.rb +14 -14
  20. data/lib/makit/data.rb +50 -50
  21. data/lib/makit/directories.rb +140 -140
  22. data/lib/makit/directory.rb +200 -200
  23. data/lib/makit/dotnet.rb +170 -162
  24. data/lib/makit/environment.rb +127 -127
  25. data/lib/makit/fileinfo.rb +16 -16
  26. data/lib/makit/files.rb +47 -47
  27. data/lib/makit/git.rb +87 -87
  28. data/lib/makit/gitlab_runner.rb +60 -60
  29. data/lib/makit/humanize.rb +129 -129
  30. data/lib/makit/indexer.rb +56 -56
  31. data/lib/makit/logging.rb +96 -96
  32. data/lib/makit/markdown.rb +75 -75
  33. data/lib/makit/mp/basic_object_mp.rb +16 -16
  34. data/lib/makit/mp/command_request.mp.rb +16 -16
  35. data/lib/makit/mp/project_mp.rb +210 -210
  36. data/lib/makit/mp/string_mp.rb +137 -122
  37. data/lib/makit/nuget.rb +57 -57
  38. data/lib/makit/protoc.rb +104 -104
  39. data/lib/makit/serializer.rb +115 -115
  40. data/lib/makit/show.rb +106 -108
  41. data/lib/makit/storage.rb +131 -131
  42. data/lib/makit/symbols.rb +149 -149
  43. data/lib/makit/tasks.rb +61 -60
  44. data/lib/makit/tree.rb +37 -37
  45. data/lib/makit/v1/makit.v1_pb.rb +33 -34
  46. data/lib/makit/v1/makit.v1_services_pb.rb +25 -25
  47. data/lib/makit/version.rb +52 -52
  48. data/lib/makit/wix.rb +95 -95
  49. data/lib/makit/zip.rb +17 -17
  50. data/lib/makit.rb +267 -267
  51. metadata +4 -2
@@ -1,38 +1,38 @@
1
- # frozen_string_literal: true
2
-
3
- require "clamp"
4
-
5
- module Makit
6
- module Cli
7
- # Define the 'nuget_cache' subcommand
8
- #
9
- # nuget_cache Google.Protobuf
10
- # nuget_cache Google.Protobuf 3.27.2
11
- class NugetCacheCommand < Clamp::Command
12
- parameter "PACKAGE", "The package id", attribute_name: :package, required: true
13
- parameter "VERSION", "The package version", attribute_name: :version, default: nil
14
-
15
- def execute
16
- if version.nil?
17
- # look up the latest version of the package
18
- raise "TODO: implement latest version lookup"
19
- end
20
-
21
- # download the package
22
- url = "https://www.nuget.org/api/v2/package/#{package}/#{version}"
23
- if !url.nil?
24
- # download the package
25
-
26
- raise "TODO: implement package download"
27
- puts "url: #{url}"
28
- puts "relative directoyr: #{Makit::Environment.get_relative_directory(url)}"
29
- puts "work directory: #{Makit::Environment.get_work_directory(url)}"
30
- end
31
- puts "TODO: implement work command"
32
- end
33
- end
34
-
35
- def install_cache_package(package, version)
36
- end
37
- end
38
- end
1
+ # frozen_string_literal: true
2
+
3
+ require "clamp"
4
+
5
+ module Makit
6
+ module Cli
7
+ # Define the 'nuget_cache' subcommand
8
+ #
9
+ # nuget_cache Google.Protobuf
10
+ # nuget_cache Google.Protobuf 3.27.2
11
+ class NugetCacheCommand < Clamp::Command
12
+ parameter "PACKAGE", "The package id", attribute_name: :package, required: true
13
+ parameter "VERSION", "The package version", attribute_name: :version, default: nil
14
+
15
+ def execute
16
+ if version.nil?
17
+ # look up the latest version of the package
18
+ raise "TODO: implement latest version lookup"
19
+ end
20
+
21
+ # download the package
22
+ url = "https://www.nuget.org/api/v2/package/#{package}/#{version}"
23
+ if !url.nil?
24
+ # download the package
25
+
26
+ raise "TODO: implement package download"
27
+ puts "url: #{url}"
28
+ puts "relative directoyr: #{Makit::Environment.get_relative_directory(url)}"
29
+ puts "work directory: #{Makit::Environment.get_work_directory(url)}"
30
+ end
31
+ puts "TODO: implement work command"
32
+ end
33
+ end
34
+
35
+ def install_cache_package(package, version)
36
+ end
37
+ end
38
+ end
@@ -1,31 +1,31 @@
1
- # frozen_string_literal: true
2
-
3
- require "clamp"
4
- #require "git"
5
-
6
- module Makit
7
- module Cli
8
- # Define the 'pull' subcommand
9
- class PullCommand < Clamp::Command
10
- parameter "GIT_REPOSITORY", "The git repository url", attribute_name: :git_repository, required: true
11
- option "--ignore-errors", :flag, "Ignore errors and present warnings instead of exiting"
12
-
13
- def execute
14
- puts "pulling latest changes for repository: #{git_repository}"
15
- begin
16
- Makit::pull(git_repository)
17
- rescue Git::GitExecuteError => e
18
- $stderr.puts "failed to pull repository: #{git_repository}"
19
- puts "Please check the URL and your network connection."
20
- exit 1
21
- rescue => e
22
- $stderr.puts "failed to pull repository: #{git_repository}"
23
- puts e.message
24
- exit 1
25
- end
26
- clone_dir = Directories::get_clone_directory(git_repository)
27
- puts "size of clone directory: #{clone_dir} is #{Humanize::get_humanized_size(Directory::get_size(clone_dir))}"
28
- end
29
- end
30
- end
31
- end
1
+ # frozen_string_literal: true
2
+
3
+ require "clamp"
4
+ #require "git"
5
+
6
+ module Makit
7
+ module Cli
8
+ # Define the 'pull' subcommand
9
+ class PullCommand < Clamp::Command
10
+ parameter "GIT_REPOSITORY", "The git repository url", attribute_name: :git_repository, required: true
11
+ option "--ignore-errors", :flag, "Ignore errors and present warnings instead of exiting"
12
+
13
+ def execute
14
+ puts "pulling latest changes for repository: #{git_repository}"
15
+ begin
16
+ Makit::pull(git_repository)
17
+ rescue Git::GitExecuteError => e
18
+ $stderr.puts "failed to pull repository: #{git_repository}"
19
+ puts "Please check the URL and your network connection."
20
+ exit 1
21
+ rescue => e
22
+ $stderr.puts "failed to pull repository: #{git_repository}"
23
+ puts e.message
24
+ exit 1
25
+ end
26
+ clone_dir = Directories::get_clone_directory(git_repository)
27
+ puts "size of clone directory: #{clone_dir} is #{Humanize::get_humanized_size(Directory::get_size(clone_dir))}"
28
+ end
29
+ end
30
+ end
31
+ end
@@ -1,71 +1,71 @@
1
- # frozen_string_literal: true
2
-
3
- require "clamp"
4
-
5
- module Makit
6
- module Cli
7
- # Define the 'new' subcommand
8
- class SetupCommand < Clamp::Command
9
- PACKAGE_TYPES = %w[gem crate nuget].freeze
10
- option "--list", :flag, "List available package types"
11
- option ["-t", "--type"], "TYPE", "The package type", default: "gem"
12
- option ["-o", "--output"], "OUTPUT", "The output directory", default: "."
13
- parameter "TYPE", "Type of the package", attribute_name: :type, required: false
14
- parameter "NAME", "Name of the package", attribute_name: :name, required: false
15
-
16
- def execute
17
- if list?
18
- puts "Available package types:"
19
- PACKAGE_TYPES.each { |t| puts " - #{t}" }
20
- else
21
- if type.nil? || name.nil?
22
- puts "Error: TYPE and NAME are required unless using --list"
23
- exit(1)
24
- end
25
-
26
- unless PACKAGE_TYPES.include?(type)
27
- puts "Error: '#{type}' is not a valid type. Use --list to see available types."
28
- exit(1)
29
- end
30
-
31
- if !Makit::IS_GIT_REPO
32
- Makit::LOGGER.error("#{Dir.pwd} does not appear to be a git repository.")
33
- exit(1)
34
- end
35
- if Makit::IS_READ_ONLY
36
- Makit::LOGGER.error("The git repository is in a read-only state.")
37
- exit(1)
38
- end
39
-
40
- # if a Rakefile already exists, then the project has already been setup
41
- if File.exist?("Rakefile")
42
- Makit::LOGGER.error("Rakefile detected, The project has already been setup.")
43
- exit(1)
44
- end
45
-
46
- # verify the root directory has a .gitignore file
47
- if !File.exist?(".gitignore")
48
- Makit::LOGGER.info("added .gitignore file")
49
- File.open(".gitignore", "w") do |file|
50
- file.puts Makit::Content::GITIGNORE
51
- end
52
- end
53
-
54
- # verify the root directory has a Rakefile
55
-
56
- if (type == "gem")
57
- if !File.exist?("Gemfile")
58
- Makit::RUNNER.run("bundle gem . --coc --mit --exe --no-git --ci=gitlab_ci --test=minitest --changelog --linter=rubocop")
59
-
60
- # overwrite the Rakefile with the one from the gem template
61
- File.open("Rakefile", "w") do |file|
62
- file.puts Makit::Content::GEM_RAKEFILE.gsub("GEM_NAME", name)
63
- end
64
- end
65
- end
66
- # Makit::LOGGER.info("bundle gem . --coc --mit --exe --no-git --ci=gitlab_ci --test=minitest --changelog --linter=rubocop --skip=Rakefile,README.md")
67
- end
68
- end
69
- end
70
- end
71
- end
1
+ # frozen_string_literal: true
2
+
3
+ require "clamp"
4
+
5
+ module Makit
6
+ module Cli
7
+ # Define the 'new' subcommand
8
+ class SetupCommand < Clamp::Command
9
+ PACKAGE_TYPES = %w[gem crate nuget].freeze
10
+ option "--list", :flag, "List available package types"
11
+ option ["-t", "--type"], "TYPE", "The package type", default: "gem"
12
+ option ["-o", "--output"], "OUTPUT", "The output directory", default: "."
13
+ parameter "TYPE", "Type of the package", attribute_name: :type, required: false
14
+ parameter "NAME", "Name of the package", attribute_name: :name, required: false
15
+
16
+ def execute
17
+ if list?
18
+ puts "Available package types:"
19
+ PACKAGE_TYPES.each { |t| puts " - #{t}" }
20
+ else
21
+ if type.nil? || name.nil?
22
+ puts "Error: TYPE and NAME are required unless using --list"
23
+ exit(1)
24
+ end
25
+
26
+ unless PACKAGE_TYPES.include?(type)
27
+ puts "Error: '#{type}' is not a valid type. Use --list to see available types."
28
+ exit(1)
29
+ end
30
+
31
+ if !Makit::IS_GIT_REPO
32
+ Makit::LOGGER.error("#{Dir.pwd} does not appear to be a git repository.")
33
+ exit(1)
34
+ end
35
+ if Makit::IS_READ_ONLY
36
+ Makit::LOGGER.error("The git repository is in a read-only state.")
37
+ exit(1)
38
+ end
39
+
40
+ # if a Rakefile already exists, then the project has already been setup
41
+ if File.exist?("Rakefile")
42
+ Makit::LOGGER.error("Rakefile detected, The project has already been setup.")
43
+ exit(1)
44
+ end
45
+
46
+ # verify the root directory has a .gitignore file
47
+ if !File.exist?(".gitignore")
48
+ Makit::LOGGER.info("added .gitignore file")
49
+ File.open(".gitignore", "w") do |file|
50
+ file.puts Makit::Content::GITIGNORE
51
+ end
52
+ end
53
+
54
+ # verify the root directory has a Rakefile
55
+
56
+ if (type == "gem")
57
+ if !File.exist?("Gemfile")
58
+ Makit::RUNNER.run("bundle gem . --coc --mit --exe --no-git --ci=gitlab_ci --test=minitest --changelog --linter=rubocop")
59
+
60
+ # overwrite the Rakefile with the one from the gem template
61
+ File.open("Rakefile", "w") do |file|
62
+ file.puts Makit::Content::GEM_RAKEFILE.gsub("GEM_NAME", name)
63
+ end
64
+ end
65
+ end
66
+ # Makit::LOGGER.info("bundle gem . --coc --mit --exe --no-git --ci=gitlab_ci --test=minitest --changelog --linter=rubocop --skip=Rakefile,README.md")
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -1,21 +1,21 @@
1
- # frozen_string_literal: true
2
-
3
- require "clamp"
4
-
5
- module Makit
6
- module Cli
7
- # Define the 'new' subcommand
8
- class WorkCommand < Clamp::Command
9
- option ["-u", "--url"], "URL", "The git repository url"
10
-
11
- def execute
12
- if !url.nil?
13
- puts "url: #{url}"
14
- puts "relative directoyr: #{Makit::Environment.get_relative_directory(url)}"
15
- puts "work directory: #{Makit::Environment.get_work_directory(url)}"
16
- end
17
- puts "TODO: implement work command"
18
- end
19
- end
20
- end
21
- end
1
+ # frozen_string_literal: true
2
+
3
+ require "clamp"
4
+
5
+ module Makit
6
+ module Cli
7
+ # Define the 'new' subcommand
8
+ class WorkCommand < Clamp::Command
9
+ option ["-u", "--url"], "URL", "The git repository url"
10
+
11
+ def execute
12
+ if !url.nil?
13
+ puts "url: #{url}"
14
+ puts "relative directoyr: #{Makit::Environment.get_relative_directory(url)}"
15
+ puts "work directory: #{Makit::Environment.get_work_directory(url)}"
16
+ end
17
+ puts "TODO: implement work command"
18
+ end
19
+ end
20
+ end
21
+ end