bard 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.5.2
data/bard.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bard}
8
- s.version = "0.5.1"
8
+ s.version = "0.5.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Micah Geisel", "Nick Hogle"]
@@ -37,6 +37,13 @@ Feature: Bard can check its environment for missing dependencies and potential p
37
37
  When I type "bard check ."
38
38
  Then I should see the fatal error "missing submodule"
39
39
 
40
+ Scenario: Bard check detects submodules with detached heads
41
+ Given a shared rails project
42
+ And a submodule
43
+ And the submodule has a detached head
44
+ When I type "bard check ."
45
+ Then I should see the fatal error "submodule has a detached head"
46
+
40
47
  Scenario: Bard check detects missing gems
41
48
  Given a shared rails project
42
49
  And I have committed a set of changes that adds the test gem as a dependency
@@ -40,6 +40,12 @@ Given /^the submodule is missing$/ do
40
40
  type "mkdir submodule"
41
41
  end
42
42
 
43
+ Given /^the submodule has a detached head$/ do
44
+ Dir.chdir "submodule" do
45
+ type "git checkout `git rev-parse HEAD`"
46
+ end
47
+ end
48
+
43
49
  Given /^my "([^\"]*)" environment variable is "([^\"]*)"$/ do |key, value|
44
50
  @env ||= Hash.new
45
51
  @env[key] = value
data/lib/bard.rb CHANGED
@@ -143,6 +143,7 @@ class Bard < Thor
143
143
  errors << "pending migrations" if stdout.include? "pending migrations"
144
144
 
145
145
  errors << "missing submodule" if `git submodule status` =~ /^-/
146
+ errors << "submodule has a detached head" unless system 'git submodule foreach "git symbolic-ref HEAD"'
146
147
  errors << "missing gems" if `rake gems` =~ /\[ \]/
147
148
  errors << "you shouldn't be working on the master branch" if `cat .git/HEAD`.include? "refs/heads/master"
148
149
  errors << "missing integration branch" if `git branch` !~ /\bintegration\b/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel