bard 0.3.1 → 0.4.0

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.
@@ -1,3 +1,3 @@
1
1
  [submodule "fixtures/repo"]
2
2
  path = fixtures/repo
3
- url = staging@staging.botandrose.com:fuelcafe
3
+ url = staging@staging.botandrose.com:bard/fixtures/repo
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.4.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bard}
8
- s.version = "0.3.1"
8
+ s.version = "0.4.0"
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"]
@@ -28,8 +28,10 @@ Gem::Specification.new do |s|
28
28
  "VERSION",
29
29
  "bard.gemspec",
30
30
  "bin/bard",
31
+ "features/bard_check.feature",
31
32
  "features/bard_pull.feature",
32
33
  "features/bard_push.feature",
34
+ "features/step_definitions/check_steps.rb",
33
35
  "features/step_definitions/git_steps.rb",
34
36
  "features/step_definitions/global_steps.rb",
35
37
  "features/step_definitions/rails_steps.rb",
@@ -0,0 +1,8 @@
1
+ Feature: Bard can check its environment for missing dependencies and potential problems
2
+
3
+ Scenario: Bard check returns its version
4
+ When I type "bard check"
5
+ Then I should see the current version of bard
6
+ And I should see the current version of git
7
+ And I should see the current version of rubygems
8
+ And I should see the current version of ruby
@@ -0,0 +1,20 @@
1
+ Then /^I should see the current version of bard$/ do
2
+ version = File.read("#{ROOT}/VERSION").chomp
3
+ @stdout.should include "bard (#{version})"
4
+ end
5
+
6
+ Then /^I should see the current version of git$/ do
7
+ version = `git --version`[/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/]
8
+ @stdout.should include "git (#{version})"
9
+ end
10
+
11
+ Then /^I should see the current version of rubygems$/ do
12
+ version = `gem --version`.chomp
13
+ @stdout.should include "rubygems (#{version})"
14
+ end
15
+
16
+ Then /^I should see the current version of ruby$/ do
17
+ version = `ruby --version`[/[0-9]+\.[0-9]+\.[0-9]+/]
18
+ @stdout.should include "ruby (#{version})"
19
+ end
20
+
@@ -11,7 +11,7 @@ Given /^a shared rails project$/ do
11
11
  File.open ".git/hooks/post-receive", "w" do |f|
12
12
  f.puts <<-BASH
13
13
  #!/bin/bash
14
- RAILS_ENV=staging #{ROOT}/bin/bard stage
14
+ RAILS_ENV=staging #{ROOT}/bin/bard stage $@
15
15
  BASH
16
16
  f.chmod 0775
17
17
  end
@@ -29,6 +29,9 @@ BASH
29
29
  end
30
30
 
31
31
  When /^I type "([^\"]*)"$/ do |command|
32
+ if command =~ /^bard/
33
+ command = "#{ROOT}/bin/#{command}"
34
+ end
32
35
  type command
33
36
  end
34
37
 
@@ -3,7 +3,8 @@ Given /^a submodule$/ do
3
3
  Dir.chdir "#{ROOT}/tmp/local" do
4
4
  type "git checkout integration"
5
5
  type "git pull --rebase"
6
- type "git submodule update --init"
6
+ type "git submodule init"
7
+ type "git submodule update"
7
8
  @submodule_url = File.read(".gitmodules").match(/url = (.*)$/)[1]
8
9
  @submodule_commit = type "git submodule status"
9
10
  end
@@ -10,6 +10,29 @@ class Bard < Thor
10
10
  include BardGit
11
11
  include BardIO
12
12
 
13
+ desc "check", "check environment for missing dependencies"
14
+ def check
15
+ required = Hash.new
16
+ required['bard'] = `gem list bard --remote`[/[0-9]+\.[0-9]+\.[0-9]+/]
17
+ required['git'] = '1.6.0'
18
+ required['rubygems'] = '1.3.4'
19
+ required['ruby'] = '1.8.6'
20
+
21
+ actual = Hash.new
22
+ actual['bard'] = `gem list bard`[/[0-9]+\.[0-9]+\.[0-9]+/]
23
+ actual['git'] = `git --version`[/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/]
24
+ actual['rubygems'] = `gem --version`.chomp
25
+ actual['ruby'] = `ruby --version`[/[0-9]+\.[0-9]+\.[0-9]+/]
26
+
27
+ %w(bard git rubygems ruby).each do |pkg|
28
+ if actual[pkg] < required[pkg]
29
+ puts red("#{pkg.ljust(9)} (#{actual[pkg]}) ... NEED (#{required[pkg]})")
30
+ else
31
+ puts green("#{pkg.ljust(9)} (#{actual[pkg]})")
32
+ end
33
+ end
34
+ end
35
+
13
36
  desc "pull", "pull changes to your local machine"
14
37
  def pull
15
38
  ensure_integration_branch!
@@ -38,7 +38,7 @@ module BardGit
38
38
  submodules.any? do |name, submodule|
39
39
  Dir.chdir submodule["path"] do
40
40
  branch = `git name-rev --name-only HEAD`.chomp
41
- `git fetch`
41
+ `git fetch origin`
42
42
  submodule["id"] != `git rev-parse origin/#{branch}`.chomp
43
43
  end
44
44
  end
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.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
@@ -122,8 +122,10 @@ files:
122
122
  - VERSION
123
123
  - bard.gemspec
124
124
  - bin/bard
125
+ - features/bard_check.feature
125
126
  - features/bard_pull.feature
126
127
  - features/bard_push.feature
128
+ - features/step_definitions/check_steps.rb
127
129
  - features/step_definitions/git_steps.rb
128
130
  - features/step_definitions/global_steps.rb
129
131
  - features/step_definitions/rails_steps.rb