gitt 1.0.0 → 1.1.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 +1 -1
- data/gitt.gemspec +2 -1
- data/lib/gitt/commands/config.rb +3 -2
- data/lib/gitt/commands/tag.rb +7 -4
- data/lib/gitt/parsers/attributer.rb +3 -1
- data/lib/gitt/repository.rb +3 -1
- data/lib/gitt/sanitizers/lines.rb +3 -1
- data/lib/gitt/sanitizers/paragraphs.rb +3 -1
- data/lib/gitt.rb +0 -2
- data.tar.gz.sig +0 -0
- metadata +17 -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: 355af33d53785042a41cebfff2988d6fc2bb5150de230c435ec67d6094945bbb
|
4
|
+
data.tar.gz: 93e27181cda7aca4adb2c640670ca7e2edf0a9cf6bb38e30826a76d22b27b6af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e65a21b3739fc262128a04fa96edaa9540630e267e693521873cce0fa23096b9a9acd93067c822af7cc25045f69030feed4621d38624ad24ef4348e9085c8a2e
|
7
|
+
data.tar.gz: 578a0c2b5e75aa1470f8a2bc8fe48e225c849fc1d82ee3857f0a0699dc95f0e8077b7dc3fead263fc52f50705b544a801abcd28be7905482bf4519268f538905
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
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 = "1.
|
5
|
+
spec.version = "1.1.1"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://www.alchemists.io/projects/gitt"
|
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.cert_chain = [Gem.default_cert_path]
|
24
24
|
|
25
25
|
spec.required_ruby_version = "~> 3.2"
|
26
|
+
spec.add_dependency "core", "~> 0.1"
|
26
27
|
spec.add_dependency "dry-monads", "~> 1.6"
|
27
28
|
spec.add_dependency "refinements", "~> 10.0"
|
28
29
|
spec.add_dependency "zeitwerk", "~> 2.6"
|
data/lib/gitt/commands/config.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "core"
|
3
4
|
require "dry/monads"
|
4
5
|
|
5
6
|
module Gitt
|
@@ -14,14 +15,14 @@ module Gitt
|
|
14
15
|
|
15
16
|
def call(*arguments) = shell.call "config", *arguments
|
16
17
|
|
17
|
-
def get key, fallback =
|
18
|
+
def get key, fallback = Core::EMPTY_STRING, *arguments
|
18
19
|
call(*arguments, "--get", key).fmap(&:chomp)
|
19
20
|
.or do |error|
|
20
21
|
block_given? ? yield(error) : Success(fallback)
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
24
|
-
def origin? = !get("remote.origin.url").value_or(EMPTY_STRING).empty?
|
25
|
+
def origin? = !get("remote.origin.url").value_or(Core::EMPTY_STRING).empty?
|
25
26
|
|
26
27
|
def set(key, value, *arguments) = call(*arguments, "--add", key, value).fmap { value }
|
27
28
|
|
data/lib/gitt/commands/tag.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "core"
|
3
4
|
require "dry/monads"
|
4
5
|
require "tempfile"
|
5
6
|
|
@@ -32,7 +33,7 @@ module Gitt
|
|
32
33
|
|
33
34
|
def call(*arguments) = shell.call "tag", *arguments
|
34
35
|
|
35
|
-
def create version, body = EMPTY_STRING, *flags
|
36
|
+
def create version, body = Core::EMPTY_STRING, *flags
|
36
37
|
return Failure "Unable to create Git tag without version." unless version
|
37
38
|
return Failure "Tag exists: #{version}." if exist? version
|
38
39
|
|
@@ -57,13 +58,15 @@ module Gitt
|
|
57
58
|
.or { |error| Failure error.delete_prefix("fatal: ").chomp }
|
58
59
|
end
|
59
60
|
|
60
|
-
def local?
|
61
|
+
def local? version
|
62
|
+
call("--list", version).value_or(Core::EMPTY_STRING).match?(/\A#{version}\Z/)
|
63
|
+
end
|
61
64
|
|
62
65
|
def push = shell.call "push", "--tags"
|
63
66
|
|
64
67
|
def remote? version
|
65
68
|
shell.call("ls-remote", "--tags", "origin", version)
|
66
|
-
.value_or(EMPTY_STRING)
|
69
|
+
.value_or(Core::EMPTY_STRING)
|
67
70
|
.match?(%r(.+tags/#{version}\Z))
|
68
71
|
end
|
69
72
|
|
@@ -71,7 +74,7 @@ module Gitt
|
|
71
74
|
call(pretty_format, "--list", version).fmap { |content| parser.call content }
|
72
75
|
end
|
73
76
|
|
74
|
-
def tagged? = !call.value_or(EMPTY_STRING).empty?
|
77
|
+
def tagged? = !call.value_or(Core::EMPTY_STRING).empty?
|
75
78
|
|
76
79
|
private
|
77
80
|
|
@@ -1,12 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "core"
|
4
|
+
|
3
5
|
module Gitt
|
4
6
|
module Parsers
|
5
7
|
# Extracts attributes from XML formatted content.
|
6
8
|
class Attributer
|
7
9
|
def self.with(...) = new(...)
|
8
10
|
|
9
|
-
def initialize keys =
|
11
|
+
def initialize keys = Core::EMPTY_ARRAY
|
10
12
|
@keys = keys
|
11
13
|
end
|
12
14
|
|
data/lib/gitt/repository.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "core"
|
4
|
+
|
3
5
|
module Gitt
|
4
6
|
# Primary object/wrapper for processing all Git related commands.
|
5
7
|
# :reek:TooManyMethods
|
@@ -28,7 +30,7 @@ module Gitt
|
|
28
30
|
|
29
31
|
def config(...) = commands.fetch(__method__).call(...)
|
30
32
|
|
31
|
-
def exist? = shell.call("rev-parse", "--git-dir").value_or(EMPTY_STRING).chomp == ".git"
|
33
|
+
def exist? = shell.call("rev-parse", "--git-dir").value_or(Core::EMPTY_STRING).chomp == ".git"
|
32
34
|
|
33
35
|
def get(...) = commands.fetch(:config).get(...)
|
34
36
|
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "core"
|
4
|
+
|
3
5
|
module Gitt
|
4
6
|
module Sanitizers
|
5
|
-
Paragraphs = -> value { value ? value.split("\n\n").map(&:chomp) : EMPTY_ARRAY }
|
7
|
+
Paragraphs = -> value { value ? value.split("\n\n").map(&:chomp) : Core::EMPTY_ARRAY }
|
6
8
|
end
|
7
9
|
end
|
data/lib/gitt.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: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -28,8 +28,22 @@ cert_chain:
|
|
28
28
|
CxDe2+VuChj4I1nvIHdu+E6XoEVlanUPKmSg6nddhkKn2gC45Kyzh6FZqnzH/CRp
|
29
29
|
RFE=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date:
|
31
|
+
date: 2023-02-05 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: core
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0.1'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.1'
|
33
47
|
- !ruby/object:Gem::Dependency
|
34
48
|
name: dry-monads
|
35
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
151
|
- !ruby/object:Gem::Version
|
138
152
|
version: '0'
|
139
153
|
requirements: []
|
140
|
-
rubygems_version: 3.4.
|
154
|
+
rubygems_version: 3.4.6
|
141
155
|
signing_key:
|
142
156
|
specification_version: 4
|
143
157
|
summary: Provides a monadic Object API wrapper around the Git CLI.
|
metadata.gz.sig
CHANGED
Binary file
|