bourdain 1.4.0 → 1.4.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
  SHA1:
3
- metadata.gz: bb30fcd0eea1e47d8f18544aebccf74e01ac985c
4
- data.tar.gz: 1d493aeb57b8aee5ce9c2157a42cfab6b0ff1410
3
+ metadata.gz: b004a03b3490c700e0e0347b3516a4bbc2059c5d
4
+ data.tar.gz: a635f4b84631e3bee09582de76c818f6a1c5eda5
5
5
  SHA512:
6
- metadata.gz: e0abe2865e740887e4cc5ab594e9ee2b0a9f4dd7ba49b119ded47067af6edaf514dde093efc11bb0c36e6828e594e85d30119fd869e92f8b23ce489dedada182
7
- data.tar.gz: a10c79a9434603dcea5ae23ee6160bbdae91b77fef3c14a66d2123f647bf993be011a3dcac277352f1359b0f150aaaf58d9017e0827720969b80946f858cfb2a
6
+ metadata.gz: c7ee9939a1072a1dfbde59fcae34fa87a674653c233d4ae590bcac8852cffa6f09daaaf83439191616e033bd64f39d59c632751b34f4fde16890d3bda150b553
7
+ data.tar.gz: 51613421ecb5af2dcda569a3361d12acdc8bf1830b681452294d8c2bcc3d52091f1e20853882f62a79c0f8c7c2c525c001ce9517c742dfd7b185024ba7d85e81
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.0
1
+ 1.4.1
@@ -21,6 +21,7 @@ module Bourdain
21
21
  def check_cookbook_freshness cookbook
22
22
  notifications = []
23
23
  path = cookbook[:path]
24
+ stale = []
24
25
 
25
26
  if Dir.exists? path
26
27
  if youre_dirty? path
@@ -28,14 +29,15 @@ module Bourdain
28
29
  elsif youre_ahead? path
29
30
  notifications.push [ path, :warn, "Your cookbook %{path} is ahead of %{repo}." % cookbook ]
30
31
  elsif youre_behind? path
31
- notifications.push [ path, :error, "Hey, looks like your cookbook %{path} is behind %{repo}. Try pulling." % cookbook ]
32
- error!
32
+ notifications.push [ path, :warn, "Looks like your cookbook %{path} is behind %{repo}. Will try pulling for you in a moment..." % cookbook ]
33
+ stale.push path
33
34
  else
34
35
  notifications.push [ path, :info, "Your cookbook %{path} looks up-to-date." % cookbook ]
35
36
  end
36
37
  end
37
38
 
38
- notifications
39
+ log_notifications [ notifications ]
40
+ stale
39
41
  end
40
42
 
41
43
  def check_cookbook_exists cookbook
@@ -55,29 +57,26 @@ module Bourdain
55
57
  end
56
58
  end
57
59
 
58
- def ensure_pre_commit_installed cookbook
59
- pre_commit_hook = File.join(cookbook[:path], '.git', 'hooks', 'pre-commit')
60
- apply_template pre_commit_hook, template: %w[ cookbook pre-commit ]
61
- FileUtils.chmod 0755, pre_commit_hook
60
+ def ensure_cookbook_up_to_date cookbook_path
61
+ log.warn "Pulling in remote changes to existing cookbook %s" % cookbook_path
62
+ %x| git -C #{cookbook_path} pull |
63
+ log.info "Your cookbook %s is now up-to-date." % cookbook_path
62
64
  end
63
65
 
64
66
 
65
67
 
66
68
  def check_gitlab_cookbooks! cookbook_configs
67
- notifications = cookbook_configs.pmap do |cookbook|
69
+ stale_cookbooks = cookbook_configs.pmap do |cookbook|
68
70
  check_cookbook_freshness cookbook
69
- end
70
- unless notifications.first.empty?
71
- log_notifications notifications
71
+ end.flatten.compact
72
+
73
+ stale_cookbooks.sort.each do |cookbook_path|
74
+ ensure_cookbook_up_to_date cookbook_path
72
75
  end
73
76
 
74
77
  cookbook_configs.sort_by { |cc| cc[:path] }.each do |cookbook|
75
78
  check_cookbook_exists cookbook
76
79
  end
77
-
78
- cookbook_configs.each do |cookbook|
79
- ensure_pre_commit_installed cookbook
80
- end
81
80
  end
82
81
 
83
82
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bourdain
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-04 00:00:00.000000000 Z
11
+ date: 2015-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pmap