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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27e024c3955dfd63304f5d7f9cda8ec5c60f8529a6011d847da3905a169c680f
4
- data.tar.gz: a94141de13111a2694aabd684a3a185642bea83d93f6fecb0a3e9fa131aa6b9c
3
+ metadata.gz: 4cd7f0776712d0ce3a2434c044def2e48b22a9205aa7fe72cea6dde32e60142d
4
+ data.tar.gz: 706abceb8ddcea1ba1d876135f32c334693eb6edbf6b529b5baf287f1d1f2e25
5
5
  SHA512:
6
- metadata.gz: bfb20c3e45cc9b4dbd1a4b1326115832925c4619dcc9b1d282053391e0071ca471e7f1b51ff91acf9981096b2b1f0f23745d4a9c9492b3266dd01a8a0b2decbf
7
- data.tar.gz: f0b4616a4a049388ffc407dc235566cb600c15384d428d838b190ef5e7a651f923e153830a69d89af0fa6636fe06311cc2e19c515ee0f4fbe8f47be0e5ae80dd
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 filename, ref: nil
235
- ref ||= name
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 filename
240
- client.contents(repo, path: filename, ref: name)[:sha]
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
@@ -1,3 +1,3 @@
1
1
  module BulkOps
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
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.6
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-18 00:00:00.000000000 Z
11
+ date: 2019-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails