comito 0.1.0 → 0.2.0

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: 9940316c102cf40c790799cfdfdc1c45c7afd0784310e5d89a6308929f010460
4
- data.tar.gz: 37b0cc80837e6881fd287ed3bbd81b6197391869f8e809c20f64b384f67b0004
3
+ metadata.gz: 83dd5ead0fd34336baa1f2e59e35953a8a19a9a2d761e4e2df18f65a56792baa
4
+ data.tar.gz: d893e1755edc155e6cb97573fa2978036b9d76ee7ff86157a0623b5ffc49705e
5
5
  SHA512:
6
- metadata.gz: c3480fcbdd2bf8ba3d1ca9711dc5fe26fd303ca27665ffaebae266a06ed35887b0193a573420199d43d1030f6391e7944bb8a6cde249ff49db4db8275bcef48d
7
- data.tar.gz: 3274e506ba6227799d787a2e406749490f976798f4dc6124b6c06de9013eab897467ca67c5adc77c0eda7e2c5e2fefd394bc95255d4726ca887baf4c4601883b
6
+ metadata.gz: a4543debe2d6bbefd7065678ce8b4c88fa12005ed3b4d470726a162ca1bb44582786b0d38ca496ece99b1d1dbd2d7056c3a3389a62362a3cc3a369955ace4559
7
+ data.tar.gz: 801e540328007c5bb8258444afc72a19d1466926d89b88abdc7e54f4d02a0fea4191fa87d9294c1d1acec7789edd55afb00a5f5d437c77c321cae4c5283a380d
data/Gemfile.lock CHANGED
@@ -1,15 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- comito (0.1.0)
5
- cli-ui (~> 2.4)
4
+ comito (0.2.0)
5
+ tty-prompt (~> 0.23)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- cli-ui (2.4.0)
11
10
  diff-lcs (1.6.2)
12
11
  docile (1.4.1)
12
+ pastel (0.8.0)
13
+ tty-color (~> 0.5)
13
14
  rake (13.3.0)
14
15
  rspec (3.13.1)
15
16
  rspec-core (~> 3.13.0)
@@ -30,8 +31,20 @@ GEM
30
31
  simplecov_json_formatter (~> 0.1)
31
32
  simplecov-html (0.13.2)
32
33
  simplecov_json_formatter (0.1.4)
34
+ tty-color (0.6.0)
35
+ tty-cursor (0.7.1)
36
+ tty-prompt (0.23.1)
37
+ pastel (~> 0.8)
38
+ tty-reader (~> 0.8)
39
+ tty-reader (0.9.0)
40
+ tty-cursor (~> 0.7)
41
+ tty-screen (~> 0.8)
42
+ wisper (~> 2.0)
43
+ tty-screen (0.8.2)
44
+ wisper (2.0.1)
33
45
 
34
46
  PLATFORMS
47
+ arm64-darwin-25
35
48
  x86_64-darwin-24
36
49
 
37
50
  DEPENDENCIES
data/README.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  Comito is a lightweight and intuitive Ruby CLI tool that provides an interactive interface for crafting commit messages following the **Conventional Commits** standard in Rails projects (and any Ruby-based project).
4
4
 
5
+ ## Installation
6
+
7
+ ```bash
8
+ gem install comito
9
+ ```
10
+
11
+ Or add it to your project’s Gemfile:
12
+
13
+ ```bash
14
+ gem "comito"
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```bash
20
+ comito
21
+ ```
22
+
23
+ You’ll be guided through a series of prompts to build your commit message, with the option to confirm and commit directly.
24
+
5
25
  ## Features
6
26
 
7
27
  - 🚀 Interactive step-by-step interface to choose commit type (`feat`, `fix`, `chore`, `docs`, `style`, `refactor`, `test`, etc.).
@@ -19,26 +39,33 @@ Comito is a lightweight and intuitive Ruby CLI tool that provides an interactive
19
39
  - 🔄 Flexible and extensible — easily adapted to your team’s workflow.
20
40
  - 📚 Keeps your commit history clean and consistent for better collaboration and release management.
21
41
 
22
- ## Installation
42
+ ## Configuration File `comito_config.yml`
23
43
 
24
- ```bash
25
- gem install comito
26
- ```
44
+ Comito allows you to create a custom configuration file `comito_config.yml` in the root directory of your project.
27
45
 
28
- Or add it to your project’s Gemfile:
46
+ This file lets you override the default gem settings, such as commit types, scopes, and whether to confirm commit messages before committing.
29
47
 
30
- ```bash
31
- gem "comito"
32
- ```
48
+ Example config `comito_config.yml`:
49
+ ```yaml
50
+ types:
51
+ feat: "A new feature"
33
52
 
34
- ## Usage
53
+ scopes:
54
+ ruby: "Ruby code"
35
55
 
36
- ```bash
37
- comito
56
+ confirm_commit_message: false
38
57
  ```
39
58
 
40
- You’ll be guided through a series of prompts to build your commit message, with the option to confirm and commit directly.
59
+ ### How `comito_config` works:
41
60
 
42
- ## Usage
61
+ - Comito looks for the file `comito_config.yml` in the current directory (`Dir.pwd`)
62
+ - If the file exists, the settings are loaded from it.
63
+ - If the file does not exist, default values are used.
64
+
65
+ ## Example
66
+
67
+ <img src="images/comito_result.png" alt="Example" style="width:400px;">
68
+
69
+ ## License
43
70
 
44
71
  Apache-2.0
data/README_UA.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  Comito — це легкий та зручний Ruby CLI-інструмент, який надає інтерактивний інтерфейс для формування коміт-повідомлень відповідно до Conventional Commits у Rails-проєктах (та будь-яких Ruby-проєктах).
4
4
 
5
+ ## Встановлення
6
+
7
+ ```bash
8
+ gem install comito
9
+ ```
10
+
11
+ ## Використання
12
+
13
+ ```bash
14
+ comito
15
+ ```
16
+
17
+ Після запуску ти отримаєш послідовність запитань для формування commit message, а потім можеш підтвердити і зробити коміт.
18
+
5
19
  ## Основні можливості
6
20
 
7
21
  - 🚀 Інтуїтивний покроковий інтерфейс для вибору типу коміту (feat, fix, chore, docs, style, refactor, test тощо).
@@ -19,20 +33,33 @@ Comito — це легкий та зручний Ruby CLI-інструмент,
19
33
  - 🔄 Легко налаштовується та розширюється під потреби команди.
20
34
  - 📚 Допомагає підтримувати чисту, зрозумілу історію комітів для кращої співпраці і реліз-менеджменту.
21
35
 
22
- ## Встановлення
36
+ ## Конфігураційний файл `comito_config.yml`
23
37
 
24
- ```bash
25
- gem install comito
26
- ```
38
+ Comito дозволяє створювати власний файл конфігурації `comito_config.yml` у кореневій директорії вашого проєкту.
27
39
 
28
- ## Використання
40
+ Цей файл дозволяє змінювати стандартні налаштування гему, такі як типи комітів, області (scopes) та підтвердження перед комітом.
29
41
 
30
- ```bash
31
- comito
42
+ Приклад файлу `comito_config.yml`:
43
+ ```yaml
44
+ types:
45
+ feat: "Нова функція"
46
+
47
+ scopes:
48
+ ruby: "Ruby код"
49
+
50
+ confirm_commit_message: false
32
51
  ```
33
52
 
34
- Після запуску ти отримаєш послідовність запитань для формування commit message, а потім можеш підтвердити і зробити коміт.
53
+ ### Як працює `comito_config`:
54
+
55
+ - Шукається файл `comito_config.yml` у поточній директорії (`Dir.pwd`).
56
+ - Якщо файл існує, налаштування беруться з нього.
57
+ - Якщо файл не знайдено, використовуються значення за замовчуванням.
58
+
59
+ ## Приклад
60
+
61
+ <img src="images/comito_result.png" alt="Example" style="width:400px;">
35
62
 
36
- ## Usage
63
+ ## Ліцензія
37
64
 
38
65
  Apache-2.0
data/comito.gemspec CHANGED
@@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
40
40
 
41
41
  # Uncomment to register a new dependency of your gem
42
42
  # spec.add_dependency "example-gem", "~> 1.0"
43
- spec.add_runtime_dependency "cli-ui", "~> 2.4"
43
+ spec.add_dependency "tty-prompt", "~> 0.23"
44
44
 
45
45
  # For more information and examples about making a new gem, check out our
46
46
  # guide at: https://bundler.io/guides/creating_gem.html
Binary file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Comito
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/comito.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "comito/version"
4
- require "cli/ui"
4
+ require "tty-prompt"
5
5
 
6
6
  module Comito
7
7
  class DoCommit
@@ -63,25 +63,21 @@ module Comito
63
63
  return
64
64
  end
65
65
 
66
- CLI::UI::StdoutRouter.enable
67
- type = nil
66
+ prompt = TTY::Prompt.new
68
67
 
69
- CLI::UI::Prompt.ask("#{YELLOW}Select commit type:#{RESET}") do |handler|
70
- types.each do |type_key, type_desc|
71
- handler.option("#{GREEN}#{type_key} — #{type_desc}#{RESET}") { type = type_key }
68
+ type = prompt.select("#{YELLOW}Select commit type:#{RESET}") do |menu|
69
+ types.each do |key, desc|
70
+ menu.choice("#{GREEN}#{key} — #{desc}#{RESET}", key)
72
71
  end
73
72
  end
74
73
 
75
- scope = nil
76
-
77
- CLI::UI::Prompt.ask("#{YELLOW}Select scope:#{RESET}") do |handler|
78
- scopes.each do |scope_key, scope_desc|
79
- handler.option("#{GREEN}#{scope_key} — #{scope_desc}#{RESET}") { scope = scope_key }
74
+ scope = prompt.select("#{YELLOW}Select scope:#{RESET}") do |menu|
75
+ scopes.each do |key, desc|
76
+ menu.choice("#{GREEN}#{key} — #{desc}#{RESET}", key)
80
77
  end
81
78
  end
82
79
 
83
- print "#{YELLOW}Your commit message: #{RESET}"
84
- message = gets.strip
80
+ message = prompt.ask("#{YELLOW}Your commit message:#{RESET}", default: "")
85
81
 
86
82
  commit_msg = "#{type}#{scope.to_s.empty? ? '' : "(#{scope})"}: #{message}"
87
83
 
@@ -98,11 +94,7 @@ module Comito
98
94
  confirm = true
99
95
 
100
96
  if confirn_commit_message
101
- CLI::UI::Prompt.ask("#{YELLOW}\nCommit with this message?#{RESET}") do |handler|
102
- %w[yes no].each do |confirm_key, confirm_desc|
103
- handler.option("#{GREEN}#{confirm_key}#{RESET}") { confirm = (confirm_key == 'yes') }
104
- end
105
- end
97
+ confirm = prompt.yes?("#{YELLOW}Commit with this message?#{RESET}")
106
98
  end
107
99
 
108
100
  if confirm
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comito
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmytro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-08-16 00:00:00.000000000 Z
11
+ date: 2025-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: cli-ui
14
+ name: tty-prompt
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.4'
19
+ version: '0.23'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.4'
26
+ version: '0.23'
27
27
  description: |
28
28
  Comito is a lightweight and easy-to-use Ruby CLI tool that provides an interactive interface for generating commit messages
29
29
  following the Conventional Commits specification. It is designed primarily for Ruby and Rails developers who want to standardize
@@ -47,6 +47,7 @@ files:
47
47
  - Rakefile
48
48
  - comito.gemspec
49
49
  - exe/comito
50
+ - images/comito_result.png
50
51
  - lib/comito.rb
51
52
  - lib/comito/version.rb
52
53
  - sig/comito.rbs
@@ -73,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
74
  - !ruby/object:Gem::Version
74
75
  version: '0'
75
76
  requirements: []
76
- rubygems_version: 3.4.10
77
+ rubygems_version: 3.5.9
77
78
  signing_key:
78
79
  specification_version: 4
79
80
  summary: Interactive CLI for generating Conventional Commits messages in Ruby projects.