gitt 2.1.1 → 2.2.0
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 +5 -2
- data/gitt.gemspec +1 -1
- data/lib/gitt/commands/branch.rb +7 -2
- data/lib/gitt/repository.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- 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: 9d018179bb1dc92195b5e119f089d1f9d5795f00c7eac06ddc3a6806bc6958ae
|
4
|
+
data.tar.gz: 77049ca6ffc901a71e9f086039fce8ac533a4bb5c47e18e82a5d5cc28b58de74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2727cb42a39b9c8a9ca07cb6c4e73303ed39d5257d251b5aa06054c391ced4c02d08a08c64b643adae1e05bd6a9ec1a9e3595774426d83076864fd01d90fab22
|
7
|
+
data.tar.gz: 21d96e647cd32ca25b7d4d2ebbbffac4f7c086d8649344b43f72a556f23f3037afc9ccf706d4aff750120055c8f98c7ff72111a07f58e9bdba9abf76c28b994d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -75,7 +75,7 @@ git.uncommitted # Parses a file and answers an unsaved commit message.
|
|
75
75
|
=== Commands
|
76
76
|
|
77
77
|
Should you want to use individual commands instead of interacting with the `Repository` object, you
|
78
|
-
can leverage any of the objects in the `Commands` namespace which -- at a minimum -- use the link:https://alchemists.io/articles/interactor_pattern[Command Pattern]. Here are the
|
78
|
+
can leverage any of the objects in the `Commands` namespace which -- at a minimum -- use the link:https://alchemists.io/articles/interactor_pattern[Command Pattern]. Here are the specific commands which are enhanced further:
|
79
79
|
|
80
80
|
==== link:https://git-scm.com/docs/git-branch[Branch]
|
81
81
|
|
@@ -85,9 +85,12 @@ Handles branches.
|
|
85
85
|
----
|
86
86
|
branch = Gitt::Commands::Branch.new
|
87
87
|
|
88
|
-
# Answers branch default (via Git `init.defaultBranch` configuration).
|
88
|
+
# Answers branch default (via Git `init.defaultBranch` configuration) of if blank.
|
89
89
|
branch.default # Success "main"
|
90
90
|
|
91
|
+
# Answers branch default fallback if unset or error is detected.
|
92
|
+
branch.default "source" # Success "source"
|
93
|
+
|
91
94
|
# Accepts any argument you'd send to `git branch`. Example:
|
92
95
|
branch.call "--list" # Success " main\n"
|
93
96
|
|
data/gitt.gemspec
CHANGED
data/lib/gitt/commands/branch.rb
CHANGED
@@ -1,17 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "dry/monads"
|
4
|
+
|
3
5
|
module Gitt
|
4
6
|
module Commands
|
5
7
|
# A Git branch command wrapper.
|
6
8
|
class Branch
|
9
|
+
include Dry::Monads[:result]
|
10
|
+
|
7
11
|
def initialize shell: SHELL
|
8
12
|
@shell = shell
|
9
13
|
end
|
10
14
|
|
11
|
-
def default
|
15
|
+
def default fallback = "main"
|
12
16
|
shell.call("config", "init.defaultBranch")
|
13
17
|
.fmap(&:chomp)
|
14
|
-
.fmap { |name| name.empty? ?
|
18
|
+
.fmap { |name| name.empty? ? fallback : name }
|
19
|
+
.or(Success(fallback))
|
15
20
|
end
|
16
21
|
|
17
22
|
def call(*arguments) = shell.call "branch", *arguments
|
data/lib/gitt/repository.rb
CHANGED
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: 2.
|
4
|
+
version: 2.2.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-
|
38
|
+
date: 2023-12-21 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: core
|
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
requirements: []
|
164
|
-
rubygems_version: 3.
|
164
|
+
rubygems_version: 3.5.1
|
165
165
|
signing_key:
|
166
166
|
specification_version: 4
|
167
167
|
summary: A monadic Object API for the Git CLI.
|
metadata.gz.sig
CHANGED
Binary file
|