ra10ke 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/ra10ke/validate.rb +4 -5
- data/lib/ra10ke/version.rb +1 -1
- data/spec/fixtures/reflist.txt +1 -0
- data/spec/ra10ke/validate_spec.rb +2 -3
- 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: ed7cf2819431d671a0b16c4437b8cdc5606be3b7f81660ca63b75b6498f33859
|
4
|
+
data.tar.gz: 0ff570951916a4c267eb09b9f479c68c890cc121666ee1ae94a1f6cfa0b99575
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eea68a63d23b37b4e38a70c167837f84600a91c6d68080f04d288fd17a376e7d6e060f25e7d0d836a4136b8d42a4a7f0b905a135199b08d1468a888deba21a98
|
7
|
+
data.tar.gz: c7446689752cbbd943d8ac4502e103ead5e8499116a43ee099402f24c1d088afc178bb4b3dccb0af6fd4a11d286871fec493fd10f9ea35fb5f030e0c81f1bd47
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
CHANGELOG
|
2
2
|
=========
|
3
3
|
|
4
|
+
0.6.2
|
5
|
+
-----
|
6
|
+
|
7
|
+
2019-08-26
|
8
|
+
|
9
|
+
Closed Pull Requests:
|
10
|
+
|
11
|
+
* [#42](https://github.com/voxpupuli/ra10ke/pull/42) - Fix lost refs in validation
|
12
|
+
|
13
|
+
Again many thanks to the following contributors for submitting PRs:
|
14
|
+
|
15
|
+
* [Alexander Olofsson](https://github.com/ananace)
|
16
|
+
|
4
17
|
0.6.1
|
5
18
|
-----
|
6
19
|
|
data/lib/ra10ke/validate.rb
CHANGED
@@ -46,11 +46,11 @@ module Ra10ke
|
|
46
46
|
# @param ref [String] - the ref object, branch name, tag name, or commit sha, defaults to HEAD
|
47
47
|
def valid_ref?(url, ref = 'HEAD')
|
48
48
|
raise ArgumentError unless ref
|
49
|
-
found = all_refs(url).find do |
|
49
|
+
found = all_refs(url).find do |data|
|
50
50
|
# we don't need to bother with these types
|
51
51
|
next if data[:type] == :pull || data[:type] == :merge_request
|
52
52
|
# is the name equal to the tag or branch? Is the commit sha equal?
|
53
|
-
data[:name].eql?(ref) || sha.slice(0,8).eql?(ref.slice(0,8))
|
53
|
+
data[:name].eql?(ref) || data[:sha].slice(0,8).eql?(ref.slice(0,8))
|
54
54
|
end
|
55
55
|
!found.nil?
|
56
56
|
end
|
@@ -66,7 +66,7 @@ module Ra10ke
|
|
66
66
|
def all_refs(url)
|
67
67
|
data = `git ls-remote --symref #{url}`
|
68
68
|
raise "Error downloading #{url}" unless $CHILD_STATUS.success?
|
69
|
-
data.lines.reduce(
|
69
|
+
data.lines.reduce([]) do |refs, line|
|
70
70
|
sha, ref = line.split("\t")
|
71
71
|
next refs if sha.eql?('ref: refs/heads/master')
|
72
72
|
_, type, name, subtype = ref.chomp.split('/')
|
@@ -75,8 +75,7 @@ module Ra10ke
|
|
75
75
|
type = type.to_sym
|
76
76
|
subtype = subtype.to_sym if subtype
|
77
77
|
type = :branch if type.eql?(:heads)
|
78
|
-
refs
|
79
|
-
refs
|
78
|
+
refs << { sha: sha, ref: ref.chomp, type: type, subtype: subtype, name: name }
|
80
79
|
end
|
81
80
|
end
|
82
81
|
|
data/lib/ra10ke/version.rb
CHANGED
data/spec/fixtures/reflist.txt
CHANGED
@@ -167,6 +167,7 @@ c89c34fa4878abbc8a298b769bc67918be561c94 refs/pull/264/head
|
|
167
167
|
d15c194a874c437743295ce29ba0b2e4cf673f98 refs/pull/27/head
|
168
168
|
f706647fdfed5c4a39b4d3fb96b47d302669e380 refs/pull/270/head
|
169
169
|
dca994acbe017db9d408172e2b7f2aef20563a2f refs/pull/270/merge
|
170
|
+
156ca9a8ea69e056e86355b27d944e59d1b3a1e1 refs/pull/271/head
|
170
171
|
6ef2f6193da1d6d79223e9d8c5071fb0007ec3de refs/pull/28/head
|
171
172
|
4da47a821041fa051f9e16cd49b7881cba131a6d refs/pull/29/head
|
172
173
|
c8b57cdadac36790d2070267ca845059268d6ea2 refs/pull/3/head
|
@@ -71,10 +71,9 @@ RSpec.describe 'Ra10ke::Validate::Validation' do
|
|
71
71
|
|
72
72
|
it '#all_refs' do
|
73
73
|
refs = instance.all_refs('https://www.example.com')
|
74
|
-
expect(refs).to be_a
|
74
|
+
expect(refs).to be_a Array
|
75
75
|
expect(refs.first).to eq(
|
76
|
-
|
77
|
-
{:name=>"74110ac", :ref=>"refs/heads/74110ac", :subtype=>nil, :type=>:branch}]
|
76
|
+
{:sha=>"0ec707e431367bbe2752966be8ab915b6f0da754",:name=>"74110ac", :ref=>"refs/heads/74110ac", :subtype=>nil, :type=>:branch}
|
78
77
|
)
|
79
78
|
|
80
79
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ra10ke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Theo Chatzimichos
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-08-
|
12
|
+
date: 2019-08-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|