bundle_depot 0.0.1 → 0.0.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/Gemfile.lock +1 -1
- data/features/fetch.feature +8 -5
- data/lib/bundle_depot/cache.rb +12 -4
- data/lib/bundle_depot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63e72c9148f40b7ace2d997a480820ce363d9541
|
4
|
+
data.tar.gz: c1f4d9b72b40bf9c91ef5efcce320af9178bcbdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 121188693046d0144ba2ed6fa47726baf32d4b255ec892c4bbd5ca7b56f36c575f946049a16b83a0a987b829e3e7f104b0be9f2ee3ac3953627a96114f17191d
|
7
|
+
data.tar.gz: 405d0da59a791722126f723b2123b124262ba319a898f1abea3f8b7afbf1717eb78e4277925195fa57c057222386542173faeb7ccd1a916ca97b5c7b4319b9c8
|
data/Gemfile.lock
CHANGED
data/features/fetch.feature
CHANGED
@@ -21,12 +21,15 @@ Feature: Fetch remotely stored bundle
|
|
21
21
|
And the remote cache contains the packed bundle for "json"
|
22
22
|
And the local cache does not contain the bundle "json"
|
23
23
|
And the following environment variables are set:
|
24
|
-
| variable
|
25
|
-
|
|
24
|
+
| variable | value |
|
25
|
+
| BUNDLE_DEPOT_CACHE_PATH | special/depot/cache |
|
26
26
|
When I run `bundle-depot fetch`
|
27
|
-
|
28
|
-
| special/depot/cache
|
29
|
-
|
27
|
+
Then the following directories should exist:
|
28
|
+
| special/depot/cache/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c |
|
29
|
+
And the following symlinks should exist:
|
30
|
+
| source | target |
|
31
|
+
| .bundle/depot/current | special/depot/cache/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c |
|
32
|
+
|
30
33
|
|
31
34
|
Scenario: Does nothing if local cache contains the bundle
|
32
35
|
Given there is the project "json" in the current directory
|
data/lib/bundle_depot/cache.rb
CHANGED
@@ -33,8 +33,8 @@ module BundleDepot
|
|
33
33
|
|
34
34
|
attr_reader :local, :remote
|
35
35
|
|
36
|
-
def initialize(local = FileSystemStore.new(
|
37
|
-
remote = FileSystemStore.new(File.join(Cache.
|
36
|
+
def initialize(local = FileSystemStore.new(Cache.cache_path),
|
37
|
+
remote = FileSystemStore.new(File.join(Cache.depot_path, "remote")))
|
38
38
|
|
39
39
|
@local = local
|
40
40
|
@remote = remote
|
@@ -67,15 +67,23 @@ module BundleDepot
|
|
67
67
|
end
|
68
68
|
|
69
69
|
|
70
|
-
def self.
|
70
|
+
def self.depot_path
|
71
71
|
ENV["BUNDLE_DEPOT_PATH"] || DEFAULT_BUNDLE_DEPOT_PATH
|
72
72
|
end
|
73
73
|
|
74
|
+
def self.cache_path
|
75
|
+
ENV["BUNDLE_DEPOT_CACHE_PATH"] || File.join(Cache.depot_path, "cache")
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.current_bundle_path
|
79
|
+
ENV["BUNDLE_DEPOT_CURRENT_PATH"] || File.join(Cache.depot_path, "current")
|
80
|
+
end
|
81
|
+
|
74
82
|
private
|
75
83
|
|
76
84
|
def link
|
77
85
|
source = unpacked_bundle
|
78
|
-
target =
|
86
|
+
target = Cache.current_bundle_path
|
79
87
|
|
80
88
|
if File.exist?(target)
|
81
89
|
if File.symlink?(target)
|
data/lib/bundle_depot/version.rb
CHANGED