bd_pod_cache_lock 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bd_pod_cache_lock/version.rb +1 -1
- data/lib/bd_pod_cache_lock.rb +16 -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: 39f06457454a7e8cf5a0a07b8af301b3cdd199ead72a469ae7464397226cf166
|
4
|
+
data.tar.gz: 5f7e6c150730e4956a2dc7d530a8259b7e0392ed415963091c0da04a40f4bc44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d6eb03c5b46f7fc772d550f3397044bf180de8f436e26b17172fa81bd04b696b2c5469acfe371a84b8182605f82f32715fd3d04bd92dfeda9d7d617ebb332fa
|
7
|
+
data.tar.gz: 630d515b7ccc9c7f0cf671abc04f0ffccae1eb5c71391a6073f634484e032b6dc1cb86e325eb9ed876fc67a8e03e11327fef4c4752160b9d464969ca3e25d865
|
data/lib/bd_pod_cache_lock.rb
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
require "bd_pod_cache_lock/version"
|
2
2
|
require 'fileutils'
|
3
3
|
require 'tmpdir'
|
4
|
+
require 'digest/sha1'
|
5
|
+
|
6
|
+
ROOT_PROCESS_ID = Process.pid
|
7
|
+
|
8
|
+
$pod_cache_lock_dir = Pod::Config.instance.cache_root + 'Pods' + 'CacheLock'
|
9
|
+
|
10
|
+
at_exit do
|
11
|
+
if(Process.pid == ROOT_PROCESS_ID)
|
12
|
+
FileUtils.rm_rf($pod_cache_lock_dir)
|
13
|
+
puts "Unlocked"
|
14
|
+
end
|
15
|
+
end
|
4
16
|
|
5
17
|
module Pod
|
6
18
|
module Downloader
|
@@ -20,7 +32,10 @@ module Pod
|
|
20
32
|
# `request`.
|
21
33
|
#
|
22
34
|
def lock_path_for_pod(request, slug_opts = {})
|
23
|
-
|
35
|
+
lock_dir = root + "CacheLock"
|
36
|
+
Dir.mkdir($pod_cache_lock_dir) unless Dir.exist?($pod_cache_lock_dir)
|
37
|
+
request_sha1 = Digest::SHA1.hexdigest(request.slug(slug_opts))
|
38
|
+
return ($pod_cache_lock_dir + request_sha1).to_s + '.lock'
|
24
39
|
end
|
25
40
|
|
26
41
|
# @param [Request] request
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bd_pod_cache_lock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- liuyan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|