knife-spork 1.0.14 → 1.0.16

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ spec/reports
16
16
  test/tmp
17
17
  test/version_tmp
18
18
  tmp
19
+ .idea
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 1.0.15 (12th February, 2013)
2
+
3
+ Bugfixes:
4
+
5
+ - Fixed git plugin so that when working on a submodule, submodules will be git pulled from the parent repo instead
6
+ - Fixed foodcritic plugin bug where certain tag formats weren't being passed through
7
+
1
8
  ## 1.0.14 (15th January, 2013)
2
9
 
3
10
  Features:
data/README.md CHANGED
@@ -75,7 +75,7 @@ plugins:
75
75
  ```
76
76
 
77
77
  #### Default Environments
78
- The `default_environments` directive allows you to specify a default list of environments you want to promote changes to. If this option is configured and you *ommit* the environment parameter when promoting KnifeSpork will promote to all environments in this list.
78
+ The `default_environments` directive allows you to specify a default list of environments you want to promote changes to. If this option is configured and you *omit* the environment parameter when promoting KnifeSpork will promote to all environments in this list.
79
79
 
80
80
  #### Version Change Threshold
81
81
  The `version_change_threshold` directive allows you to customise the threshold used by a safety check in spork promote which will prompt for confirmation if you're promoting a cookbook by more than version_change_threshold versions. This defaults to 2 if not set, ie promoting a cookbook from v1.0.1 to v 1.0.2 will not trip this check, wheras promoting from v1.0.1 to v1.0.3 will.
data/knife-spork.gemspec CHANGED
@@ -2,7 +2,7 @@ $:.push File.expand_path('../lib', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'knife-spork'
5
- gem.version = '1.0.14'
5
+ gem.version = '1.0.16'
6
6
  gem.authors = ["Jon Cowie"]
7
7
  gem.email = 'jonlives@gmail.com'
8
8
  gem.homepage = 'https://github.com/jonlives/knife-spork'
@@ -19,7 +19,7 @@ module KnifeSpork
19
19
  cookbook_path = cookbook.root_dir
20
20
 
21
21
  ui.info cookbook_path
22
-
22
+
23
23
  options = {:tags => tags, :fail_tags => fail_tags, :include_rules => include_rules}
24
24
  review = ::FoodCritic::Linter.new.check([cookbook_path], options)
25
25
 
@@ -38,4 +38,4 @@ module KnifeSpork
38
38
  end
39
39
  end
40
40
  end
41
- end
41
+ end
@@ -79,7 +79,11 @@ module KnifeSpork
79
79
  def git_pull_submodules(path)
80
80
  if is_repo?(path)
81
81
  ui.msg "Pulling latest changes from git submodules (if any)"
82
- output = IO.popen("git submodule foreach git pull 2>&1")
82
+ top_level = `cd #{path} && git rev-parse --show-toplevel 2>&1`.chomp
83
+ if is_submodule?(top_level)
84
+ top_level = get_parent_dir(top_level)
85
+ end
86
+ output = IO.popen("cd #{top_level} && git submodule foreach git pull 2>&1")
83
87
  Process.wait
84
88
  exit_code = $?
85
89
  if !exit_code.exitstatus == 0
@@ -138,7 +142,32 @@ module KnifeSpork
138
142
  return true
139
143
  end
140
144
  end
141
-
145
+
146
+ def is_submodule?(path)
147
+ top_level = `cd #{path} && git rev-parse --show-toplevel 2>&1`.chomp
148
+ output = IO.popen("cd #{top_level}/.. && git rev-parse --show-toplevel 2>&1")
149
+ Process.wait
150
+ if $? != 0
151
+ return false
152
+ else
153
+ return true
154
+ end
155
+ end
156
+
157
+ def get_parent_dir(path)
158
+ top_level = path
159
+ return_code = 0
160
+ while return_code == 0
161
+ output = IO.popen("cd #{top_level}/.. && git rev-parse --show-toplevel 2>&1")
162
+ Process.wait
163
+ return_code = $?
164
+ if return_code == 0
165
+ top_level = output.read.chomp
166
+ end
167
+ end
168
+ top_level
169
+ end
170
+
142
171
  def remote
143
172
  config.remote || 'origin'
144
173
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-spork
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.14
4
+ version: 1.0.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-15 00:00:00.000000000 Z
12
+ date: 2013-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef