gitt 2.1.0 → 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 +2 -2
- data/lib/gitt/commands/branch.rb +7 -2
- data/lib/gitt/repository.rb +1 -1
- data/lib/gitt.rb +4 -1
- data.tar.gz.sig +0 -0
- metadata +7 -4
- 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
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "gitt"
|
5
|
-
spec.version = "2.
|
5
|
+
spec.version = "2.2.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://alchemists.io/projects/gitt"
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.signing_key = Gem.default_key_path
|
23
23
|
spec.cert_chain = [Gem.default_cert_path]
|
24
24
|
|
25
|
-
spec.required_ruby_version = "
|
25
|
+
spec.required_ruby_version = [">= 3.2", "<= 3.3"]
|
26
26
|
spec.add_dependency "core", "~> 0.1"
|
27
27
|
spec.add_dependency "dry-monads", "~> 1.6"
|
28
28
|
spec.add_dependency "refinements", "~> 11.0"
|
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/lib/gitt.rb
CHANGED
@@ -4,6 +4,7 @@ require "zeitwerk"
|
|
4
4
|
|
5
5
|
Zeitwerk::Loader.new.then do |loader|
|
6
6
|
loader.inflector.inflect "container" => "CONTAINER"
|
7
|
+
loader.ignore "#{__dir__}/gitt/rspec/shared_contexts"
|
7
8
|
loader.tag = File.basename __FILE__, ".rb"
|
8
9
|
loader.push_dir __dir__
|
9
10
|
loader.setup
|
@@ -13,5 +14,7 @@ end
|
|
13
14
|
module Gitt
|
14
15
|
SHELL = Shell.new.freeze
|
15
16
|
|
16
|
-
def self.loader
|
17
|
+
def self.loader registry = Zeitwerk::Registry
|
18
|
+
@loader ||= registry.loaders.find { |loader| loader.tag == File.basename(__FILE__, ".rb") }
|
19
|
+
end
|
17
20
|
end
|
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
|
@@ -149,16 +149,19 @@ require_paths:
|
|
149
149
|
- lib
|
150
150
|
required_ruby_version: !ruby/object:Gem::Requirement
|
151
151
|
requirements:
|
152
|
-
- - "
|
152
|
+
- - ">="
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: '3.2'
|
155
|
+
- - "<="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '3.3'
|
155
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
159
|
requirements:
|
157
160
|
- - ">="
|
158
161
|
- !ruby/object:Gem::Version
|
159
162
|
version: '0'
|
160
163
|
requirements: []
|
161
|
-
rubygems_version: 3.
|
164
|
+
rubygems_version: 3.5.1
|
162
165
|
signing_key:
|
163
166
|
specification_version: 4
|
164
167
|
summary: A monadic Object API for the Git CLI.
|
metadata.gz.sig
CHANGED
Binary file
|