gitt 3.12.0 → 3.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +44 -39
- data/gitt.gemspec +1 -1
- data/lib/gitt/parsers/trailer.rb +6 -6
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8a913585ec3f75f2bc428694fda6a43f342b550918a3b2409fa5523176a9707
|
4
|
+
data.tar.gz: '086db7d84f350b57338cd3fe4a58e3c38be56f5ff87bd224f1605f58e72f2fd0'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76294d6e33121f2fbd3ffced34d24ec9f3e47b6c46657af258b7a4f9a890dd7552bc928580de359d5edb55cf8fcd105e584407a0e61139b2a98f7cf60767c61d
|
7
|
+
data.tar.gz: af0b637336f32521c586b7f572d85c673c8913e4d880305145e3f8edcfe2445d6b6cabcabb2865867e923d52e5ad348cede456cfa1bcc17d0b74b603f4097a30
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -8,13 +8,13 @@
|
|
8
8
|
|
9
9
|
= Gitt
|
10
10
|
|
11
|
-
Provides a monadic Object API
|
11
|
+
Provides a monadic Object API around the {git_link} CLI with full access to all functionality found when using Git natively. This includes convenience methods for answering fully parsed and enhanced commits, tags, trailers, and so forth. This project is an extraction of work originally implemented within the following projects:
|
12
12
|
|
13
13
|
* link:https://alchemists.io/projects/git-lint[Git Lint]
|
14
14
|
* link:https://alchemists.io/projects/milestoner[Milestoner]
|
15
15
|
* link:https://alchemists.io/projects/rubysmith[Rubysmith]
|
16
16
|
|
17
|
-
|
17
|
+
If you are looking for alternatives to this gem, then you might find the following of interest:
|
18
18
|
|
19
19
|
* link:https://github.com/ruby-git/ruby-git[Ruby Git]
|
20
20
|
* link:https://github.com/libgit2/rugged[Rugged]
|
@@ -24,7 +24,7 @@ toc::[]
|
|
24
24
|
== Features
|
25
25
|
|
26
26
|
* Wraps a subset of native {git_link} commands with additional enhancements to improve your working experience.
|
27
|
-
* Answers link:https://dry-rb.org/gems/dry-monads[monads] you can link:https://alchemists.io/
|
27
|
+
* Answers link:https://dry-rb.org/gems/dry-monads[monads] you can link:https://alchemists.io/articles/ruby_function_composition[pipe] together for more complex workflows.
|
28
28
|
* Provides _optional_ {rspec_link} shared contexts that speed up the testing of your own Git related implementations.
|
29
29
|
|
30
30
|
== Requirements
|
@@ -47,20 +47,22 @@ At a high level, this project provides a centralized Object API via a single obj
|
|
47
47
|
|
48
48
|
[source,ruby]
|
49
49
|
----
|
50
|
-
git = Gitt
|
50
|
+
git = Gitt.new
|
51
51
|
|
52
52
|
git.branch # Equivalent to `git branch <arguments>`.
|
53
53
|
git.branch_default # Answers default branch.
|
54
54
|
git.branch_name # Answers current branch.
|
55
55
|
git.call # Allows you to run any Git command.
|
56
|
-
git.commits # Answers commit records.
|
56
|
+
git.commits # Answers enhanced commit records.
|
57
57
|
git.config # Equivalent to `git config <arguments>`.
|
58
58
|
git.exist? # Answers if current directory is a Git repository or not.
|
59
59
|
git.get # Equivalent to `git config get`.
|
60
|
+
git.inspect # Allows you to inspect the current instance.
|
60
61
|
git.log # Equivalent to `git log <arguments>`.
|
61
62
|
git.origin? # Answers if repository has an origin or not.
|
62
63
|
git.set # Equivalent to `get config set`.
|
63
64
|
git.tag # Equivalent to `git tag <arguments>`.
|
65
|
+
git.tags # Answers enhanced tag records.
|
64
66
|
git.tag? # Answers if local or remote tag exists.
|
65
67
|
git.tag_create # Create a new tag.
|
66
68
|
git.tag_last # Answers last tag created.
|
@@ -68,16 +70,14 @@ git.tag_local? # Answers if local tag exists?
|
|
68
70
|
git.tag_remote? # Answers if remote tag exists?
|
69
71
|
git.tag_show # Answers information about a single tag.
|
70
72
|
git.tagged? # Answers if the repository has any tags.
|
71
|
-
git.tags # Answers all tags.
|
72
73
|
git.tags_push # Pushes local tags to remote git.
|
73
|
-
git.uncommitted # Parses
|
74
|
-
|
74
|
+
git.uncommitted # Parses `COMMIT_EDITMSG` file and answers the unsaved commit message.
|
75
75
|
----
|
76
76
|
|
77
77
|
=== Commands
|
78
78
|
|
79
|
-
Should you want to use individual commands instead of interacting with the `
|
80
|
-
can leverage any of the objects in the `Commands` namespace which -- at a minimum -- use the link:https://alchemists.io/articles/
|
79
|
+
Should you want to use individual commands instead of interacting with the `Gitt` object, you
|
80
|
+
can leverage any of the objects in the `Commands` namespace which -- at a minimum -- use the link:https://alchemists.io/articles/command_pattern[Command Pattern]. Here are the specific commands which are enhanced further:
|
81
81
|
|
82
82
|
==== link:https://git-scm.com/docs/git-branch[Branch]
|
83
83
|
|
@@ -148,7 +148,7 @@ The second, is:
|
|
148
148
|
commit log.uncommitted ".git/COMMIT_EDITMSG"
|
149
149
|
----
|
150
150
|
|
151
|
-
The above will answer a single commit record. This is great for building a commit object from an unsaved commit message. The only disadvantage
|
151
|
+
The above will answer a single commit record. This is great for building a commit object from an unsaved commit message. The only disadvantage to this approach is you will get template commits which are always stripped out by Git when processing a _saved_ commit.
|
152
152
|
|
153
153
|
==== link:https://git-scm.com/docs/git-tag[Tag]
|
154
154
|
|
@@ -168,6 +168,9 @@ tag.create "0.0.0", "Version 0.0.0"
|
|
168
168
|
# Answers true or false base on whether local and remote tag exist.
|
169
169
|
tag.exist? "0.1.0"
|
170
170
|
|
171
|
+
# Answers enhanced tag records. Can take any argument accepted with `--list`.
|
172
|
+
tag.index
|
173
|
+
|
171
174
|
# Answers last tag for git.
|
172
175
|
tag.last
|
173
176
|
|
@@ -197,30 +200,30 @@ An instance of `Gitt::Models::Commit` is what is answered back to when using `Gi
|
|
197
200
|
|
198
201
|
[source,ruby]
|
199
202
|
----
|
200
|
-
# #<Struct:Gitt::Models::Commit:
|
201
|
-
# author_email = "
|
203
|
+
# #<Struct:Gitt::Models::Commit:0x00015c70
|
204
|
+
# author_email = "brooke@alchemists.io",
|
202
205
|
# author_name = "Brooke Kuhlmann",
|
203
|
-
# authored_at = "
|
204
|
-
# authored_relative_at = "
|
206
|
+
# authored_at = "1731517717",
|
207
|
+
# authored_relative_at = "28 seconds ago",
|
205
208
|
# body = "",
|
206
209
|
# body_lines = [],
|
207
210
|
# body_paragraphs = [],
|
208
|
-
# committed_at = "
|
209
|
-
# committed_relative_at = "
|
210
|
-
# committer_email = "
|
211
|
+
# committed_at = "1731517717",
|
212
|
+
# committed_relative_at = "28 seconds ago",
|
213
|
+
# committer_email = "brooke@alchemists.io",
|
211
214
|
# committer_name = "Brooke Kuhlmann",
|
212
|
-
# deletions =
|
215
|
+
# deletions = 11,
|
213
216
|
# encoding = "",
|
214
|
-
# files_changed =
|
217
|
+
# files_changed = 1,
|
215
218
|
# fingerprint = "F2BC49BC4FFB9A48",
|
216
219
|
# fingerprint_key = "D1488588D2DEDF73E62F07A1F2BC49BC4FFB9A48",
|
217
|
-
# insertions =
|
220
|
+
# insertions = 14,
|
218
221
|
# lines = [
|
219
222
|
# "Added version release notes"
|
220
223
|
# ],
|
221
224
|
# notes = "",
|
222
225
|
# raw = "Added version release notes\n",
|
223
|
-
# sha = "
|
226
|
+
# sha = "0f1e2387ed89d6dab95af384096c95bc04b28e9b",
|
224
227
|
# signature = "Good",
|
225
228
|
# subject = "Added version release notes",
|
226
229
|
# trailers = []
|
@@ -241,7 +244,7 @@ You get a {struct_link} with the following attributes:
|
|
241
244
|
* `committer_email`: Stores the committer email.
|
242
245
|
* `committer_name`: Stores the committer name.
|
243
246
|
* `deletions`: Stores number of deleted lines.
|
244
|
-
* `encoding`: Stored encoding. Blank if UTF-8
|
247
|
+
* `encoding`: Stored encoding. Blank if UTF-8 and filled if otherwise.
|
245
248
|
* `files_changed`: Stores number of files changed.
|
246
249
|
* `fingerprint`: Stores the fingerprint used when creating a secure commit.
|
247
250
|
* `fingerprint_key`: Stores the fingerprint key used when creating a secure commit.
|
@@ -252,7 +255,7 @@ You get a {struct_link} with the following attributes:
|
|
252
255
|
* `sha`: Stores the commit SHA.
|
253
256
|
* `signature`: Stores the signature type and level of security.
|
254
257
|
* `subject`: Stores the commit subject.
|
255
|
-
* `trailers`: Stores
|
258
|
+
* `trailers`: Stores trailers as an array of `Gitt::Models::Trailer` records.
|
256
259
|
|
257
260
|
==== Tag
|
258
261
|
|
@@ -260,21 +263,22 @@ An instance of `Gitt::Models::Tag` is what is answered back to when using `Gitt`
|
|
260
263
|
|
261
264
|
[source,ruby]
|
262
265
|
----
|
263
|
-
#<Struct:Gitt::Models::Tag:
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
266
|
+
# #<Struct:Gitt::Models::Tag:0x0003a5c0
|
267
|
+
# author_email = "brooke@alchemists.io",
|
268
|
+
# author_name = "Brooke Kuhlmann",
|
269
|
+
# authored_at = "1671892451",
|
270
|
+
# authored_relative_at = "1 year, 11 months ago",
|
271
|
+
# body = "* Added Dry Monads gem - Brooke Kuhlmann\n\n-----BEGIN PGP SIGNATURE-----\n",
|
272
|
+
# committed_at = "1671997684",
|
273
|
+
# committed_relative_at = "1 year, 11 months ago",
|
274
|
+
# committer_email = "brooke@alchemists.io",
|
275
|
+
# committer_name = "Brooke Kuhlmann",
|
276
|
+
# sha = "662f32b2846c7bd4f153560478f035197f5279d5",
|
277
|
+
# signature = "-----BEGIN PGP SIGNATURE-----\n",
|
278
|
+
# subject = "Version 1.0.0",
|
279
|
+
# trailers = [],
|
280
|
+
# version = "1.0.0"
|
281
|
+
# >
|
278
282
|
----
|
279
283
|
|
280
284
|
You get a {struct_link} with the following attributes:
|
@@ -291,6 +295,7 @@ You get a {struct_link} with the following attributes:
|
|
291
295
|
* `sha`: Stores the commit SHA for which this tag labels
|
292
296
|
* `signature`: Stores the signature when the tag was securely created.
|
293
297
|
* `subject`: Stores the subject.
|
298
|
+
* `trailers`: Stores trailers as an array of `Gitt::Models::Trailer` records.
|
294
299
|
* `version`: Stores the version.
|
295
300
|
|
296
301
|
==== Trailer
|
data/gitt.gemspec
CHANGED
data/lib/gitt/parsers/trailer.rb
CHANGED
@@ -5,12 +5,12 @@ module Gitt
|
|
5
5
|
# Parses raw trailer data to produce a trailer record.
|
6
6
|
class Trailer
|
7
7
|
PATTERN = /
|
8
|
-
\A
|
9
|
-
(?<key
|
10
|
-
(?<delimiter>:)
|
11
|
-
(?<space>\s?)
|
12
|
-
(?<value>.*?)
|
13
|
-
\Z
|
8
|
+
\A # Start of line.
|
9
|
+
(?<key>[a-zA-Z\-]+) # Key.
|
10
|
+
(?<delimiter>:) # Delimiter (colon).
|
11
|
+
(?<space>\s?) # Space (optional).
|
12
|
+
(?<value>.*?) # Value.
|
13
|
+
\Z # End of line.
|
14
14
|
/x
|
15
15
|
|
16
16
|
EMPTY = Models::Trailer[key: nil, value: nil]
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.12.
|
4
|
+
version: 3.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
|
36
36
|
gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2024-11-
|
38
|
+
date: 2024-11-13 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: core
|
metadata.gz.sig
CHANGED
Binary file
|