bard 0.5.5 → 0.5.6
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 +1 -1
- data/bard.gemspec +2 -2
- data/features/bard_check.feature +0 -1
- data/lib/bard.rb +22 -12
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.6
|
data/bard.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{bard}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.6"
|
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
|
-
s.date = %q{2009-10-
|
12
|
+
s.date = %q{2009-10-06}
|
13
13
|
s.default_executable = %q{bard}
|
14
14
|
s.description = %q{This immaculate work of engineering genius allows mere mortals to collaborate with beings of transcendent intelligence like Micah, Michael, and Nick.}
|
15
15
|
s.email = %q{info@botandrose.com}
|
data/features/bard_check.feature
CHANGED
@@ -90,7 +90,6 @@ Feature: Bard can check its environment for missing dependencies and potential p
|
|
90
90
|
When I type "bard check ." on the staging server
|
91
91
|
Then I should see the fatal error "improper git hook"
|
92
92
|
|
93
|
-
@wip
|
94
93
|
Scenario: Bard check detects missing receive.denyCurrentBranch git variable on staging
|
95
94
|
Given a shared rails project
|
96
95
|
And my "RAILS_ENV" environment variable is "staging"
|
data/lib/bard.rb
CHANGED
@@ -27,10 +27,17 @@ class Bard < Thor
|
|
27
27
|
'rubygems' => `gem --version`.chomp,
|
28
28
|
'ruby' => `ruby --version`[/[0-9]+\.[0-9]+\.[0-9]+/]
|
29
29
|
}
|
30
|
+
help = {
|
31
|
+
'bard' => 'please type `gem install bard` to update',
|
32
|
+
'git' => 'please visit http://git-scm.com/download and install the appropriate package for your architecture',
|
33
|
+
'rubygems' => 'please type `gem update --system` to update',
|
34
|
+
'ruby' => 'um... ask micah?'
|
35
|
+
}
|
30
36
|
|
31
37
|
%w(bard git rubygems ruby).each do |pkg|
|
32
38
|
if actual[pkg] < required[pkg]
|
33
39
|
puts red("#{pkg.ljust(9)} (#{actual[pkg]}) ... NEED (#{required[pkg]})")
|
40
|
+
puts red(" #{help[pkg]}")
|
34
41
|
else
|
35
42
|
puts green("#{pkg.ljust(9)} (#{actual[pkg]})")
|
36
43
|
end
|
@@ -138,27 +145,30 @@ class Bard < Thor
|
|
138
145
|
warnings = []
|
139
146
|
Dir.chdir project do
|
140
147
|
status, stdout, stderr = systemu "rake db:abort_if_pending_migrations"
|
141
|
-
errors << "missing config/database.yml" if stderr.include? "config/database.yml"
|
142
|
-
errors << "missing database" if
|
143
|
-
errors << "
|
148
|
+
errors << "missing config/database.yml, adapt from config/database.sample.yml." if stderr.include? "config/database.yml"
|
149
|
+
errors << "missing config/database.sample.yml, please complain to micah" if not File.exist? "config/database.staging.yml"
|
150
|
+
errors << "missing database, please run `rake db:create db:migrate" if stderr.include? "Unknown database"
|
151
|
+
errors << "pending migrations, please run `rake db:migrate`" if stdout.include? "pending migrations"
|
152
|
+
|
153
|
+
errors << "missing submodule, please run git submodule update --init" if `git submodule status` =~ /^-/
|
154
|
+
errors << "submodule has a detached head, please complain to micah" unless system 'git submodule foreach "git symbolic-ref HEAD"'
|
144
155
|
|
145
|
-
errors << "missing
|
146
|
-
|
147
|
-
errors << "missing
|
148
|
-
errors << "you shouldn't be working on the master branch" if `cat .git/HEAD`.include? "refs/heads/master"
|
149
|
-
errors << "missing integration branch" if `git branch` !~ /\bintegration\b/
|
156
|
+
errors << "missing gems, please run `rake gems:install`" if `rake gems` =~ /\[ \]/
|
157
|
+
|
158
|
+
errors << "missing integration branch, please complain to micah" if `git branch` !~ /\bintegration\b/
|
159
|
+
errors << "you shouldn't be working on the master branch, please work on the integration branch" if `cat .git/HEAD`.include? "refs/heads/master"
|
150
160
|
|
151
161
|
if ENV['RAILS_ENV'] == "staging"
|
152
|
-
if File.exist? ".git/hooks/post-receive"
|
162
|
+
if not File.exist? ".git/hooks/post-receive"
|
163
|
+
errors << "missing git hook"
|
164
|
+
else
|
153
165
|
errors << "unexecutable git hook" unless File.executable? ".git/hooks/post-receive"
|
154
166
|
errors << "improper git hook" unless File.read(".git/hooks/post-receive").include? "bard stage $@"
|
155
|
-
else
|
156
|
-
errors << "missing git hook"
|
157
167
|
end
|
158
168
|
errors << "the git config variable receive.denyCurrentBranch is not set to ignore" if `git config receive.denyCurrentBranch`.chomp != "ignore"
|
159
169
|
end
|
160
170
|
|
161
|
-
warnings << "RAILS_ENV is not set" if ENV['RAILS_ENV'].nil? or ENV['RAILS_ENV'].empty?
|
171
|
+
warnings << "RAILS_ENV is not set, please complain to micah" if ENV['RAILS_ENV'].nil? or ENV['RAILS_ENV'].empty?
|
162
172
|
end
|
163
173
|
|
164
174
|
if not errors.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.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-10-
|
13
|
+
date: 2009-10-06 00:00:00 -07:00
|
14
14
|
default_executable: bard
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|