bundle_package_check 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bundle_package_check.rb +17 -5
- data/lib/bundle_package_check/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e318763c7850044eaefc4dc35d4d962f4cb5f491
|
4
|
+
data.tar.gz: 8953005a4139089bd1159487321f606e1846dfa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29f5aebac0f5e1d1b83e8126d4d0b4e48a5403517de810828d18b551b2305863b2708d067589a001779000b98060b67c3383f078a1d903bc960865c248665cd0
|
7
|
+
data.tar.gz: cd1a76c69ca018bf9b51a6c2bcf88a9fb70f74ffe393370a0b36b6c9ff579b075f158249ebbb84d4278c89ddcb102094e331bf2c785f052a360741dfc258045a
|
data/lib/bundle_package_check.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
module BundlePackageCheck
|
2
|
+
PATH_SECTION = /^PATH\n( .*\n)+/
|
3
|
+
|
2
4
|
class << self
|
3
|
-
def errors(all: false, ignore_extra: false)
|
4
|
-
expected = expected_from_lock(all)
|
5
|
+
def errors(all: false, ignore_extra: false, ignore_path: false)
|
6
|
+
expected = expected_from_lock(all, ignore_path)
|
5
7
|
actual = Dir["vendor/cache/*"].sort
|
6
8
|
|
7
9
|
errors = []
|
@@ -12,13 +14,23 @@ module BundlePackageCheck
|
|
12
14
|
|
13
15
|
private
|
14
16
|
|
15
|
-
def
|
17
|
+
def path_gems(lock)
|
18
|
+
if section = lock[PATH_SECTION]
|
19
|
+
section.scan(/^ (\S+)/).flatten
|
20
|
+
else
|
21
|
+
[]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def expected_from_lock(all, ignore_path)
|
16
26
|
lock = File.read("Gemfile.lock")
|
27
|
+
path_gems = path_gems(lock)
|
17
28
|
expected = lock.scan(/(?:revision: (\S+)(?:\n .*)*\n specs:\n|^) (\S+) \((\S+)\)/)
|
18
29
|
expected.reject! { |revision, _, _| revision } unless all
|
30
|
+
expected.reject! { |_, name, _| path_gems.include?(name) } if ignore_path
|
19
31
|
expected.map! do |revision, name, version|
|
20
|
-
identifier = revision ? revision[0...12] : "
|
21
|
-
"vendor/cache/#{name}
|
32
|
+
identifier = (revision ? "-#{revision[0...12]}" : (path_gems.include?(name) ? "" : "-#{version}.gem"))
|
33
|
+
"vendor/cache/#{name}#{identifier}"
|
22
34
|
end.sort!
|
23
35
|
end
|
24
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundle_package_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: michael@grosser.it
|