txgh 5.3.1 → 5.3.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/lib/txgh/github_api.rb +7 -3
- data/lib/txgh/version.rb +1 -1
- data/spec/github_api_spec.rb +14 -0
- data/txgh.gemspec +0 -2
- metadata +1 -17
- data/lib/txgh/api/endpoint.rb +0 -12
- data/lib/txgh/api/hooks/push.rb +0 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f831210ee4eadf7ea3dbeec8fca21b3cc457d05
|
|
4
|
+
data.tar.gz: 493c29cf1ddce63e389f5d59b51a5657d5696f16
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 72cfa6423105dd10a4ab7b5fb9ba5914b66a5260e40e69d3a2b4d6a48e12d02265bf7568b0f2deca4984c6690459ef16c9afa1330222bbcf44e0dc3074e9baab
|
|
7
|
+
data.tar.gz: c1c1b3763d4c8567b446432fa366f9915e69fe82410ab04dee0c158749d728b1badacc1832a15d4845081f18cbf2bda0e07d8ea7a1044ac2a9d58c2d51a16e5e
|
data/lib/txgh/github_api.rb
CHANGED
|
@@ -36,10 +36,14 @@ module Txgh
|
|
|
36
36
|
def update_contents(repo, branch, content_map, message)
|
|
37
37
|
content_map.each do |path, new_contents|
|
|
38
38
|
branch = Utils.relative_branch(branch)
|
|
39
|
-
file = client.contents(repo, { path: path, ref: branch})
|
|
40
|
-
current_contents = Base64.decode64(file[:content])
|
|
41
|
-
current_sha = file[:sha]
|
|
42
39
|
|
|
40
|
+
file = begin
|
|
41
|
+
client.contents(repo, { path: path, ref: branch })
|
|
42
|
+
rescue Octokit::NotFound
|
|
43
|
+
nil
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
current_sha = file ? file[:sha] : '0' * 40
|
|
43
47
|
new_sha = Utils.git_hash_blob(new_contents)
|
|
44
48
|
options = { branch: branch }
|
|
45
49
|
|
data/lib/txgh/version.rb
CHANGED
data/spec/github_api_spec.rb
CHANGED
|
@@ -68,6 +68,20 @@ describe GithubApi do
|
|
|
68
68
|
|
|
69
69
|
api.update_contents(repo, branch, { path => old_contents }, 'message')
|
|
70
70
|
end
|
|
71
|
+
|
|
72
|
+
it "creates the file if it doesn't already exist" do
|
|
73
|
+
new_contents = 'foobar'
|
|
74
|
+
|
|
75
|
+
# file doesn't exist, raise octokit error
|
|
76
|
+
expect(client).to receive(:contents).and_raise(Octokit::NotFound)
|
|
77
|
+
|
|
78
|
+
expect(client).to(
|
|
79
|
+
receive(:update_contents)
|
|
80
|
+
.with(repo, path, 'message', '0' * 40, new_contents, { branch: branch })
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
api.update_contents(repo, branch, { path => new_contents }, 'message')
|
|
84
|
+
end
|
|
71
85
|
end
|
|
72
86
|
|
|
73
87
|
describe '#commit' do
|
data/txgh.gemspec
CHANGED
|
@@ -24,8 +24,6 @@ Gem::Specification.new do |s|
|
|
|
24
24
|
s.add_dependency 'sinatra-contrib', '~> 1.4'
|
|
25
25
|
s.add_dependency 'rubyzip', '>= 1.0', '<= 1.1.2'
|
|
26
26
|
|
|
27
|
-
s.add_dependency 'dry-types'
|
|
28
|
-
|
|
29
27
|
s.require_path = 'lib'
|
|
30
28
|
s.files = Dir['{lib,spec}/**/*', 'README.md', 'txgh.gemspec', 'LICENSE']
|
|
31
29
|
end
|
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: 5.3.
|
|
4
|
+
version: 5.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matthew Jackowski
|
|
@@ -157,20 +157,6 @@ dependencies:
|
|
|
157
157
|
- - "<="
|
|
158
158
|
- !ruby/object:Gem::Version
|
|
159
159
|
version: 1.1.2
|
|
160
|
-
- !ruby/object:Gem::Dependency
|
|
161
|
-
name: dry-types
|
|
162
|
-
requirement: !ruby/object:Gem::Requirement
|
|
163
|
-
requirements:
|
|
164
|
-
- - ">="
|
|
165
|
-
- !ruby/object:Gem::Version
|
|
166
|
-
version: '0'
|
|
167
|
-
type: :runtime
|
|
168
|
-
prerelease: false
|
|
169
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
170
|
-
requirements:
|
|
171
|
-
- - ">="
|
|
172
|
-
- !ruby/object:Gem::Version
|
|
173
|
-
version: '0'
|
|
174
160
|
description: A server that automatically syncs translation resources between Github
|
|
175
161
|
and Transifex.
|
|
176
162
|
email:
|
|
@@ -184,8 +170,6 @@ files:
|
|
|
184
170
|
- README.md
|
|
185
171
|
- lib/ext/zipline/output_stream.rb
|
|
186
172
|
- lib/txgh.rb
|
|
187
|
-
- lib/txgh/api/endpoint.rb
|
|
188
|
-
- lib/txgh/api/hooks/push.rb
|
|
189
173
|
- lib/txgh/app.rb
|
|
190
174
|
- lib/txgh/category_support.rb
|
|
191
175
|
- lib/txgh/config.rb
|
data/lib/txgh/api/endpoint.rb
DELETED