bulk_ops 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bulk_ops/github_access.rb +5 -6
- data/lib/bulk_ops/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: 4cd7f0776712d0ce3a2434c044def2e48b22a9205aa7fe72cea6dde32e60142d
|
4
|
+
data.tar.gz: 706abceb8ddcea1ba1d876135f32c334693eb6edbf6b529b5baf287f1d1f2e25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a243cc191391eb59645b8ced1ff5752945f98744ad0e6c51f94fa0c78e1949b28b186c1078b80e6e17e00098185a6fea69728543942f7c9f1c146849773fc38
|
7
|
+
data.tar.gz: 4fd360260733508e0ffb219ecabc156bc236bf6e90fcda0e8510f59dd019c4928c83b6e2af900f34983f50663e6b18e7e12c00281f65d0972b51c8c9ae89e760
|
@@ -139,7 +139,6 @@ class BulkOps::GithubAccess
|
|
139
139
|
client.update_contents(repo, file_name, message, sha, contents, branch: name)
|
140
140
|
end
|
141
141
|
end
|
142
|
-
|
143
142
|
def add_new_spreadsheet file, message=false
|
144
143
|
if file.is_a? Tempfile
|
145
144
|
file.close
|
@@ -231,13 +230,13 @@ class BulkOps::GithubAccess
|
|
231
230
|
client.contents(repo, path: filename, ref: name)
|
232
231
|
end
|
233
232
|
|
234
|
-
def get_file_contents
|
235
|
-
ref
|
236
|
-
client.contents(repo, path: filename, ref: ref)[:content]
|
233
|
+
def get_file_contents(path, ref: nil)
|
234
|
+
client.blob(github_config["repo"], get_file_sha(path, ref: ref))[:content]
|
237
235
|
end
|
238
236
|
|
239
|
-
def get_file_sha
|
240
|
-
|
237
|
+
def get_file_sha path, ref: nil
|
238
|
+
ref ||= name
|
239
|
+
client.contents(repo, path: File.dirname(path), ref: ref).select{|file| file[:name]==File.basename(path)}.first[:sha]
|
241
240
|
end
|
242
241
|
|
243
242
|
def repo
|
data/lib/bulk_ops/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bulk_ops
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ned Henry, UCSC Library Digital Initiatives
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|