txgh 7.0.3.beta3 → 7.0.3.beta4
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/lib/txgh/gitlab_api.rb +2 -2
- data/lib/txgh/version.rb +1 -1
- data/spec/gitlab_api_spec.rb +13 -13
- data/txgh.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 48e0eadcdb6ad07122b1373f84e39dbc8d219ae3cd2000c85cbdcd901ef4cd62
|
|
4
|
+
data.tar.gz: ee74522f8b4b97b0f0a2fd83a032e3f8a8734afb9f57e004d5dd7be4ffbccd36
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8bfa277f9876adccb9bbbe8c01576bc08ed4294054afb522c49e97b5127d3cb2f4e355c847964405a6a764e29f9b6a220cac43b79923c4ac866a607bcce9d2ef
|
|
7
|
+
data.tar.gz: 972253d27b545b8ffa9e8f7b4793a8d96cd3259917d2a16b3900219798ed6006a22e632ffcb86229dd80a1caad51201185aaf29010ffefb7230a747ed2637f0a
|
data/lib/txgh/gitlab_api.rb
CHANGED
|
@@ -16,7 +16,7 @@ module Txgh
|
|
|
16
16
|
content_list.each do |file_params|
|
|
17
17
|
path = file_params.fetch(:path)
|
|
18
18
|
new_contents = file_params.fetch(:contents)
|
|
19
|
-
branch = Utils.
|
|
19
|
+
branch = Utils.relative_branch(branch)
|
|
20
20
|
|
|
21
21
|
file_sha = file_params.fetch(:sha) do
|
|
22
22
|
begin
|
|
@@ -48,7 +48,7 @@ module Txgh
|
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
def download(path, branch)
|
|
51
|
-
file = client.get_file(repo_name, path, Utils.
|
|
51
|
+
file = client.get_file(repo_name, path, Utils.relative_branch(branch))
|
|
52
52
|
|
|
53
53
|
# mock github response
|
|
54
54
|
{
|
data/lib/txgh/version.rb
CHANGED
data/spec/gitlab_api_spec.rb
CHANGED
|
@@ -23,13 +23,13 @@ describe Txgh::GitlabApi do
|
|
|
23
23
|
|
|
24
24
|
expect(client).to(
|
|
25
25
|
receive(:get_file)
|
|
26
|
-
.with(repo, path,
|
|
26
|
+
.with(repo, path, filtered_branch)
|
|
27
27
|
.and_return(double(blob_id: old_sha))
|
|
28
28
|
)
|
|
29
29
|
|
|
30
30
|
expect(client).to(
|
|
31
31
|
receive(:edit_file)
|
|
32
|
-
.with(repo, path,
|
|
32
|
+
.with(repo, path, filtered_branch, new_contents, 'message')
|
|
33
33
|
)
|
|
34
34
|
|
|
35
35
|
api.update_contents(branch, [{ path: path, contents: new_contents }], 'message')
|
|
@@ -38,7 +38,7 @@ describe Txgh::GitlabApi do
|
|
|
38
38
|
it "doesn't update the file contents if the file hasn't changed" do
|
|
39
39
|
expect(client).to(
|
|
40
40
|
receive(:get_file)
|
|
41
|
-
.with(repo, path,
|
|
41
|
+
.with(repo, path, filtered_branch)
|
|
42
42
|
.and_return(double(blob_id: old_sha))
|
|
43
43
|
)
|
|
44
44
|
|
|
@@ -53,7 +53,7 @@ describe Txgh::GitlabApi do
|
|
|
53
53
|
|
|
54
54
|
expect(client).to(
|
|
55
55
|
receive(:edit_file)
|
|
56
|
-
.with(repo, path,
|
|
56
|
+
.with(repo, path, filtered_branch, new_contents, 'message')
|
|
57
57
|
)
|
|
58
58
|
|
|
59
59
|
api.update_contents(branch, [{ path: path, contents: new_contents }], 'message')
|
|
@@ -64,7 +64,7 @@ describe Txgh::GitlabApi do
|
|
|
64
64
|
it 'downloads the file from the given branch' do
|
|
65
65
|
expect(client).to(
|
|
66
66
|
receive(:get_file)
|
|
67
|
-
.with(repo, path,
|
|
67
|
+
.with(repo, path, filtered_branch)
|
|
68
68
|
.and_return(double(content: 'content', encoding: 'utf-8'))
|
|
69
69
|
)
|
|
70
70
|
|
|
@@ -76,7 +76,7 @@ describe Txgh::GitlabApi do
|
|
|
76
76
|
|
|
77
77
|
expect(client).to(
|
|
78
78
|
receive(:get_file)
|
|
79
|
-
.with(repo, path,
|
|
79
|
+
.with(repo, path, filtered_branch)
|
|
80
80
|
.and_return(double(content: content, encoding: 'utf-16'))
|
|
81
81
|
)
|
|
82
82
|
|
|
@@ -88,7 +88,7 @@ describe Txgh::GitlabApi do
|
|
|
88
88
|
it 'automatically decodes base64-encoded content' do
|
|
89
89
|
expect(client).to(
|
|
90
90
|
receive(:get_file)
|
|
91
|
-
.with(repo, path,
|
|
91
|
+
.with(repo, path, filtered_branch)
|
|
92
92
|
.and_return(double(content: Base64.encode64('content'), encoding: 'base64'))
|
|
93
93
|
)
|
|
94
94
|
|
|
@@ -103,14 +103,14 @@ describe Txgh::GitlabApi do
|
|
|
103
103
|
|
|
104
104
|
context 'when master branch' do
|
|
105
105
|
let(:branch) { 'master' }
|
|
106
|
-
let(:
|
|
106
|
+
let(:filtered_branch) { 'master' }
|
|
107
107
|
|
|
108
108
|
it_behaves_like 'an update_contents flow'
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
context 'when feature branch' do
|
|
112
|
-
let(:branch) { 'feature/foo-ticket' }
|
|
113
|
-
let(:
|
|
112
|
+
let(:branch) { 'heads/feature/foo-ticket' }
|
|
113
|
+
let(:filtered_branch) { 'feature/foo-ticket' }
|
|
114
114
|
|
|
115
115
|
it_behaves_like 'an update_contents flow'
|
|
116
116
|
end
|
|
@@ -149,14 +149,14 @@ describe Txgh::GitlabApi do
|
|
|
149
149
|
|
|
150
150
|
context 'when master branch' do
|
|
151
151
|
let(:branch) { 'master' }
|
|
152
|
-
let(:
|
|
152
|
+
let(:filtered_branch) { 'master' }
|
|
153
153
|
|
|
154
154
|
it_behaves_like 'a download flow'
|
|
155
155
|
end
|
|
156
156
|
|
|
157
157
|
context 'when feature branch' do
|
|
158
|
-
let(:branch) { 'feature/foo-ticket' }
|
|
159
|
-
let(:
|
|
158
|
+
let(:branch) { 'heads/feature/foo-ticket' }
|
|
159
|
+
let(:filtered_branch) { 'feature/foo-ticket' }
|
|
160
160
|
|
|
161
161
|
it_behaves_like 'a download flow'
|
|
162
162
|
end
|
data/txgh.gemspec
CHANGED
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
|
18
18
|
s.add_dependency 'faraday_middleware', '0.14.0'
|
|
19
19
|
s.add_dependency 'json', '~> 2.3'
|
|
20
20
|
s.add_dependency 'octokit', '~> 4.2'
|
|
21
|
-
s.add_dependency 'gitlab', '~> 4.
|
|
21
|
+
s.add_dependency 'gitlab', '~> 4.17'
|
|
22
22
|
s.add_dependency 'parseconfig', '~> 1.0'
|
|
23
23
|
|
|
24
24
|
s.require_path = 'lib'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: txgh
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.0.3.
|
|
4
|
+
version: 7.0.3.beta4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matthew Jackowski
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2021-01-
|
|
12
|
+
date: 2021-01-12 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: abroad
|
|
@@ -101,14 +101,14 @@ dependencies:
|
|
|
101
101
|
requirements:
|
|
102
102
|
- - "~>"
|
|
103
103
|
- !ruby/object:Gem::Version
|
|
104
|
-
version: '4.
|
|
104
|
+
version: '4.17'
|
|
105
105
|
type: :runtime
|
|
106
106
|
prerelease: false
|
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
|
108
108
|
requirements:
|
|
109
109
|
- - "~>"
|
|
110
110
|
- !ruby/object:Gem::Version
|
|
111
|
-
version: '4.
|
|
111
|
+
version: '4.17'
|
|
112
112
|
- !ruby/object:Gem::Dependency
|
|
113
113
|
name: parseconfig
|
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
229
229
|
version: 1.3.1
|
|
230
230
|
requirements: []
|
|
231
231
|
rubyforge_project:
|
|
232
|
-
rubygems_version: 2.7.6
|
|
232
|
+
rubygems_version: 2.7.6.2
|
|
233
233
|
signing_key:
|
|
234
234
|
specification_version: 4
|
|
235
235
|
summary: A library for syncing translation resources between Github and Transifex.
|