lock_jar 0.14.6 → 0.14.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lock_jar/domain/lockfile.rb +36 -15
- data/lib/lock_jar/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: 220e0aaec961060a13debcd2eb8cea370c13726e
|
4
|
+
data.tar.gz: baf281d3e8e0645851de8ca201da2b9c6af3f26b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 721a81227f8ef359b7cc95be9199089f3496983a318b07b5902be6c95589b9e8870bff8af2f17bfdb600c30f74692b33154d36d1a30485b27f77966b06bb5b6f
|
7
|
+
data.tar.gz: d7db27578bad5442f9804ceaa7fe36a8c9301645821a0c0a49787f33bdf2c3d0d6146faef1275e44bbdbba913e862d9dc9fd7368b05488e1545ce0544534026d
|
@@ -26,24 +26,45 @@ module LockJar
|
|
26
26
|
|
27
27
|
# rubocop:disable Metrics/PerceivedComplexity
|
28
28
|
def self.read(path)
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
29
|
+
lock_data = fs_or_classpath(path)
|
30
|
+
|
31
|
+
fail "lockfile #{path} not found" if lock_data.nil?
|
32
|
+
|
33
|
+
Lockfile.new.tap do |lockfile|
|
34
|
+
lockfile.version = lock_data['version'] || LockJar::VERSION
|
35
|
+
lockfile.merged = lock_data['merged']
|
36
|
+
lockfile.local_repository = lock_data['local_repository']
|
37
|
+
lockfile.merged = lock_data['merged'] || []
|
38
|
+
lockfile.maps = lock_data['maps'] || []
|
39
|
+
lockfile.excludes = lock_data['excludes'] || []
|
40
|
+
lockfile.groups = lock_data['groups'] || lock_data['scopes'] || {}
|
41
|
+
lockfile.remote_repositories =
|
42
|
+
Set.new(Array(lock_data['remote_repositories'] || lock_data['repositories']))
|
43
|
+
lockfile.gems = lock_data['gems'] || []
|
44
|
+
end
|
44
45
|
end
|
45
46
|
# rubocop:enable Metrics/PerceivedComplexity
|
46
47
|
|
48
|
+
def self.fs_or_classpath(path)
|
49
|
+
if File.exist? path
|
50
|
+
YAML.load_file(path)
|
51
|
+
|
52
|
+
# Lookup of Jarfile.lock in the classpath
|
53
|
+
elsif Naether.platform == 'java' || path.start_with?('classpath:')
|
54
|
+
stream = java.lang.Object.java_class.resource_as_stream("/#{path.gsub('classpath:', '')}")
|
55
|
+
if stream
|
56
|
+
reader = java.io.BufferedReader.new(java.io.InputStreamReader.new(stream))
|
57
|
+
lines = ''
|
58
|
+
while (line = reader.read_line)
|
59
|
+
lines << line << "\n"
|
60
|
+
end
|
61
|
+
reader.close
|
62
|
+
|
63
|
+
YAML.load(lines)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
47
68
|
def initialize
|
48
69
|
@groups = { 'default' => {} }
|
49
70
|
@maps = []
|
data/lib/lock_jar/version.rb
CHANGED