bard 0.5.0 → 0.5.1

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.0
1
+ 0.5.1
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.0"
8
+ s.version = "0.5.1"
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"]
@@ -12,14 +12,14 @@ Feature: bard pull
12
12
  When I type "bard pull"
13
13
  Then the "integration" branch should match the "origin/integration" branch
14
14
  And there should be one new submodule
15
- And the submodule should be checked out
15
+ And the submodule branch should match the submodule origin branch
16
16
 
17
17
  Scenario: Pulling down when the latest changes include a submodule update
18
18
  Given a submodule
19
19
  And the remote integration branch has had a commit that includes a submodule update
20
20
  When I type "bard pull"
21
21
  Then the "integration" branch should match the "origin/integration" branch
22
- And the submodule should be updated
22
+ And the submodule branch should match the submodule origin branch
23
23
 
24
24
  Scenario: Pulling down when the latest changes include a submodule url change
25
25
  Given a submodule
@@ -27,7 +27,7 @@ Feature: bard pull
27
27
  When I type "bard pull"
28
28
  Then the "integration" branch should match the "origin/integration" branch
29
29
  And the submodule url should be changed
30
- And the submodule should be checked out
30
+ And the submodule branch should match the submodule origin branch
31
31
 
32
32
  # TODO
33
33
  #Scenario: Pulling down when the latest changes include a submodule deletion
@@ -4,7 +4,7 @@ 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"
7
+ type "git submodule update --merge"
8
8
  @submodule_url = File.read(".gitmodules").match(/url = (.*)$/)[1]
9
9
  @submodule_commit = type "git submodule status"
10
10
  end
@@ -117,10 +117,20 @@ Then /^there should be one new submodule on the remote$/ do
117
117
  end
118
118
  end
119
119
 
120
- Then /^the submodule should be checked out$/ do
120
+ Then /^the submodule branch should match the submodule origin branch$/ do
121
121
  @submodule_url = File.read(".gitmodules").match(/url = (.*)$/)[1]
122
122
  @submodule_commit = type "git submodule status"
123
123
  @submodule_commit.should match %r( [a-z0-9]{40} submodule)
124
+ Dir.chdir "submodule" do
125
+ @submodule = Grit::Repo.new "."
126
+ branch = @submodule.head.name rescue nil
127
+ remote_branch = @submodule.remotes.find {|n| n.name == "origin/HEAD" }.commit.id[/\w+$/]
128
+ branch.should_not be_nil
129
+ remote_branch.should_not be_nil
130
+ branch.should == remote_branch
131
+ type("git rev-parse HEAD").should == type("git rev-parse origin/HEAD")
132
+ type("git name-rev --name-only HEAD").should == type("git name-rev --name-only origin/HEAD")
133
+ end
124
134
  end
125
135
 
126
136
  Then /^the remote submodule should be checked out$/ do
data/lib/bard.rb CHANGED
@@ -14,7 +14,6 @@ class Bard < Thor
14
14
  desc "check [PROJECT]", "check PROJECT or environment for missing dependencies"
15
15
  def check(project = nil)
16
16
  return check_project(project) if project
17
- puts ENV['ASDF']
18
17
 
19
18
  required = {
20
19
  'bard' => `gem list bard --remote`[/[0-9]+\.[0-9]+\.[0-9]+/],
@@ -50,7 +49,6 @@ class Bard < Thor
50
49
  run_crucial "git pull --rebase origin integration"
51
50
 
52
51
  changed_files = run_crucial("git diff #{@common_ancestor} origin/integration --diff-filter=ACDMR --name-only").split("\n")
53
- puts changed_files.inspect
54
52
 
55
53
  if changed_files.any? { |f| f =~ %r(^db/migrate/.+) }
56
54
  run_crucial "rake db:migrate"
@@ -61,7 +59,7 @@ class Bard < Thor
61
59
  run_crucial "git submodule sync"
62
60
  run_crucial "git submodule init"
63
61
  end
64
- run_crucial "git submodule update"
62
+ run_crucial "git submodule update --merge"
65
63
 
66
64
  if changed_files.any? { |f| f =~ %r(^config/environment.+) }
67
65
  run_crucial "rake gems:install"
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.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel