bard 0.8.10 → 0.8.11
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 +1 -1
- data/features/bard_check.feature +24 -0
- data/features/step_definitions/rails_steps.rb +8 -0
- data/features/support/io.rb +4 -0
- data/lib/bard/check.rb +5 -0
- data/lib/bard/template/initial.rb +8 -8
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.11
|
data/bard.gemspec
CHANGED
data/features/bard_check.feature
CHANGED
@@ -68,3 +68,27 @@ Feature: Bard can check its environment for missing dependencies and potential p
|
|
68
68
|
And the integration branch isnt tracking origin/integration
|
69
69
|
When I type "bard check"
|
70
70
|
Then I should see the fatal error "tracking"
|
71
|
+
|
72
|
+
Scenario: Bard check detects gitignored Capfile
|
73
|
+
Given a shared rails project
|
74
|
+
And the ".gitignore" file includes "Capfile"
|
75
|
+
When I type "bard check"
|
76
|
+
Then I should see the fatal error "Capfile should not be gitignored"
|
77
|
+
|
78
|
+
Scenario: Bard check detects gitignored config/deploy.rb
|
79
|
+
Given a shared rails project
|
80
|
+
And the ".gitignore" file includes "config/deploy.rb"
|
81
|
+
When I type "bard check"
|
82
|
+
Then I should see the fatal error "config/deploy.rb should not be gitignored"
|
83
|
+
|
84
|
+
Scenario: Bard check detects missing bard rake tasks
|
85
|
+
Given a shared rails project
|
86
|
+
And the "Rakefile" file does not include "bard/rake"
|
87
|
+
When I type "bard check"
|
88
|
+
Then I should see the fatal error "missing bard rake tasks"
|
89
|
+
|
90
|
+
Scenario: Bard check detects missing bard cap tasks
|
91
|
+
Given a shared rails project
|
92
|
+
And the "Capfile" file does not include "bard/capistrano"
|
93
|
+
When I type "bard check"
|
94
|
+
Then I should see the fatal error "missing bard capistrano tasks"
|
@@ -34,3 +34,11 @@ end
|
|
34
34
|
Then /^passenger should have been restarted$/ do
|
35
35
|
File.exist?("tmp/restart.txt").should be_true
|
36
36
|
end
|
37
|
+
|
38
|
+
Given /^the "([^\"]+)" file includes "([^\"]+)"$/ do |file, contents|
|
39
|
+
file_append file, contents
|
40
|
+
end
|
41
|
+
|
42
|
+
Given /^the "([^\"]+)" file does not include "([^\"]+)"$/ do |file, contents|
|
43
|
+
gsub_file file, contents, ""
|
44
|
+
end
|
data/features/support/io.rb
CHANGED
@@ -11,6 +11,10 @@ def type(command)
|
|
11
11
|
@stdout || @stderr
|
12
12
|
end
|
13
13
|
|
14
|
+
def file_append(file_name, contents)
|
15
|
+
File.open(file_name, 'ab') { |file| file.puts("\n#{contents}") }
|
16
|
+
end
|
17
|
+
|
14
18
|
def file_inject(file_name, sentinel, string, before_after=:after)
|
15
19
|
gsub_file file_name, /(#{Regexp.escape(sentinel)})/mi do |match|
|
16
20
|
if before_after == :after
|
data/lib/bard/check.rb
CHANGED
@@ -62,6 +62,11 @@ class Bard < Thor
|
|
62
62
|
errors << "integration branch isnt tracking the remote integration branch, please run `grb track integration`" if `git config branch.integration.merge` !~ %r%\brefs/heads/integration\b%
|
63
63
|
end
|
64
64
|
errors << "you shouldn't be working on the master branch, please work on the integration branch" if current_branch == "master"
|
65
|
+
|
66
|
+
errors << "Capfile should not be gitignored" if File.read(".gitignore") =~ /\bCapfile\b/
|
67
|
+
errors << "config/deploy.rb should not be gitignored" if File.read(".gitignore") =~ /\bconfig\/deploy\.rb\b/
|
68
|
+
errors << "missing bard rake tasks, please complain to micah" if File.read("Rakefile") !~ /\bbard\/rake\b/
|
69
|
+
errors << "missing bard capistrano tasks, please complain to micah" if File.read("Capfile") !~ /\bbard\/capistrano\b/
|
65
70
|
end
|
66
71
|
|
67
72
|
if not errors.empty?
|
@@ -14,6 +14,7 @@ plugin 'asset_packager', :git => 'git://github.com/sbecker/asset_packager.git'
|
|
14
14
|
#plugin 'fckeditor', :git => 'git://github.com/originofstorms/fckeditor.git'
|
15
15
|
|
16
16
|
# Install gems
|
17
|
+
gem "bard"
|
17
18
|
gem "haml", :version => "2.2.17"
|
18
19
|
gem "compass", :version => "0.8.17"
|
19
20
|
rake "gems:install"
|
@@ -44,14 +45,6 @@ END
|
|
44
45
|
rake "db:create"
|
45
46
|
rake "db:migrate"
|
46
47
|
|
47
|
-
# Restart task
|
48
|
-
file "lib/tasks/restart.rake", <<-END
|
49
|
-
task :restart do
|
50
|
-
system("touch tmp/restart.txt")
|
51
|
-
system("touch tmp/debug.txt") if ENV["DEBUG"] == 'true'
|
52
|
-
end
|
53
|
-
END
|
54
|
-
|
55
48
|
# Staging Environment
|
56
49
|
run "cp config/environments/development.rb config/environments/staging.rb"
|
57
50
|
|
@@ -184,6 +177,13 @@ public/stylesheets/*.css
|
|
184
177
|
END
|
185
178
|
|
186
179
|
# Deployment and staging setup
|
180
|
+
file_append "Rakefile", <<-END
|
181
|
+
|
182
|
+
begin
|
183
|
+
require 'bard/rake'
|
184
|
+
rescue LoadError; end
|
185
|
+
END
|
186
|
+
|
187
187
|
file "Capfile", <<-END
|
188
188
|
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
|
189
189
|
require 'bard/capistrano'
|