makit 0.0.0 → 0.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 003a54dbf33616f760ac7443aea7d74e1b70f0b95809ab345be5c54fdabcadfa
4
- data.tar.gz: 123f91fdb376123091b57b4e596d0e0bc67a4b9ae0a2f592a30ba344ed4a9119
3
+ metadata.gz: d96fc6d350adba32aeeb40fba6f10b5b2e1758525b0ddd7a05cceea5f258a5d0
4
+ data.tar.gz: 263bd0ef8193d132eb679e4a0b5e0347a152c0da340b7da219ffdec74677cda0
5
5
  SHA512:
6
- metadata.gz: d96b5ea88cd6dd16bbd62dd94bdf31ac47a8677a33fe9f9b5229ab847d0785941a9ed951fe4d920038ac3df33fb194d3d356b676d147e7f0bbd4f32cef7fc590
7
- data.tar.gz: af5cb838de899f9e19e03221fee0fb61d9d5e87644447c919c463246487f06b6aef544d2d3a59990f4fc581e00d86de97b8c8fe98901073d4206a8821f66bea4
6
+ metadata.gz: 294f0dfb563e276414000deea7dc753d13fb097e91c96b585ddef7170036705cb847f8f77dab913e6c05cdbe647d11f24fdb9addf70251ca0d3bb013009aa840
7
+ data.tar.gz: ffa7b5dffd983f109348a4f93f178eeee729c1f4ef4a2b2d2c23b320c4f9b2daab07ce95c41aeef68d85044ae3e34f23930d0478c3659ba11b06c2108ca1af55
data/.rubocop.yml CHANGED
@@ -1,22 +1,22 @@
1
- require:
2
- - rubocop-minitest
3
- - rubocop-rake
4
-
5
- # Configuration for rubocop-minitest
6
- Minitest/AssertNil:
7
- Enabled: true
8
-
9
- # Configuration for rubocop-rake
10
- Rake/Desc:
11
- Enabled: true
12
-
13
- AllCops:
14
- TargetRubyVersion: 3.0
15
- Exclude:
16
- - 'lib/makit_pb.rb'
17
-
18
- Style/StringLiterals:
19
- EnforcedStyle: double_quotes
20
-
21
- Style/StringLiteralsInInterpolation:
22
- EnforcedStyle: double_quotes
1
+ require:
2
+ - rubocop-minitest
3
+ - rubocop-rake
4
+
5
+ # Configuration for rubocop-minitest
6
+ Minitest/AssertNil:
7
+ Enabled: true
8
+
9
+ # Configuration for rubocop-rake
10
+ Rake/Desc:
11
+ Enabled: true
12
+
13
+ AllCops:
14
+ TargetRubyVersion: 3.0
15
+ Exclude:
16
+ - 'lib/makit_pb.rb'
17
+
18
+ Style/StringLiterals:
19
+ EnforcedStyle: double_quotes
20
+
21
+ Style/StringLiteralsInInterpolation:
22
+ EnforcedStyle: double_quotes
data/CHANGELOG.md CHANGED
@@ -1,8 +1,8 @@
1
- ## [Unreleased]
2
-
3
- ## Todo
4
- - [ ] makit new command: command to initialize new projects
5
-
6
- ## [0.0.0] - 2024-05-25
7
-
8
- - Initial release
1
+ ## [Unreleased]
2
+
3
+ ## Todo
4
+ - [ ] makit new command: command to initialize new projects
5
+
6
+ ## [0.0.0] - 2024-05-25
7
+
8
+ - Initial release
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,84 +1,84 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
29
-
30
- ## Enforcement Responsibilities
31
-
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
-
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
-
36
- ## Scope
37
-
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
-
40
- ## Enforcement
41
-
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
-
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
-
46
- ## Enforcement Guidelines
47
-
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
-
50
- ### 1. Correction
51
-
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
-
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
-
56
- ### 2. Warning
57
-
58
- **Community Impact**: A violation through a single incident or series of actions.
59
-
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
-
62
- ### 3. Temporary Ban
63
-
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
-
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
-
68
- ### 4. Permanent Ban
69
-
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
-
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
73
-
74
- ## Attribution
75
-
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
-
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
82
-
83
- For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Rakefile CHANGED
@@ -53,6 +53,8 @@ task :test do
53
53
  `ruby -r minitest/autorun test/test_makit.rb -- --fail-fast > artifacts/test_makit.log 2>&1`
54
54
  "ruby -r minitest/autorun test/test_makit.rb -- --fail-fast".run
55
55
  #"bundle exec rake".run
56
+
57
+ raise "artifacts/test_makit.log not found" unless File.exist? "artifacts/test_makit.log"
56
58
  end
57
59
 
58
60
  desc "test the examples"
@@ -99,19 +101,19 @@ task :install => [:build] do
99
101
  end
100
102
  end
101
103
 
102
- task :publish => [:build,:test, :integrate] do
104
+ task :publish => [:build, :test, :integrate] do
103
105
  puts ":publish".colorize(:blue)
104
106
  gem = "makit-#{Makit::VERSION}.gem"
105
107
  puts "gem file #{gem} does not exist" unless File.exist?(gem)
106
108
 
107
- gem_list_text =`gem list --remote makit`# Raykit::Command::new("gem list --remote makit").run.output
109
+ gem_list_text = `gem list --remote makit` # Raykit::Command::new("gem list --remote makit").run.output
108
110
  if gem_list_text.include?("makit")
109
111
  "gem list --remote makit".run
110
- latest_published_version =''
111
- makit_list= `gem list --remote makit`.gsub(" ruby", "").strip
112
- if(makit_list.length > 0)
112
+ latest_published_version = ""
113
+ makit_list = `gem list --remote makit`.gsub(" ruby", "").strip
114
+ if (makit_list.length > 0)
113
115
  # check if scan is empty
114
- if(makit_list.scan(/makit \(([\d.]+)\)/).empty?)
116
+ if (makit_list.scan(/makit \(([\d.]+)\)/).empty?)
115
117
  latest_published_version = ""
116
118
  else
117
119
  latest_published_version = makit_list.scan(/makit \(([\d.]+)\)/).last.first
@@ -129,7 +131,6 @@ task :publish => [:build,:test, :integrate] do
129
131
  end
130
132
  end
131
133
 
132
-
133
134
  task :info do
134
135
  puts ":info".colorize(:blue)
135
136
 
@@ -184,7 +185,16 @@ at_exit do
184
185
  puts "Performing cleanup..."
185
186
  # Add your cleanup code here
186
187
  # For example, close files, remove temporary files, etc.
187
- json_filename = File.join(Makit::Directories::PROJECT_ROOT, ".makit.project.json")
188
- puts "Saving project state to #{json_filename}"
189
- Makit::PROJECT.save_as(json_filename)
188
+ #json_filename = File.join(Makit::Directories::PROJECT_ROOT, ".makit.project.json")
189
+ #puts "Saving project state to #{json_filename}"
190
+ #Makit::PROJECT.save_as(json_filename)
191
+
192
+ # display the 5 slowest commands
193
+ puts " slowest commands"
194
+ Makit::RUNNER.commands.sort_by { |command| (command.duration.seconds + (command.duration.nanos / 1_000_000_000.0)) }.reverse.first(5).each do |command|
195
+ # Convert to float representation
196
+ duration_in_float = command.duration.seconds + (command.duration.nanos / 1_000_000_000.0)
197
+ #puts " #{command.name} took #{duration_in_float} seconds"
198
+ puts " " + Makit::CommandRunner.get_command_summary(command) + " (#{command.duration.seconds} seconds)".colorize(:cyan)
199
+ end
190
200
  end
@@ -2,4 +2,5 @@ require "makit"
2
2
 
3
3
  task :default do
4
4
  puts "default task"
5
+ Makit::PROJECT.save_as(".makit.project.json") unless File.exist?(".makit.project.json")
5
6
  end
@@ -9,11 +9,12 @@ module Makit
9
9
  # This class provide methods running commands.
10
10
  #
11
11
  class CommandRunner
12
- attr_accessor :show_output_on_success, :log_to_artifacts
12
+ attr_accessor :show_output_on_success, :log_to_artifacts, :commands
13
13
 
14
14
  def initialize
15
15
  @show_output_on_success = false
16
16
  @log_to_artifacts = false
17
+ @commands = []
17
18
  end
18
19
 
19
20
  def run(command_request)
@@ -35,6 +36,7 @@ module Makit
35
36
  puts Makit::Humanize::indent_string(command.output, 2).colorize(:default) if show_output_on_success
36
37
  end
37
38
 
39
+ commands.push(command)
38
40
  command
39
41
  end
40
42
 
@@ -160,7 +162,6 @@ module Makit
160
162
  result.error = error.force_encoding("ASCII-8BIT")
161
163
  result.exit_code = exit_code.nil? ? 0 : exit_code
162
164
 
163
-
164
165
  elapsed_time = Time.now - start
165
166
  seconds = elapsed_time.to_i
166
167
  nanos = ((elapsed_time - seconds) * 1_000_000_000).to_i
@@ -227,11 +228,10 @@ module Makit
227
228
  summary = "#{symbol} #{command.name.colorize(:yellow)} #{command.arguments.join(" ")}"
228
229
 
229
230
  if summary.length > 80
230
- summary = summary.to_lines(80,command.name.length+3)
231
+ summary = summary.to_lines(80, command.name.length + 3)
231
232
  end
232
233
 
233
234
  summary
234
235
  end
235
-
236
236
  end # class CommandRunner
237
237
  end # module Makit