bard 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -25,6 +25,10 @@ rescue LoadError
25
25
  puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
26
26
  end
27
27
 
28
+ task :release do
29
+ Rake::Task["gemcutter:release"].invoke
30
+ end
31
+
28
32
  require 'spec/rake/spectask'
29
33
  Spec::Rake::SpecTask.new(:spec) do |spec|
30
34
  spec.libs << 'lib' << 'spec'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.2
1
+ 0.5.3
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.2"
8
+ s.version = "0.5.3"
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"]
@@ -89,3 +89,11 @@ Feature: Bard can check its environment for missing dependencies and potential p
89
89
  And the git hook on the staging server is bad
90
90
  When I type "bard check ." on the staging server
91
91
  Then I should see the fatal error "improper git hook"
92
+
93
+ @wip
94
+ Scenario: Bard check detects missing receive.denyCurrentBranch git variable on staging
95
+ Given a shared rails project
96
+ And my "RAILS_ENV" environment variable is "staging"
97
+ And the staging server git config for receive.denyCurrentBranch is not "ignore"
98
+ When I type "bard check ." on the staging server
99
+ Then I should see the fatal error "denyCurrentBranch"
@@ -29,20 +29,20 @@ Feature: bard push
29
29
  Given I have committed a set of changes that includes a new submodule
30
30
  When I type "bard push"
31
31
  Then there should be one new submodule on the remote
32
- And the remote submodule should be checked out
32
+ And the submodule branch should match the submodule origin branch
33
33
 
34
34
  Scenario: Pushing a change that includes a submodule update
35
35
  Given a submodule
36
36
  And I have committed a set of changes that includes a submodule update
37
37
  When I type "bard push"
38
- Then the remote submodule should be updated
38
+ Then the submodule branch should match the submodule origin branch
39
39
 
40
40
  Scenario: Pushing a change that includes a submodule url change
41
41
  Given a submodule
42
- Given I have committed a set of changes that includes a submodule url change
42
+ And I have committed a set of changes that includes a submodule url change
43
43
  When I type "bard push"
44
44
  Then the remote submodule url should be changed
45
- And the remote submodule should be checked out
45
+ And the submodule branch should match the submodule origin branch
46
46
 
47
47
  # TODO
48
48
  #Scenario: Pushing a change that includes a submodule deletion
@@ -69,3 +69,8 @@ Given /^the git hook on the staging server is bad$/ do
69
69
  end
70
70
  end
71
71
 
72
+ Given /^the staging server git config for receive.denyCurrentBranch is not "ignore"$/ do
73
+ Dir.chdir "#{ROOT}/tmp/origin" do
74
+ type "git config --unset receive.denyCurrentBranch"
75
+ end
76
+ end
@@ -8,6 +8,7 @@ Given /^a shared rails project$/ do
8
8
  Dir.mkdir 'tmp'
9
9
  type "cp -R fixtures/repo tmp/origin"
10
10
  Dir.chdir 'tmp/origin' do
11
+ type "git config receive.denyCurrentBranch ignore"
11
12
  File.open ".git/hooks/post-receive", "w" do |f|
12
13
  f.puts <<-BASH
13
14
  #!/bin/bash
@@ -4,7 +4,10 @@ Given /^a submodule$/ do
4
4
  type "git checkout integration"
5
5
  type "git pull --rebase"
6
6
  type "git submodule init"
7
- type "git submodule update --merge"
7
+ type "git submodule update"
8
+ Dir.chdir "submodule" do
9
+ type "git checkout master"
10
+ end
8
11
  @submodule_url = File.read(".gitmodules").match(/url = (.*)$/)[1]
9
12
  @submodule_commit = type "git submodule status"
10
13
  end
@@ -19,7 +22,6 @@ end
19
22
 
20
23
  Given /^I have committed a set of changes to the submodule$/ do
21
24
  Dir.chdir "#{ROOT}/tmp/local/submodule" do
22
- type "git checkout -b master"
23
25
  type "echo 'submodule_update' > submodule_update"
24
26
  type "git add ."
25
27
  type "git commit -am 'update in submodule'"
@@ -29,10 +31,8 @@ end
29
31
  Given /^the remote integration branch has had a commit that includes a new submodule$/ do
30
32
  Dir.chdir "#{ROOT}/tmp/origin" do
31
33
  type "git submodule add #{ROOT}/tmp/submodule submodule"
32
- Dir.chdir "submodule" do
33
- type "git checkout -b master"
34
- type "grb track master"
35
- end
34
+ type "git submodule init"
35
+ type "git submodule update"
36
36
  type "git add ."
37
37
  type "git commit -m 'added submodule'"
38
38
  end
@@ -40,8 +40,9 @@ end
40
40
 
41
41
  Given /^I have committed a set of changes that includes a new submodule$/ do
42
42
  type "git submodule add #{ROOT}/tmp/submodule submodule"
43
+ type "git submodule init"
44
+ type "git submodule update --merge"
43
45
  Dir.chdir "submodule" do
44
- type "git checkout -b master"
45
46
  type "grb track master"
46
47
  end
47
48
  type "git add ."
data/lib/bard.rb CHANGED
@@ -155,6 +155,7 @@ class Bard < Thor
155
155
  else
156
156
  errors << "missing git hook"
157
157
  end
158
+ errors << "the git config variable receive.denyCurrentBranch is not set to ignore" if `git config receive.denyCurrentBranch`.chomp != "ignore"
158
159
  end
159
160
 
160
161
  warnings << "RAILS_ENV is not set" if ENV['RAILS_ENV'].nil? or ENV['RAILS_ENV'].empty?
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.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel