spoom 1.1.14 → 1.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spoom/context.rb +12 -0
- data/lib/spoom/git.rb +3 -3
- data/lib/spoom/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a61ae83fa56b7a78027c8954c5680d4784c5a3f8b2d717ed3ba49b36409ede2
|
4
|
+
data.tar.gz: b339a398e57f92f71b797dd8d427e18749d1afd6246be42fe549baf96563706e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 981c7b625e31b732ce731c600fd1291afb9635818918d77424750ba152633f06e8f4515037c5044badcc951ded1dd9fd768ae135ff2305359005a2cb7ad47a38
|
7
|
+
data.tar.gz: 123baadb32b3341271b323eab29a1ddb4561c74b9afbe6cfa71af61ff1547783a24a1d439406f482b3c40920b960e4b04fc19ca7c0423c18407af00bc35fa692
|
data/lib/spoom/context.rb
CHANGED
@@ -46,6 +46,12 @@ module Spoom
|
|
46
46
|
|
47
47
|
# File System
|
48
48
|
|
49
|
+
# Does the context directory at `absolute_path` exist and is a directory?
|
50
|
+
sig { returns(T::Boolean) }
|
51
|
+
def exist?
|
52
|
+
File.directory?(@absolute_path)
|
53
|
+
end
|
54
|
+
|
49
55
|
# Create the context directory at `absolute_path`
|
50
56
|
sig { void }
|
51
57
|
def mkdir!
|
@@ -190,6 +196,12 @@ module Spoom
|
|
190
196
|
Spoom::Git.current_branch(path: @absolute_path)
|
191
197
|
end
|
192
198
|
|
199
|
+
# Get the last commit in the currently checked out branch
|
200
|
+
sig { params(short_sha: T::Boolean).returns(T.nilable(Git::Commit)) }
|
201
|
+
def git_last_commit(short_sha: true)
|
202
|
+
Spoom::Git.last_commit(path: @absolute_path, short_sha: short_sha)
|
203
|
+
end
|
204
|
+
|
193
205
|
# Sorbet
|
194
206
|
|
195
207
|
# Run `bundle exec srb` in this context directory
|
data/lib/spoom/git.rb
CHANGED
@@ -75,9 +75,9 @@ module Spoom
|
|
75
75
|
# Utils
|
76
76
|
|
77
77
|
# Get the last commit in the currently checked out branch
|
78
|
-
sig { params(path: String).returns(T.nilable(Commit)) }
|
79
|
-
def last_commit(path: ".")
|
80
|
-
result = log("HEAD --format='
|
78
|
+
sig { params(path: String, short_sha: T::Boolean).returns(T.nilable(Commit)) }
|
79
|
+
def last_commit(path: ".", short_sha: true)
|
80
|
+
result = log("HEAD --format='%#{short_sha ? "h" : "H"} %at' -1", path: path)
|
81
81
|
return nil unless result.status
|
82
82
|
|
83
83
|
out = result.out.strip
|
data/lib/spoom/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spoom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre Terrasa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|