bundler-restrict 0.1.0 → 0.1.1

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: 637a79ba15cb900b7a8a5a88b26d6086d21b80378527325111899006052d996d
4
- data.tar.gz: 4edce383022eb03b1d6ef547509141acb408cf64f97add3a462758d1ca919168
3
+ metadata.gz: 495861a3598b42ce76a4d30468508ab11aa46b65d71a787daa0f97a0d5bb0a26
4
+ data.tar.gz: 3daa7f22b469607bb163e1d3f7ce4fffab8fc969615d69b16a1751c61bef8956
5
5
  SHA512:
6
- metadata.gz: 4ba647d1ecc80ff3059c4039613f5b74390469c491554eee6940f539a6a933e1667e0ce07d69c15505c7b6125995c34e8f0c55bf0268e1ffce72679e51f485e0
7
- data.tar.gz: 38124e5f26bbfcb987f9042872a675302e31cd49d6be1b3846729eca4319e3d0124064dbcbc31a5143e627b8f15a345fdd0b30e956714a26ca7690cea4f5ac74
6
+ metadata.gz: b68ead20a9df26bec4e9f91f8a4717b13378e1561268c9ec29fd1b2a5f8cc566ee989ef507267434cf5229faf6c59906aabda583636de09fa39ebd1ebb51047c
7
+ data.tar.gz: ae70d96224af51562282e9a605f645321ef8319b57e38a62a0e9e273cb43707e9db43099783a260d9128521b90f46584f99c7a8d9cd148a366f3c5650a0df26e
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # Bundler::Restrict
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/bundler/restrict`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Check bundle gem list.
4
+
5
+ Available checks:
6
+
7
+ * DateCheck: check if gem release date < '2022-02-01'
4
8
 
5
- TODO: Delete this and the text above, and describe your gem
6
9
 
7
10
  ## Installation
8
11
 
@@ -16,7 +19,17 @@ If bundler is not being used to manage dependencies, install the gem by executin
16
19
 
17
20
  ## Usage
18
21
 
19
- TODO: Write usage instructions here
22
+ Add to CI:
23
+
24
+ ```bash
25
+ bundle-restrict
26
+ ```
27
+
28
+
29
+ | ENV | Description | Default |
30
+ | ---------------- | ---------------------- | --------------------- |
31
+ | BUNDLE_RESTRICT_Z_DATE | Max allowed release date | 2022-02-01 |
32
+ | BUNDLE_RESTRICT_IGNORE_GEMS | List of gems to ignore checks | bundler-restrict |
20
33
 
21
34
  ## Development
22
35
 
@@ -15,6 +15,8 @@ module Bundler
15
15
  [
16
16
  Checks::DateCheck
17
17
  ].map { |ch| ch.new(gem) }.each do |check|
18
+ next if ignore?(gem)
19
+
18
20
  unless check.valid?
19
21
  print "\n"
20
22
  puts check.error
@@ -27,11 +29,20 @@ module Bundler
27
29
  end
28
30
 
29
31
  if errors.empty?
32
+ print "\n"
30
33
  puts "OK"
31
34
  else
32
35
  exit 1
33
36
  end
34
37
  end
38
+
39
+ def ignore?(gem)
40
+ ignored_gems.include? gem.name
41
+ end
42
+
43
+ def ignored_gems
44
+ ['bundler-restrict'] + ENV.fetch('BUNDLE_RESTRICT_IGNORE_GEMS', '').split(',')
45
+ end
35
46
  end
36
47
  end
37
48
  end
@@ -1,5 +1,5 @@
1
1
  module Bundler
2
2
  module Restrict
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler-restrict
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergei O. Udalov