git.rb 0.11.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Git/Blame.rb +1 -2
- data/lib/Git/Branch.rb +5 -1
- data/lib/Git/VERSION.rb +1 -1
- data/lib/Ordinal.rb +5 -3
- data/lib/String/capture.rb +5 -26
- data/lib/Thoran/String/Capture/capture.rb +26 -5
- data/lib/{Git.rb → git.rb} +1 -4
- metadata +33 -11
- data/lib/Array/all_but_first.rb +0 -7
- data/lib/Array/all_but_last.rb +0 -7
- data/lib/Thoran/Array/AllButFirst/all_but_first.rb +0 -28
- data/lib/Thoran/Array/AllButLast/all_but_last.rb +0 -28
- data/lib/Thoran/Array/FirstX/firstX.rb +0 -32
- data/lib/Thoran/Array/LastX/lastX.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9384ea9ff7a0b15bc14560e44361c2e7623bb41de51603ed4e841e99bf1ac4e4
|
4
|
+
data.tar.gz: 7ec3f96ffe3c518043b7d7f9bc49d1f74a5ce107bced7ee7a8743c81fb552b0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c7bdb144d90f5b35670fcc7f507b78dd36268d12c7876d5e7ccd6466d842a73a12ac6df6c550f6b586f42d8a53d16a4c7c8fe49777482b2f32581b8e3db44a0
|
7
|
+
data.tar.gz: 2d1bfdd796552b533f90dcbda5e46b150db147f696c15bb496ec8dd8328267893110506f1e63a32b7ec2753f9f3a5e2a002b50d5c888947e96893bea39216a07
|
data/lib/Git/Blame.rb
CHANGED
data/lib/Git/Branch.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# require 'Git/Branch'
|
7
7
|
#
|
8
8
|
# Git::Branch.local
|
9
|
-
# => Git::Branch
|
9
|
+
# => #<Git::Branch>
|
10
10
|
#
|
11
11
|
# Git::Branch.local.all, Git::Branch.all
|
12
12
|
# => [#<Git::Branch @name="master">, ...]
|
@@ -94,6 +94,10 @@ module Git
|
|
94
94
|
end
|
95
95
|
alias_method :head, :current
|
96
96
|
|
97
|
+
def default
|
98
|
+
`git rev-parse --abbrev-ref origin/HEAD`.strip.split('/').last
|
99
|
+
end
|
100
|
+
|
97
101
|
end # class << self
|
98
102
|
|
99
103
|
attr_accessor :name
|
data/lib/Git/VERSION.rb
CHANGED
data/lib/Ordinal.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Ordinal.rb
|
2
2
|
# Ordinal
|
3
3
|
|
4
|
-
#
|
5
|
-
# 0.2.
|
4
|
+
# 20220527
|
5
|
+
# 0.2.1
|
6
6
|
|
7
7
|
# Description: This is a collection of methods which relies upon an object having an entries method.
|
8
8
|
|
@@ -12,6 +12,8 @@
|
|
12
12
|
# Changes since 0.1:
|
13
13
|
# 1. - require 'File/self.relative_path' from Ordinal/Array and replaced with require_relative.
|
14
14
|
# 2. - require 'File/self.relative_path' from Ordinal/Array and replaced with require_relative.
|
15
|
+
# 0/1
|
16
|
+
# 3. /ninteenth/nineteenth/
|
15
17
|
|
16
18
|
module Ordinal
|
17
19
|
|
@@ -87,7 +89,7 @@ module Ordinal
|
|
87
89
|
entries[17]
|
88
90
|
end
|
89
91
|
|
90
|
-
def
|
92
|
+
def nineteenth
|
91
93
|
entries[18]
|
92
94
|
end
|
93
95
|
|
data/lib/String/capture.rb
CHANGED
@@ -1,28 +1,7 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
# String/capture.rb
|
2
|
+
# String#capture
|
3
3
|
|
4
|
-
#
|
5
|
-
# 0.3.1
|
4
|
+
# 20201008
|
5
|
+
# 0.3.1 (The same version number as the current version of Thoran/String/Capture.)
|
6
6
|
|
7
|
-
|
8
|
-
# 1. + Thoran namespace.
|
9
|
-
# 0/1
|
10
|
-
# 2. Updated the MiniTest superclass only---no implementation changes.
|
11
|
-
|
12
|
-
module Thoran
|
13
|
-
module String
|
14
|
-
module Capture
|
15
|
-
|
16
|
-
def capture(regex)
|
17
|
-
if md = self.match(regex)
|
18
|
-
md[1]
|
19
|
-
else
|
20
|
-
nil
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
String.send(:include, Thoran::String::Capture)
|
7
|
+
require 'Thoran/String/Capture/capture'
|
@@ -1,7 +1,28 @@
|
|
1
|
-
# String/capture.rb
|
2
|
-
# String#capture
|
1
|
+
# Thoran/String/Capture/capture.rb
|
2
|
+
# Thoran::String::Capture#capture
|
3
3
|
|
4
|
-
#
|
5
|
-
# 0.3.1
|
4
|
+
# 20161109
|
5
|
+
# 0.3.1
|
6
6
|
|
7
|
-
|
7
|
+
# Changes since 0.2:
|
8
|
+
# 1. + Thoran namespace.
|
9
|
+
# 0/1
|
10
|
+
# 2. Updated the MiniTest superclass only---no implementation changes.
|
11
|
+
|
12
|
+
module Thoran
|
13
|
+
module String
|
14
|
+
module Capture
|
15
|
+
|
16
|
+
def capture(regex)
|
17
|
+
if md = self.match(regex)
|
18
|
+
md[1]
|
19
|
+
else
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
String.send(:include, Thoran::String::Capture)
|
data/lib/{Git.rb → git.rb}
RENAMED
metadata
CHANGED
@@ -1,24 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thoran
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
11
|
+
date: 2022-05-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: minitest
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest-spec-context
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
13
41
|
description: Do stuff with git-blame, git-branch, git-log, and git-remote from Ruby.
|
14
42
|
email: code@thoran.com
|
15
43
|
executables: []
|
16
44
|
extensions: []
|
17
45
|
extra_rdoc_files: []
|
18
46
|
files:
|
19
|
-
- lib/Array/all_but_first.rb
|
20
|
-
- lib/Array/all_but_last.rb
|
21
|
-
- lib/Git.rb
|
22
47
|
- lib/Git/Blame.rb
|
23
48
|
- lib/Git/Branch.rb
|
24
49
|
- lib/Git/Log.rb
|
@@ -27,11 +52,8 @@ files:
|
|
27
52
|
- lib/Ordinal.rb
|
28
53
|
- lib/Ordinal/Array.rb
|
29
54
|
- lib/String/capture.rb
|
30
|
-
- lib/Thoran/Array/AllButFirst/all_but_first.rb
|
31
|
-
- lib/Thoran/Array/AllButLast/all_but_last.rb
|
32
|
-
- lib/Thoran/Array/FirstX/firstX.rb
|
33
|
-
- lib/Thoran/Array/LastX/lastX.rb
|
34
55
|
- lib/Thoran/String/Capture/capture.rb
|
56
|
+
- lib/git.rb
|
35
57
|
homepage: http://github.com/thoran/git.rb
|
36
58
|
licenses:
|
37
59
|
- MIT
|
@@ -51,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
73
|
- !ruby/object:Gem::Version
|
52
74
|
version: '0'
|
53
75
|
requirements: []
|
54
|
-
rubygems_version: 3.2.
|
76
|
+
rubygems_version: 3.2.22
|
55
77
|
signing_key:
|
56
78
|
specification_version: 4
|
57
79
|
summary: Do git stuff from Ruby.
|
data/lib/Array/all_but_first.rb
DELETED
data/lib/Array/all_but_last.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# Thoran/Array/AllButFirst/all_but_first.rb
|
2
|
-
# Thoran::Array::AllButFirst#all_but_first
|
3
|
-
|
4
|
-
# 20141223
|
5
|
-
# 0.1.0
|
6
|
-
|
7
|
-
# Description: This returns a copy of the receiving array with the first element removed.
|
8
|
-
|
9
|
-
# Changes:
|
10
|
-
# 1. + Thoran namespace.
|
11
|
-
|
12
|
-
require 'Thoran/Array/FirstX/firstX'
|
13
|
-
|
14
|
-
module Thoran
|
15
|
-
module Array
|
16
|
-
module AllButFirst
|
17
|
-
|
18
|
-
def all_but_first
|
19
|
-
d = self.dup
|
20
|
-
d.first!
|
21
|
-
d
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
Array.send(:include, Thoran::Array::AllButFirst)
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# Thoran/Array/AllButLast/all_but_last.rb
|
2
|
-
# Thoran::Array::AllButLast#all_but_last
|
3
|
-
|
4
|
-
# 20180804
|
5
|
-
# 0.1.0
|
6
|
-
|
7
|
-
# Description: This returns a copy of the receiving array with the last element removed.
|
8
|
-
|
9
|
-
# Changes:
|
10
|
-
# 1. + Thoran namespace.
|
11
|
-
|
12
|
-
require 'Thoran/Array/LastX/lastX'
|
13
|
-
|
14
|
-
module Thoran
|
15
|
-
module Array
|
16
|
-
module AllButLast
|
17
|
-
|
18
|
-
def all_but_last
|
19
|
-
d = self.dup
|
20
|
-
d.last!
|
21
|
-
d
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
Array.send(:include, Thoran::Array::AllButLast)
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# Thoran/Array/FirstX/firstX.rb
|
2
|
-
# Thoran::Array::FirstX#first!
|
3
|
-
|
4
|
-
# 20180804
|
5
|
-
# 0.3.3
|
6
|
-
|
7
|
-
# Description: Sometimes it makes more sense to treat arrays this way.
|
8
|
-
|
9
|
-
# Changes since 0.2:
|
10
|
-
# 1. Added the original version 0.1.0 of the implementation to the later 0.1.0!
|
11
|
-
# 0/1
|
12
|
-
# 2. Switched the tests to spec-style.
|
13
|
-
# 1/2
|
14
|
-
# 3. Added a test for the state of the array afterward, since this is meant to be an in place change.
|
15
|
-
# 2/3
|
16
|
-
# 4. Added tests for the extended functionality introduced in the first version 0.1.0.
|
17
|
-
|
18
|
-
module Thoran
|
19
|
-
module Array
|
20
|
-
module FirstX
|
21
|
-
|
22
|
-
def first!(n = 1)
|
23
|
-
return_value = []
|
24
|
-
n.times{return_value << self.shift}
|
25
|
-
return_value.size == 1 ? return_value[0] : return_value
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
Array.send(:include, Thoran::Array::FirstX)
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# Thoran/Array/LastX/lastX.rb
|
2
|
-
# Thoran::Array::LastX#last!
|
3
|
-
|
4
|
-
# 20180804
|
5
|
-
# 0.2.3
|
6
|
-
|
7
|
-
# Description: Sometimes it makes more sense to treat arrays this way.
|
8
|
-
|
9
|
-
# Changes since 0.1:
|
10
|
-
# 1. Added the complement of the extended version of Array#first!.
|
11
|
-
# 0/1
|
12
|
-
# 2. Switched the tests to spec-style.
|
13
|
-
# 1/2
|
14
|
-
# 3. Added a test for the state of the array afterward, since this is meant to be an in place change.
|
15
|
-
# 2/3
|
16
|
-
# 4. Added tests for the extended functionality introduced in the first version 0.1.0.
|
17
|
-
# 5. Fixed the implementation, so that the order is retained by unshifting the popped values rather than appending the shifted values as is the case with Array#first!.
|
18
|
-
|
19
|
-
module Thoran
|
20
|
-
module Array
|
21
|
-
module LastX
|
22
|
-
|
23
|
-
def last!(n = 1)
|
24
|
-
return_value = []
|
25
|
-
n.times{return_value.unshift(self.pop)}
|
26
|
-
return_value.size == 1 ? return_value[0] : return_value
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
Array.send(:include, Thoran::Array::LastX)
|