gitt 1.1.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67fb49f7ebd543d63e48b98ecb8f029d8e7f0c2b432658a183832601b5cb215e
4
- data.tar.gz: 4965f486ade08bbd43377aaac03ecab487dddfaac6fb87d8f371298562e7162a
3
+ metadata.gz: c62b336c059bf040e1402ebb4f6ac8ebc3bccd73c88374107309aba415f3498d
4
+ data.tar.gz: 3c10aab04d441c1fe43f9713df9dc8cd7a2c5aa17cd1527bf59565fa38be2978
5
5
  SHA512:
6
- metadata.gz: d8fbbb7d74f006bb38459dbd2945e5aa7df742940dda9956ea0fe3dac2d264ec4180e082714df8af6e4cfa85bcc92077381e5902893d10b3283cd94b18a7fccf
7
- data.tar.gz: 25c53ca9387f38f8a77fd51572174024a0df6272bb8ddffad0686c819defeaca223dec2479a2381e16c92fcc3e23d137793801e55918ef0684fbcb61cbf739e0
6
+ metadata.gz: 827cc90c8d331de050a46f1f84a702aaf02271b11a587a9eb0bc3fd360bafe88ede43e4300113dfec8aaab7215d1045588a2121c5dc9e8748e34d83ad1acc821
7
+ data.tar.gz: a440ca56f42594cfa6cd0e4ea82e5c203e99893e9591458a28f34367cc6c595a54c171cb9de9f246fcd4467e6ea146fd55b0194e0035d2ceda61d598e07ed0f2
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -182,11 +182,11 @@ In order to have access to rich data from the Git client, there are several mode
182
182
 
183
183
  ==== Commit
184
184
 
185
- An instance of `Gitt::Commits::Model` is what is answered back to when using `Gitt::Repository` via the `#commits` or `#uncommitted` methods. In each case, you'll either get an array of records, a single record, or a failure depending on the result. Here's an example of a single record:
185
+ An instance of `Gitt::Models::Commit` is what is answered back to when using `Gitt::Repository` via the `#commits` or `#uncommitted` methods. In each case, you'll either get an array of records, a single record, or a failure depending on the result. Here's an example of a single record:
186
186
 
187
187
  [source,ruby]
188
188
  ----
189
- # #<struct Gitt::Commits::Model
189
+ # #<struct Gitt::Models::Commit
190
190
  # author_date_relative="2 days ago",
191
191
  # author_email="demo@example.com",
192
192
  # author_name="Demo User",
@@ -211,20 +211,20 @@ You get a {struct_link} with the following attributes:
211
211
  * `message`: Stores the entire, raw, commit message (i.e. subject and body).
212
212
  * `sha`: Stores the commit SHA.
213
213
  * `subject`: Stores the commit subject.
214
- * `trailers`: Stores any commit trailers as an array of `GtiPlus::Trailers::Model` records.
214
+ * `trailers`: Stores any commit trailers as an array of `Gitt::Models::Trailer` records.
215
215
  * `trailers_index`: Stores the starting index of trailers within the commit message.
216
216
 
217
217
  ==== Tag
218
218
 
219
- An instance of `Gitt::Tags::Model` is what is answered back to when using `Gitt::Repository` via the `#tag_parse` method. Here's an example:
219
+ An instance of `Gitt::Models::Tag` is what is answered back to when using `Gitt::Repository` via the `#tag_parse` method. Here's an example:
220
220
 
221
221
  [source,ruby]
222
222
  ----
223
- # #<struct Gitt::Tags::Model
223
+ # #<struct Gitt::Models::Tag
224
224
  # author_date="Tue Dec 29 17:33:01 2020 -0700",
225
225
  # author_email="demo@example.com",
226
226
  # author_name="Demo User",
227
- # body="- Added gem skeleton\n- Added RSpec dependnecy",
227
+ # body="- Added gem skeleton\n- Added RSpec dependency",
228
228
  # sha="d041d07c29f97b5b06b3b2fd05fa1dd018c7da7c",
229
229
  # subject="Version 0.1.0",
230
230
  # version="0.1.0">
@@ -246,7 +246,7 @@ A trailer is nested within a commit record when trailer information exists. Exam
246
246
 
247
247
  [source,ruby]
248
248
  ----
249
- #<struct Gitt::Commits::Trailers::Model key="Issue", delimiter=":", space=" ", value="123">
249
+ #<struct Gitt::Models::Trailer key="Issue", delimiter=":", space=" ", value="123">
250
250
  ----
251
251
 
252
252
  The attributes break down as follows:
@@ -258,15 +258,15 @@ The attributes break down as follows:
258
258
 
259
259
  === RSpec
260
260
 
261
- For fans of {rspec_link}, this gem provides shared contexts you can use within your own test suites. These shared contexts are _optional_ and must be manually required to use.
261
+ For fans of {rspec_link}, this gem provides shared contexts you can use within your own test suites. These shared contexts are _optional_, not required for you by default, and must be manually required to use.
262
262
 
263
263
  ==== Git Commit
264
264
 
265
- Provides a default `git_commit` record of `Gitt::Commits::Model` with minimal information for testing purposes and can be used as follows:
265
+ Provides a default `git_commit` record of `Gitt::Models::Commit` with minimal information for testing purposes and can be used as follows:
266
266
 
267
267
  [source,ruby]
268
268
  ----
269
- require "gitt/shared_contexts/git_commit"
269
+ require "gitt/rspec/shared_contexts/git_commit"
270
270
 
271
271
  describe Demo do
272
272
  include_context "with Git commit"
@@ -279,8 +279,8 @@ Provides a simple Git repository with a single commit for testing purposes. This
279
279
 
280
280
  [source,ruby]
281
281
  ----
282
- require "gitt/shared_contexts/git_repo"
283
- require "refinemenets/pathnames"
282
+ require "gitt/rspec/shared_contexts/git_repo"
283
+ require "refinements/pathnames"
284
284
 
285
285
  describe Demo do
286
286
  include_context "with Git repository"
@@ -299,8 +299,8 @@ Provides a temporary directory (i.e. `tmp/rspec`) for creating directories and o
299
299
 
300
300
  [source,ruby]
301
301
  ----
302
- require "gitt/shared_contexts/temp_dir"
303
- require "refinemenets/pathnames"
302
+ require "gitt/rspec/shared_contexts/temp_dir"
303
+ require "refinements/pathnames"
304
304
 
305
305
  describe Demo do
306
306
  include_context "with temporary directory"
data/gitt.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "gitt"
5
- spec.version = "1.1.3"
5
+ spec.version = "2.0.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/gitt"
9
- spec.summary = "Provides a monadic Object API wrapper around the Git CLI."
9
+ spec.summary = "A monadic Object API for the Git CLI."
10
10
  spec.license = "Hippocratic-2.1"
11
11
 
12
12
  spec.metadata = {
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.required_ruby_version = "~> 3.2"
26
26
  spec.add_dependency "core", "~> 0.1"
27
27
  spec.add_dependency "dry-monads", "~> 1.6"
28
- spec.add_dependency "refinements", "~> 10.0"
28
+ spec.add_dependency "refinements", "~> 11.0"
29
29
  spec.add_dependency "zeitwerk", "~> 2.6"
30
30
 
31
31
  spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
@@ -20,10 +20,9 @@ module Gitt
20
20
  :sha,
21
21
  :signature,
22
22
  :subject,
23
- :trailers,
24
- keyword_init: true
23
+ :trailers
25
24
  ) do
26
- def initialize *arguments
25
+ def initialize(**)
27
26
  super
28
27
  freeze
29
28
  end
@@ -3,10 +3,10 @@
3
3
  module Gitt
4
4
  module Models
5
5
  # Represents a person within a repository.
6
- Person = Struct.new :name, :delimiter, :email, keyword_init: true do
6
+ Person = Struct.new :name, :delimiter, :email do
7
7
  def self.for(string, parser: Parsers::Person.new) = parser.call string
8
8
 
9
- def initialize *arguments
9
+ def initialize(**)
10
10
  super
11
11
  freeze
12
12
  end
@@ -15,10 +15,9 @@ module Gitt
15
15
  :committer_name,
16
16
  :sha,
17
17
  :subject,
18
- :version,
19
- keyword_init: true
18
+ :version
20
19
  ) do
21
- def initialize *arguments
20
+ def initialize(**)
22
21
  super
23
22
  freeze
24
23
  end
@@ -6,7 +6,7 @@ module Gitt
6
6
  Trailer = Struct.new :key, :delimiter, :space, :value, keyword_init: true do
7
7
  def self.for(string, parser: Parsers::Trailer.new) = parser.call string
8
8
 
9
- def initialize *arguments
9
+ def initialize(**)
10
10
  super
11
11
  freeze
12
12
  end
@@ -21,7 +21,7 @@ module Gitt
21
21
  def call content
22
22
  attributer.call(content)
23
23
  .then { |attributes| process attributes }
24
- .then { |attributes| model[attributes] }
24
+ .then { |attributes| model[**attributes] }
25
25
  end
26
26
 
27
27
  private
@@ -17,7 +17,7 @@ module Gitt
17
17
  @model = model
18
18
  end
19
19
 
20
- def call(content) = model[content.match(pattern).named_captures]
20
+ def call(content) = model[**content.match(pattern).named_captures]
21
21
 
22
22
  private
23
23
 
@@ -23,7 +23,7 @@ module Gitt
23
23
  committed_at: date_sanitizer,
24
24
  committer_email: email_sanitizer,
25
25
  version: -> value { value.delete_prefix "refs/tags/" if value }
26
- model[attributes]
26
+ model[**attributes]
27
27
  end
28
28
 
29
29
  private
@@ -20,7 +20,7 @@ module Gitt
20
20
  def call content
21
21
  content.match(pattern)
22
22
  .then { |data| data ? data.named_captures : {} }
23
- .then { |attributes| model[attributes] }
23
+ .then { |attributes| model[**attributes] }
24
24
  end
25
25
 
26
26
  private
@@ -7,10 +7,13 @@ RSpec.shared_context "with Git commit" do
7
7
  author_name: "Test User",
8
8
  authored_relative_at: "1 day ago",
9
9
  body: "",
10
+ body_lines: [],
11
+ body_paragraphs: [],
12
+ lines: [],
10
13
  raw: "",
11
14
  sha: "180dec7d8ae8cbe3565a727c63c2111e49e0b737",
12
15
  subject: "Added documentation",
13
- trailers: ""
16
+ trailers: []
14
17
  ]
15
18
  end
16
19
  end
data/lib/gitt.rb CHANGED
@@ -4,7 +4,7 @@ require "zeitwerk"
4
4
 
5
5
  Zeitwerk::Loader.for_gem.then do |loader|
6
6
  loader.inflector.inflect "container" => "CONTAINER"
7
- loader.ignore "#{__dir__}/gitt/shared_contexts"
7
+ loader.ignore "#{__dir__}/gitt/rspec/shared_contexts"
8
8
  loader.setup
9
9
  end
10
10
 
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: 1.1.3
4
+ version: 2.0.0
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: 2023-04-30 00:00:00.000000000 Z
38
+ date: 2023-06-13 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: core
@@ -71,14 +71,14 @@ dependencies:
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '10.0'
74
+ version: '11.0'
75
75
  type: :runtime
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '10.0'
81
+ version: '11.0'
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: zeitwerk
84
84
  requirement: !ruby/object:Gem::Requirement
@@ -120,6 +120,9 @@ files:
120
120
  - lib/gitt/parsers/tag.rb
121
121
  - lib/gitt/parsers/trailer.rb
122
122
  - lib/gitt/repository.rb
123
+ - lib/gitt/rspec/shared_contexts/git_commit.rb
124
+ - lib/gitt/rspec/shared_contexts/git_repo.rb
125
+ - lib/gitt/rspec/shared_contexts/temp_dir.rb
123
126
  - lib/gitt/sanitizers/container.rb
124
127
  - lib/gitt/sanitizers/date.rb
125
128
  - lib/gitt/sanitizers/email.rb
@@ -128,9 +131,6 @@ files:
128
131
  - lib/gitt/sanitizers/scissors.rb
129
132
  - lib/gitt/sanitizers/signature.rb
130
133
  - lib/gitt/sanitizers/trailers.rb
131
- - lib/gitt/shared_contexts/git_commit.rb
132
- - lib/gitt/shared_contexts/git_repo.rb
133
- - lib/gitt/shared_contexts/temp_dir.rb
134
134
  - lib/gitt/shell.rb
135
135
  homepage: https://alchemists.io/projects/gitt
136
136
  licenses:
@@ -158,8 +158,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubygems_version: 3.4.12
161
+ rubygems_version: 3.4.14
162
162
  signing_key:
163
163
  specification_version: 4
164
- summary: Provides a monadic Object API wrapper around the Git CLI.
164
+ summary: A monadic Object API for the Git CLI.
165
165
  test_files: []
metadata.gz.sig CHANGED
Binary file