bundler-advise 1.1.2 → 1.1.3

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
  SHA1:
3
- metadata.gz: 2db3c9fc6ec81aa4e098fd33ee3360c9e9f80510
4
- data.tar.gz: 44a7ddae8db2ad5a4832cd4f67192c97288af707
3
+ metadata.gz: 30f4e69a4f93c5836696e97544e8394a5c7414b2
4
+ data.tar.gz: 4d7e7251ffaada1d00bda7f03190a46d8e824119
5
5
  SHA512:
6
- metadata.gz: 45abaff96c78191fb4bea84e47eb2d117ccfa8db30dab31270b5ee28f17c3fa7af6931d1310f65314f80877cfc2bf144eb400376c57f21d416a8e298ae8ee283
7
- data.tar.gz: 71aedf2b8c0df5ee2a30546995049fbe61222d3de1ad9279351342168752a80ef34ae95369da473afed885d887702b44049f7ba1cf7e22f237946592a27d92bf
6
+ metadata.gz: 58c066c34fa833a22d5743dbdd7e9788a24eae1225db17fa2e64cbb1ea00b041b93b92c4866e31d0c72e2fcfefe8707700446c622572d3e3ed606ec79a940a1f
7
+ data.tar.gz: 27df41527ceb684d2993bc2bbe3aa87289dfcb154afc9183ab4d9cd65ee4958b4bf3b0cbbdd380d6a851412d9ccaa791d2afb2f86af3e1f8987e75a70d1c3cac
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bundler-advise (1.1.2)
4
+ bundler-advise (1.1.3)
5
5
  bundler (~> 1.7)
6
6
  git
7
7
 
@@ -43,3 +43,6 @@ DEPENDENCIES
43
43
  pry
44
44
  rake (~> 10.0)
45
45
  rspec
46
+
47
+ BUNDLED WITH
48
+ 1.13.0.rc.2
@@ -11,7 +11,7 @@ module Bundler::Advise
11
11
  end
12
12
 
13
13
  def update
14
- File.exist?(@dir) ? pull : clone
14
+ dir_missing_or_empty ? clone : pull
15
15
  rescue ArgumentError => e
16
16
  # git gem is dorky in this case, putting the path into the backtrace.
17
17
  msg = "Unexpected problem with working dir for advisories: #{e.message} #{e.backtrace}.\n" +
@@ -19,6 +19,10 @@ module Bundler::Advise
19
19
  raise RuntimeError, msg
20
20
  end
21
21
 
22
+ def dir_missing_or_empty
23
+ !File.exist?(@dir) || Dir.empty?(@dir)
24
+ end
25
+
22
26
  def clean_update!
23
27
  FileUtils.rmtree @dir
24
28
  update
@@ -42,3 +46,12 @@ module Bundler::Advise
42
46
  end
43
47
  end
44
48
  end
49
+
50
+ class Dir
51
+ def self.empty?(path)
52
+ Dir.glob("#{ path }/{*,.*}") do |e|
53
+ return false unless %w( . .. ).include?(File::basename(e))
54
+ end
55
+ return true
56
+ end
57
+ end
@@ -1,5 +1,5 @@
1
1
  module Bundler
2
2
  module Advise
3
- VERSION = '1.1.2'
3
+ VERSION = '1.1.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler-advise
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - chrismo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-11 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git