convenlu 0.5.0 → 0.5.2
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 +4 -4
- data/lib/convenlu/convention_file.rb +17 -0
- data/lib/convenlu/prompt.rb +2 -2
- data/lib/convenlu/reader.rb +6 -14
- data/lib/convenlu/rules.json +4 -0
- data/lib/convenlu/standard.rb +21 -0
- data/lib/convenlu/version.rb +1 -1
- metadata +16 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11357b013a4c0b032931f58a1a0be63da582a1f7ead55594c17de8faa73edd6f
|
4
|
+
data.tar.gz: c9b21a32741c27ef875163481010a62ca6fa81bd9d3a7b53e3e10d5636130263
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e28abeacba3873881614569d570393397299609fe0f0a6911be4dcbc008a4a79c5921c03a6004e302274bcf57d9f041e2d3cbeae5b54067ed93ab40b8a2490d
|
7
|
+
data.tar.gz: 351e89f5264f95b984edba7ef9dad33e22c2cbedca37e584b9455b342589b30fa13e2d3d1298a54bd347aa7d591f307e7230cd22b447eafa082a0d59bf650373
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'convenlu/version'
|
4
|
+
|
5
|
+
module Convenlu
|
6
|
+
class ConventionFile
|
7
|
+
def self.path(json_file)
|
8
|
+
development_path = File.join(Dir.pwd, 'lib', 'convenlu', json_file)
|
9
|
+
if Dir.pwd.split('/')[-1] == 'convenlu' || File.exist?(development_path)
|
10
|
+
development_path
|
11
|
+
else
|
12
|
+
File.join(Gem.dir, 'gems', "convenlu-#{Convenlu::VERSION}", 'lib', 'convenlu',
|
13
|
+
json_file)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/convenlu/prompt.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'tty-prompt'
|
4
|
-
require 'convenlu/reader'
|
5
4
|
require 'convenlu/repository'
|
5
|
+
require 'convenlu/standard'
|
6
6
|
|
7
7
|
module Convenlu
|
8
8
|
class Prompt
|
@@ -11,7 +11,7 @@ module Convenlu
|
|
11
11
|
commit = prompt.collect do
|
12
12
|
response_scope = prompt.yes?('do you want to add a scope?', default: false)
|
13
13
|
key(:scope).ask('enter the commit scope') if response_scope
|
14
|
-
key(:type).select('select the commit type',
|
14
|
+
key(:type).select('select the commit type', Standard.commit_types)
|
15
15
|
key(:title).ask('write a short title', required: true)
|
16
16
|
key(:description).ask('provide a longer description', required: true)
|
17
17
|
response_footer = prompt.yes?('do you want to add a footer?', default: false)
|
data/lib/convenlu/reader.rb
CHANGED
@@ -1,23 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'json'
|
4
|
-
require_relative 'version'
|
5
4
|
|
6
5
|
module Convenlu
|
7
6
|
class Reader
|
8
|
-
def self.
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
'convention.json')
|
15
|
-
file = File.read(convention_absolute_path)
|
16
|
-
end
|
17
|
-
convention = JSON.parse(file)
|
18
|
-
convention.map do |type|
|
19
|
-
"#{type.keys.join}: #{type.values.join}"
|
20
|
-
end
|
7
|
+
def self.read_file(path)
|
8
|
+
File.read(path)
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.read_json(file)
|
12
|
+
JSON.parse(file)
|
21
13
|
end
|
22
14
|
end
|
23
15
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'convenlu/convention_file'
|
4
|
+
require 'convenlu/reader'
|
5
|
+
|
6
|
+
module Convenlu
|
7
|
+
class Standard
|
8
|
+
def self.commit_types
|
9
|
+
commit_types_file = Reader.read_file(ConventionFile.path('convention.json'))
|
10
|
+
convention = Reader.read_json(commit_types_file)
|
11
|
+
convention.map do |type|
|
12
|
+
"#{type.keys.join}: #{type.values.join}"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.rules
|
17
|
+
rules_file = Reader.read_file(ConventionFile.path('rules.json'))
|
18
|
+
Reader.read_json(rules_file)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/convenlu/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: convenlu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- julio cabrera
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.2.33
|
20
20
|
type: :development
|
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:
|
26
|
+
version: 2.2.33
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,28 +58,28 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.19.1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.19.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: tty-prompt
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.23.
|
75
|
+
version: 0.23.1
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.23.
|
82
|
+
version: 0.23.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: tty-spinner
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,19 +107,22 @@ files:
|
|
107
107
|
- bin/setup
|
108
108
|
- lib/convenlu.rb
|
109
109
|
- lib/convenlu/convention.json
|
110
|
+
- lib/convenlu/convention_file.rb
|
110
111
|
- lib/convenlu/format.rb
|
111
112
|
- lib/convenlu/interface.rb
|
112
113
|
- lib/convenlu/prompt.rb
|
113
114
|
- lib/convenlu/reader.rb
|
114
115
|
- lib/convenlu/repository.rb
|
116
|
+
- lib/convenlu/rules.json
|
115
117
|
- lib/convenlu/spinner.rb
|
118
|
+
- lib/convenlu/standard.rb
|
116
119
|
- lib/convenlu/version.rb
|
117
120
|
homepage: https://github.com/juliocabrera820/convenlu
|
118
121
|
licenses:
|
119
122
|
- MIT
|
120
123
|
metadata:
|
121
124
|
source_code_uri: https://github.com/juliocabrera820/convenlu
|
122
|
-
post_install_message:
|
125
|
+
post_install_message:
|
123
126
|
rdoc_options: []
|
124
127
|
require_paths:
|
125
128
|
- lib
|
@@ -127,15 +130,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
130
|
requirements:
|
128
131
|
- - ">="
|
129
132
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
133
|
+
version: 3.0.6
|
131
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
135
|
requirements:
|
133
136
|
- - ">="
|
134
137
|
- !ruby/object:Gem::Version
|
135
138
|
version: '0'
|
136
139
|
requirements: []
|
137
|
-
rubygems_version: 3.
|
138
|
-
signing_key:
|
140
|
+
rubygems_version: 3.2.33
|
141
|
+
signing_key:
|
139
142
|
specification_version: 4
|
140
143
|
summary: A ruby gem that helps to write conventional commits
|
141
144
|
test_files: []
|