kumade 0.8.0 → 0.8.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/.gitignore +1 -0
- data/Changelog.md +3 -0
- data/features/git.feature +23 -0
- data/features/jammit.feature +20 -0
- data/features/kumade_executable.feature +8 -59
- data/features/kumade_without_jammit.feature +3 -33
- data/features/no_op_packager.feature +18 -0
- data/features/railtie.feature +1 -1
- data/features/rake_task_before_asset_compilation.feature +28 -0
- data/features/step_definitions/bundler_steps.rb +3 -25
- data/features/step_definitions/git_steps.rb +20 -8
- data/features/step_definitions/jammit_steps.rb +3 -0
- data/features/step_definitions/kumade_steps.rb +11 -5
- data/features/step_definitions/rails_steps.rb +10 -3
- data/features/step_definitions/rake_steps.rb +12 -0
- data/features/support/bundler.rb +10 -1
- data/features/support/disable_bundler.rb +3 -0
- data/features/support/env.rb +5 -1
- data/features/support/git.rb +21 -0
- data/features/support/git_remotes.rb +15 -0
- data/features/support/jammit.rb +14 -0
- data/features/support/rails.rb +18 -0
- data/kumade.gemspec +1 -2
- data/lib/kumade/git.rb +6 -0
- data/lib/kumade/heroku.rb +4 -1
- data/lib/kumade/packager.rb +5 -3
- data/lib/kumade/version.rb +1 -1
- data/spec/kumade/git_spec.rb +24 -0
- data/spec/kumade/packager_spec.rb +2 -2
- data/spec/support/git.rb +5 -0
- metadata +44 -45
- data/features/step_definitions/dependency_steps.rb +0 -3
data/.gitignore
CHANGED
data/Changelog.md
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
Feature: Git cleanliness
|
2
|
+
As a user
|
3
|
+
I want Kumade to check if git is clean before deploying
|
4
|
+
So that I don't accidentally leave leave local changes behind
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given a directory set up for kumade
|
8
|
+
When I create a Heroku remote named "pretend-staging"
|
9
|
+
|
10
|
+
Scenario: Git is clean if there are untracked files
|
11
|
+
When I create an untracked file
|
12
|
+
And I run kumade with "pretend-staging"
|
13
|
+
Then the output should not contain "==> ! Cannot deploy: repo is not clean"
|
14
|
+
|
15
|
+
Scenario: Git is not clean if a tracked file is modified
|
16
|
+
When I modify a tracked file
|
17
|
+
And I run kumade with "pretend-staging"
|
18
|
+
Then the output should contain "==> ! Cannot deploy: repo is not clean"
|
19
|
+
|
20
|
+
Scenario: Git repo is always clean when pretending
|
21
|
+
Given a dirty repo
|
22
|
+
When I run kumade with "pretend-staging -p"
|
23
|
+
Then the output should contain "==> Git repo is clean"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
@slow
|
2
|
+
Feature: Jammit
|
3
|
+
As a user
|
4
|
+
I want Kumade to auto-package with Jammit
|
5
|
+
So that I don't have to remember to package assets
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given a new Rails application with Kumade and Jammit
|
9
|
+
When I configure my Rails app for Jammit
|
10
|
+
And I create a Heroku remote named "staging"
|
11
|
+
|
12
|
+
Scenario: Jammit packager runs if Jammit is installed
|
13
|
+
When I run kumade
|
14
|
+
Then the output should contain "==> Packaged with Kumade::JammitPackager"
|
15
|
+
|
16
|
+
Scenario: Run custom task before jammit
|
17
|
+
When I add a pre-compilation rake task that prints "Hi!"
|
18
|
+
And I run kumade
|
19
|
+
Then the output should contain "kumade:before_asset_compilation"
|
20
|
+
And the output should contain "Hi!"
|
@@ -1,17 +1,12 @@
|
|
1
|
-
@slow
|
1
|
+
@slow
|
2
2
|
Feature: Kumade executable
|
3
3
|
As a user
|
4
4
|
I want to be able to use the kumade executable
|
5
5
|
So I can have a better experience than Rake provides
|
6
6
|
|
7
7
|
Background:
|
8
|
-
Given a
|
9
|
-
|
10
|
-
And I set up the Gemfile with kumade
|
11
|
-
And I add "jammit" to the Gemfile
|
12
|
-
And I bundle
|
13
|
-
When I set up a git repo
|
14
|
-
And I create a Heroku remote named "pretend-staging"
|
8
|
+
Given a new Rails application with Kumade and Jammit
|
9
|
+
When I create a Heroku remote named "pretend-staging"
|
15
10
|
And I create a Heroku remote named "staging"
|
16
11
|
And I create a non-Heroku remote named "bad-remote"
|
17
12
|
|
@@ -36,7 +31,7 @@ Feature: Kumade executable
|
|
36
31
|
When I run kumade with "-p"
|
37
32
|
Then the output should contain "==> Deployed to: staging"
|
38
33
|
|
39
|
-
Scenario:
|
34
|
+
Scenario: Deploying to an arbitrary environment fails
|
40
35
|
When I run kumade with "bamboo"
|
41
36
|
Then the output should contain "==> Deploying to: bamboo"
|
42
37
|
And the output should match /Cannot deploy: /
|
@@ -45,54 +40,8 @@ Feature: Kumade executable
|
|
45
40
|
When I run kumade with "bad-remote"
|
46
41
|
Then the output should match /==> ! Cannot deploy: "bad-remote" remote does not point to Heroku/
|
47
42
|
|
48
|
-
Scenario: Deploy from
|
49
|
-
When I
|
43
|
+
Scenario: Deploy from a branch that isn't "master"
|
44
|
+
When I switch to the "new_branch" branch
|
50
45
|
And I run kumade with "pretend-staging -p"
|
51
|
-
Then the output should contain
|
52
|
-
|
53
|
-
==> Git repo is clean
|
54
|
-
==> Packaged with Kumade::JammitPackager
|
55
|
-
git push origin new_branch
|
56
|
-
==> Pushed new_branch -> origin
|
57
|
-
git branch deploy >/dev/null
|
58
|
-
git push -f pretend-staging deploy:master
|
59
|
-
==> Pushed deploy:master -> pretend-staging
|
60
|
-
==> Migrated pretend-staging
|
61
|
-
==> Restarted pretend-staging
|
62
|
-
==> Deployed to: pretend-staging
|
63
|
-
"""
|
64
|
-
|
65
|
-
Scenario: Git is clean if there are untracked files
|
66
|
-
Given I write to "new-file" with:
|
67
|
-
"""
|
68
|
-
clean
|
69
|
-
"""
|
70
|
-
When I run kumade with "pretend-staging"
|
71
|
-
Then the output from "bundle exec kumade pretend-staging" should not contain "==> ! Cannot deploy: repo is not clean"
|
72
|
-
|
73
|
-
Scenario: Git is not clean if a tracked file is modified
|
74
|
-
Given I write to "new-file" with:
|
75
|
-
"""
|
76
|
-
clean
|
77
|
-
"""
|
78
|
-
And I commit everything in the current repo
|
79
|
-
When I append to "new-file" with "dirty it up"
|
80
|
-
And I run kumade with "pretend-staging"
|
81
|
-
Then the output from "bundle exec kumade pretend-staging" should contain "==> ! Cannot deploy: repo is not clean"
|
82
|
-
|
83
|
-
Scenario: Jammit packager runs if Jammit is installed
|
84
|
-
When I run kumade with "pretend-staging"
|
85
|
-
Then the output from "bundle exec kumade pretend-staging" should contain "==> ! Error: Jammit::MissingConfiguration"
|
86
|
-
|
87
|
-
Scenario: Run custom task before jammit
|
88
|
-
Given I write to "Rakefile" with:
|
89
|
-
"""
|
90
|
-
namespace :kumade do
|
91
|
-
task :before_asset_compilation do
|
92
|
-
puts 'Hi!'
|
93
|
-
end
|
94
|
-
end
|
95
|
-
"""
|
96
|
-
When I run kumade with "pretend-staging -p"
|
97
|
-
Then the output should contain "kumade:before_asset_compilation"
|
98
|
-
And the output should contain "==> Packaged with Kumade::JammitPackager"
|
46
|
+
Then the output should contain "==> Pushed new_branch -> origin"
|
47
|
+
And the output should contain "==> Deployed to: pretend-staging"
|
@@ -1,40 +1,10 @@
|
|
1
|
-
@slow
|
1
|
+
@slow
|
2
2
|
Feature: Kumade without jammit
|
3
3
|
|
4
4
|
Background:
|
5
|
-
Given a directory
|
6
|
-
|
7
|
-
And I set up the Gemfile with kumade
|
8
|
-
And I bundle
|
9
|
-
When I set up a git repo
|
10
|
-
And I create a Heroku remote named "pretend-staging"
|
5
|
+
Given a directory set up for kumade
|
6
|
+
When I create a Heroku remote named "pretend-staging"
|
11
7
|
|
12
8
|
Scenario: Jammit packager does not run if Jammit is not installed
|
13
9
|
When I run kumade with "pretend-staging"
|
14
10
|
Then the output should not contain "==> ! Error: Jammit::MissingConfiguration"
|
15
|
-
|
16
|
-
Scenario: Run custom task if it exists
|
17
|
-
Given I write to "Rakefile" with:
|
18
|
-
"""
|
19
|
-
namespace :kumade do
|
20
|
-
task :before_asset_compilation do
|
21
|
-
puts 'Hi!'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
"""
|
25
|
-
When I run kumade with "pretend-staging"
|
26
|
-
Then the output should contain "Running rake task: kumade:before_asset_compilation"
|
27
|
-
And the output should contain "Hi!"
|
28
|
-
|
29
|
-
Scenario: Don't run rake task in pretend mode
|
30
|
-
Given I write to "Rakefile" with:
|
31
|
-
"""
|
32
|
-
namespace :kumade do
|
33
|
-
task :before_asset_compilation do
|
34
|
-
puts 'Hi!'
|
35
|
-
end
|
36
|
-
end
|
37
|
-
"""
|
38
|
-
When I run kumade with "pretend-staging -p"
|
39
|
-
Then the output should contain "Running rake task: kumade:before_asset_compilation"
|
40
|
-
And the output should not contain "Hi!"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
@slow
|
2
|
+
Feature: No-op packager
|
3
|
+
As a user
|
4
|
+
I want Kumade to gracefully handle occasions when I have no assets to package
|
5
|
+
So that I am not forced to package my assets
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given a new Rails application with Kumade
|
9
|
+
When I create a Heroku remote named "staging"
|
10
|
+
|
11
|
+
Scenario: No-op packager does not run in pretend mode if Jammit is not installed
|
12
|
+
When I run kumade with "staging -p"
|
13
|
+
Then the output should not contain "==> Packaged with Kumade::NoopPackager"
|
14
|
+
|
15
|
+
Scenario: No-op packager does not run in normal mode if Jammit is not installed
|
16
|
+
When I add the origin remote
|
17
|
+
And I run kumade
|
18
|
+
Then the output should not contain "==> Packaged with Kumade::NoopPackager"
|
data/features/railtie.feature
CHANGED
@@ -3,7 +3,7 @@ Feature: Railtie
|
|
3
3
|
I want Kumade to autoload Rake tasks for my Rails application
|
4
4
|
So that I can integrate Kumade with other Rake tasks
|
5
5
|
|
6
|
-
@
|
6
|
+
@slow
|
7
7
|
Scenario: Rake tasks are loaded
|
8
8
|
Given a new Rails application with Kumade
|
9
9
|
When I create a Heroku remote named "staging"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
@slow
|
2
|
+
Feature: Rake task that runs before asset compilation
|
3
|
+
As a user
|
4
|
+
I want a Rake task that runs before packaging
|
5
|
+
So that I can hook into the packaging process
|
6
|
+
|
7
|
+
Scenario: Custom task runs if Jammit is installed
|
8
|
+
Given a new Rails application with Kumade and Jammit
|
9
|
+
When I create a Heroku remote named "pretend-staging"
|
10
|
+
And I add a pre-compilation rake task that prints "Hi!"
|
11
|
+
And I run kumade with "pretend-staging"
|
12
|
+
Then the output should contain "kumade:before_asset_compilation"
|
13
|
+
And the output should contain "Hi!"
|
14
|
+
|
15
|
+
Scenario: Custom task runs does not run if Jammit is not installed
|
16
|
+
Given a new Rails application with Kumade
|
17
|
+
When I create a Heroku remote named "pretend-staging"
|
18
|
+
And I add a pre-compilation rake task that prints "Hi!"
|
19
|
+
And I run kumade with "pretend-staging"
|
20
|
+
Then the output should not contain "kumade:before_asset_compilation"
|
21
|
+
|
22
|
+
Scenario: Pre-asset compilation task does not run when pretending
|
23
|
+
Given a new Rails application with Kumade and Jammit
|
24
|
+
When I create a Heroku remote named "pretend-staging"
|
25
|
+
And I add a pre-compilation rake task that prints "Hi!"
|
26
|
+
And I run kumade with "pretend-staging -p"
|
27
|
+
Then the output should contain "kumade:before_asset_compilation"
|
28
|
+
But the output should not contain "Hi!"
|
@@ -2,32 +2,10 @@ When /^I bundle$/ do
|
|
2
2
|
run_bundler
|
3
3
|
end
|
4
4
|
|
5
|
-
When /^I rebundle$/ do
|
6
|
-
steps %{
|
7
|
-
When I bundle
|
8
|
-
And I commit everything in the current repo
|
9
|
-
}
|
10
|
-
end
|
11
|
-
|
12
|
-
Given /^an empty Gemfile$/ do
|
13
|
-
When %{I write to "Gemfile" with:}, ""
|
14
|
-
end
|
15
|
-
|
16
5
|
When /^I set up the Gemfile with kumade$/ do
|
17
|
-
|
18
|
-
When I write to "Gemfile" with:
|
19
|
-
"""
|
20
|
-
gem 'kumade', :path => '../../..'
|
21
|
-
"""
|
22
|
-
}
|
6
|
+
add_kumade_to_gemfile
|
23
7
|
end
|
24
8
|
|
25
|
-
When /^I add "
|
26
|
-
|
27
|
-
When I append to "Gemfile" with:
|
28
|
-
"""
|
29
|
-
|
30
|
-
gem '#{gem}'
|
31
|
-
"""
|
32
|
-
}
|
9
|
+
When /^I add "jammit" to the Gemfile$/ do
|
10
|
+
add_jammit_to_gemfile
|
33
11
|
end
|
@@ -7,17 +7,29 @@ When /^I create a non-Heroku remote named "([^"]*)"$/ do |remote_name|
|
|
7
7
|
end
|
8
8
|
|
9
9
|
When /^I set up a git repo$/ do
|
10
|
-
|
11
|
-
run_simple(git_command)
|
12
|
-
end
|
10
|
+
set_up_git_repo
|
13
11
|
end
|
14
12
|
|
15
13
|
When /^I commit everything in the current repo$/ do
|
16
|
-
|
17
|
-
run_simple(git_command)
|
18
|
-
end
|
14
|
+
commit_everything_in_repo
|
19
15
|
end
|
20
16
|
|
21
|
-
|
22
|
-
|
17
|
+
When /^I create an untracked file$/ do
|
18
|
+
write_file("untracked-file", "anything")
|
19
|
+
end
|
20
|
+
|
21
|
+
Given /^a dirty repo$/ do
|
22
|
+
modify_tracked_file
|
23
|
+
end
|
24
|
+
|
25
|
+
When /^I modify a tracked file$/ do
|
26
|
+
modify_tracked_file
|
27
|
+
end
|
28
|
+
|
29
|
+
When /^I add the origin remote$/ do
|
30
|
+
add_origin_remote
|
31
|
+
end
|
32
|
+
|
33
|
+
When /^I switch to the "([^"]+)" branch$/ do |branch_name|
|
34
|
+
run_simple("git checkout -b #{branch_name}")
|
23
35
|
end
|
@@ -1,9 +1,15 @@
|
|
1
|
+
When /^I run kumade$/ do
|
2
|
+
run_simple("bundle exec kumade", must_be_successful = false)
|
3
|
+
end
|
4
|
+
|
1
5
|
When /^I run kumade with "([^"]+)"$/ do |args|
|
2
|
-
|
6
|
+
run_simple("bundle exec kumade #{args}", must_be_successful = false)
|
3
7
|
end
|
4
8
|
|
5
|
-
Given /^
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
+
Given /^a directory set up for kumade$/ do
|
10
|
+
create_dir('the-kumade-directory')
|
11
|
+
cd('the-kumade-directory')
|
12
|
+
add_kumade_to_gemfile
|
13
|
+
run_bundler
|
14
|
+
set_up_git_repo
|
9
15
|
end
|
@@ -1,6 +1,13 @@
|
|
1
1
|
Given /^a new Rails application with Kumade$/ do
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
create_rails_app_with_kumade
|
3
|
+
end
|
4
|
+
|
5
|
+
Given /^a new Rails application with Kumade and Jammit$/ do
|
6
|
+
create_rails_app_with_kumade_and_jammit
|
7
|
+
end
|
8
|
+
|
9
|
+
When /^I configure my Rails app for Jammit$/ do
|
5
10
|
run_bundler
|
11
|
+
set_up_jammit
|
12
|
+
add_origin_remote
|
6
13
|
end
|
@@ -24,3 +24,15 @@ Then /^the rake tasks should not include "([^"]+)"/ do |task_name|
|
|
24
24
|
Then the output from "bundle exec rake -T" should not contain "#{task_name}"
|
25
25
|
}
|
26
26
|
end
|
27
|
+
|
28
|
+
When /^I add a pre-compilation rake task that prints "Hi!"$/ do
|
29
|
+
append_to_file("Rakefile", <<-CUSTOM_TASK)
|
30
|
+
namespace :kumade do
|
31
|
+
task :before_asset_compilation do
|
32
|
+
puts 'Hi!'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
CUSTOM_TASK
|
36
|
+
|
37
|
+
commit_everything_in_repo
|
38
|
+
end
|
data/features/support/bundler.rb
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
module BundlerHelpers
|
2
2
|
def run_bundler
|
3
|
-
|
3
|
+
bundle = 'bundle install'
|
4
|
+
run_simple("#{bundle} --local || #{bundle}")
|
5
|
+
end
|
6
|
+
|
7
|
+
def add_jammit_to_gemfile
|
8
|
+
append_to_file('Gemfile', "\ngem 'jammit'")
|
9
|
+
end
|
10
|
+
|
11
|
+
def add_kumade_to_gemfile
|
12
|
+
append_to_file('Gemfile', "\ngem 'kumade', :path => '../../..'")
|
4
13
|
end
|
5
14
|
end
|
6
15
|
|
data/features/support/env.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
module GitHelpers
|
2
|
+
def set_up_git_repo
|
3
|
+
["git init", "touch .gitkeep", "git add .", "git commit -am First"].each do |git_command|
|
4
|
+
run_simple(git_command)
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
def commit_everything_in_repo(message = "MY_MESSAGE")
|
9
|
+
['git add .', "git commit -am '#{message}'"].each do |git_command|
|
10
|
+
run_simple(git_command)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def modify_tracked_file
|
15
|
+
write_file('tracked-file', 'clean')
|
16
|
+
commit_everything_in_repo('modify tracked file')
|
17
|
+
append_to_file('tracked-file', 'dirty it up')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
World(GitHelpers)
|
@@ -20,6 +20,21 @@ module GitRemoteHelpers
|
|
20
20
|
run_simple("git remote add #{remote_name} git@github.com:gabebw/kumade.git")
|
21
21
|
@@created_remotes << remote_name
|
22
22
|
end
|
23
|
+
|
24
|
+
def add_origin_remote
|
25
|
+
original_dir = current_dir
|
26
|
+
create_dir("../origin")
|
27
|
+
cd("../origin")
|
28
|
+
run_simple("git init --bare")
|
29
|
+
|
30
|
+
cd("../#{File.basename(original_dir)}")
|
31
|
+
run_simple("git remote add origin ../origin")
|
32
|
+
@@created_remotes << 'origin'
|
33
|
+
end
|
23
34
|
end
|
24
35
|
|
25
36
|
World(GitRemoteHelpers)
|
37
|
+
|
38
|
+
After do
|
39
|
+
remove_all_created_remotes
|
40
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module JammitHelpers
|
2
|
+
def set_up_jammit
|
3
|
+
assets_yaml = <<-YAML.strip
|
4
|
+
javascripts:
|
5
|
+
default:
|
6
|
+
- public/javascripts/application.js
|
7
|
+
YAML
|
8
|
+
write_file('public/javascripts/application.js', 'var foo = 3;')
|
9
|
+
write_file('config/assets.yml', assets_yaml)
|
10
|
+
commit_everything_in_repo('add Jammit files')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
World(JammitHelpers)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module RailsAppHelpers
|
2
|
+
def create_rails_app_with_kumade
|
3
|
+
run_simple("rails new rake-tasks -T")
|
4
|
+
cd('rake-tasks')
|
5
|
+
append_to_file('Gemfile', "gem 'kumade', :path => '#{PROJECT_PATH}'")
|
6
|
+
run_bundler
|
7
|
+
set_up_git_repo
|
8
|
+
end
|
9
|
+
|
10
|
+
def create_rails_app_with_kumade_and_jammit
|
11
|
+
create_rails_app_with_kumade
|
12
|
+
add_jammit_to_gemfile
|
13
|
+
run_bundler
|
14
|
+
commit_everything_in_repo
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
World(RailsAppHelpers)
|
data/kumade.gemspec
CHANGED
@@ -19,13 +19,12 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_dependency('heroku', '~> 2.0')
|
20
20
|
s.add_dependency('rake', '>= 0.8.7')
|
21
21
|
s.add_dependency('cocaine', '>= 0.2.0')
|
22
|
+
s.add_dependency('rails', '>= 2')
|
22
23
|
|
23
|
-
s.add_development_dependency('rake', '>= 0.8.7')
|
24
24
|
s.add_development_dependency('rspec', '~> 2.6.0')
|
25
25
|
s.add_development_dependency('cucumber', '~> 1.0.2')
|
26
26
|
s.add_development_dependency('aruba', '~> 0.4.3')
|
27
27
|
s.add_development_dependency('jammit', '~> 0.6.3')
|
28
|
-
s.add_development_dependency('less', '~> 2.0')
|
29
28
|
s.add_development_dependency('bourne')
|
30
29
|
if RUBY_VERSION >= '1.9.0'
|
31
30
|
s.add_development_dependency('simplecov')
|
data/lib/kumade/git.rb
CHANGED
@@ -68,6 +68,12 @@ module Kumade
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
+
def has_untracked_files_in?(directory)
|
72
|
+
relative_dir = directory.sub(Dir.pwd + '/', '')
|
73
|
+
untracked_output = CommandLine.new("git status --porcelain --untracked-files").run
|
74
|
+
untracked_output.split("\n").grep(/^\?{2} #{relative_dir}/).size > 0
|
75
|
+
end
|
76
|
+
|
71
77
|
private
|
72
78
|
|
73
79
|
def has_branch?(branch)
|
data/lib/kumade/heroku.rb
CHANGED
@@ -21,7 +21,10 @@ module Kumade
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def restart_app
|
24
|
-
|
24
|
+
unless Kumade.configuration.pretending?
|
25
|
+
command_line = CommandLine.new("bundle exec heroku restart --remote #{Kumade.configuration.environment}")
|
26
|
+
command_line.run_or_error("Failed to restart #{Kumade.configuration.environment}")
|
27
|
+
end
|
25
28
|
Kumade.configuration.outputter.success("Restarted #{Kumade.configuration.environment}")
|
26
29
|
end
|
27
30
|
|
data/lib/kumade/packager.rb
CHANGED
@@ -6,8 +6,10 @@ module Kumade
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def run
|
9
|
-
|
10
|
-
|
9
|
+
if @packager.installed?
|
10
|
+
precompile_assets
|
11
|
+
package
|
12
|
+
end
|
11
13
|
end
|
12
14
|
|
13
15
|
def self.available_packager
|
@@ -25,7 +27,7 @@ module Kumade
|
|
25
27
|
|
26
28
|
begin
|
27
29
|
@packager.package
|
28
|
-
if @git.dirty?
|
30
|
+
if @git.dirty? || @git.has_untracked_files_in?(@packager.assets_path)
|
29
31
|
@git.add_and_commit_all_assets_in(@packager.assets_path)
|
30
32
|
Kumade.configuration.outputter.success(success_message)
|
31
33
|
end
|
data/lib/kumade/version.rb
CHANGED
data/spec/kumade/git_spec.rb
CHANGED
@@ -227,3 +227,27 @@ describe Kumade::Git, "#ensure_clean_git", :with_mock_outputter do
|
|
227
227
|
end
|
228
228
|
end
|
229
229
|
end
|
230
|
+
|
231
|
+
describe Kumade::Git, "#has_untracked_files_in?", :with_mock_outputter do
|
232
|
+
let(:untracked_dir) { 'untracked' }
|
233
|
+
|
234
|
+
context "in normal mode" do
|
235
|
+
before do
|
236
|
+
Kumade.configuration.pretending = false
|
237
|
+
create_untracked_file_in(untracked_dir)
|
238
|
+
end
|
239
|
+
|
240
|
+
it "detects untracked files" do
|
241
|
+
subject.should have_untracked_files_in(untracked_dir)
|
242
|
+
end
|
243
|
+
|
244
|
+
it "detects untracked files when given an absolute path" do
|
245
|
+
subject.should have_untracked_files_in(File.expand_path("./" + untracked_dir))
|
246
|
+
end
|
247
|
+
|
248
|
+
it "does not get confused by tracked files" do
|
249
|
+
`git add . && git commit -am Message`
|
250
|
+
subject.should_not have_untracked_files_in(untracked_dir)
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
@@ -9,7 +9,7 @@ describe Kumade::Packager, ".available_packager", :with_mock_outputter do
|
|
9
9
|
Kumade::Packager.available_packager.should == packager_1
|
10
10
|
end
|
11
11
|
|
12
|
-
it "returns nil if no packagers are
|
12
|
+
it "returns nil if no packagers are available" do
|
13
13
|
Kumade::PackagerList.stubs(:new => [])
|
14
14
|
Kumade::Packager.available_packager.should be_nil
|
15
15
|
end
|
@@ -17,7 +17,7 @@ end
|
|
17
17
|
|
18
18
|
describe Kumade::Packager, "#run", :with_mock_outputter do
|
19
19
|
let(:git) { stub("git", :dirty? => true, :add_and_commit_all_assets_in => true) }
|
20
|
-
let(:packager) { stub("packager", :name => "MyPackager", :package => true, :assets_path => 'fake_assets_path') }
|
20
|
+
let(:packager) { stub("packager", :name => "MyPackager", :package => true, :assets_path => 'fake_assets_path', :installed? => true) }
|
21
21
|
let(:rake_task_runner) { stub("RakeTaskRunner", :invoke => true) }
|
22
22
|
|
23
23
|
before do
|
data/spec/support/git.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kumade
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-11-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: heroku
|
17
|
-
requirement: &
|
17
|
+
requirement: &70189854580280 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '2.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70189854580280
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rake
|
28
|
-
requirement: &
|
28
|
+
requirement: &70189854579780 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 0.8.7
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70189854579780
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: cocaine
|
39
|
-
requirement: &
|
39
|
+
requirement: &70189854587160 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,21 +44,21 @@ dependencies:
|
|
44
44
|
version: 0.2.0
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *70189854587160
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
50
|
-
requirement: &
|
49
|
+
name: rails
|
50
|
+
requirement: &70189854586660 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
56
|
-
type: :
|
55
|
+
version: '2'
|
56
|
+
type: :runtime
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *70189854586660
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: rspec
|
61
|
-
requirement: &
|
61
|
+
requirement: &70189854585900 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ~>
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: 2.6.0
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *70189854585900
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: cucumber
|
72
|
-
requirement: &
|
72
|
+
requirement: &70189854585180 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: 1.0.2
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *70189854585180
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: aruba
|
83
|
-
requirement: &
|
83
|
+
requirement: &70189854584680 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ~>
|
@@ -88,10 +88,10 @@ dependencies:
|
|
88
88
|
version: 0.4.3
|
89
89
|
type: :development
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *70189854584680
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
93
|
name: jammit
|
94
|
-
requirement: &
|
94
|
+
requirement: &70189854584080 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
97
97
|
- - ~>
|
@@ -99,21 +99,10 @@ dependencies:
|
|
99
99
|
version: 0.6.3
|
100
100
|
type: :development
|
101
101
|
prerelease: false
|
102
|
-
version_requirements: *
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: less
|
105
|
-
requirement: &70235434204700 !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
|
-
requirements:
|
108
|
-
- - ~>
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '2.0'
|
111
|
-
type: :development
|
112
|
-
prerelease: false
|
113
|
-
version_requirements: *70235434204700
|
102
|
+
version_requirements: *70189854584080
|
114
103
|
- !ruby/object:Gem::Dependency
|
115
104
|
name: bourne
|
116
|
-
requirement: &
|
105
|
+
requirement: &70189854583560 !ruby/object:Gem::Requirement
|
117
106
|
none: false
|
118
107
|
requirements:
|
119
108
|
- - ! '>='
|
@@ -121,10 +110,10 @@ dependencies:
|
|
121
110
|
version: '0'
|
122
111
|
type: :development
|
123
112
|
prerelease: false
|
124
|
-
version_requirements: *
|
113
|
+
version_requirements: *70189854583560
|
125
114
|
- !ruby/object:Gem::Dependency
|
126
115
|
name: simplecov
|
127
|
-
requirement: &
|
116
|
+
requirement: &70189854580720 !ruby/object:Gem::Requirement
|
128
117
|
none: false
|
129
118
|
requirements:
|
130
119
|
- - ! '>='
|
@@ -132,7 +121,7 @@ dependencies:
|
|
132
121
|
version: '0'
|
133
122
|
type: :development
|
134
123
|
prerelease: false
|
135
|
-
version_requirements: *
|
124
|
+
version_requirements: *70189854580720
|
136
125
|
description: A well-tested script for easy deploying to Heroku
|
137
126
|
email:
|
138
127
|
- gabe@thoughtbot.com
|
@@ -151,19 +140,27 @@ files:
|
|
151
140
|
- README.md
|
152
141
|
- Rakefile
|
153
142
|
- bin/kumade
|
143
|
+
- features/git.feature
|
144
|
+
- features/jammit.feature
|
154
145
|
- features/kumade_executable.feature
|
155
146
|
- features/kumade_without_jammit.feature
|
147
|
+
- features/no_op_packager.feature
|
156
148
|
- features/railtie.feature
|
149
|
+
- features/rake_task_before_asset_compilation.feature
|
157
150
|
- features/step_definitions/bundler_steps.rb
|
158
|
-
- features/step_definitions/dependency_steps.rb
|
159
151
|
- features/step_definitions/git_steps.rb
|
152
|
+
- features/step_definitions/jammit_steps.rb
|
160
153
|
- features/step_definitions/kumade_steps.rb
|
161
154
|
- features/step_definitions/rails_steps.rb
|
162
155
|
- features/step_definitions/rake_steps.rb
|
163
156
|
- features/support/bundler.rb
|
157
|
+
- features/support/disable_bundler.rb
|
164
158
|
- features/support/env.rb
|
159
|
+
- features/support/git.rb
|
165
160
|
- features/support/git_remotes.rb
|
161
|
+
- features/support/jammit.rb
|
166
162
|
- features/support/project_path.rb
|
163
|
+
- features/support/rails.rb
|
167
164
|
- kumade.gemspec
|
168
165
|
- lib/kumade.rb
|
169
166
|
- lib/kumade/cli.rb
|
@@ -213,38 +210,40 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
213
210
|
- - ! '>='
|
214
211
|
- !ruby/object:Gem::Version
|
215
212
|
version: '0'
|
216
|
-
segments:
|
217
|
-
- 0
|
218
|
-
hash: 216053856628192471
|
219
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
214
|
none: false
|
221
215
|
requirements:
|
222
216
|
- - ! '>='
|
223
217
|
- !ruby/object:Gem::Version
|
224
218
|
version: '0'
|
225
|
-
segments:
|
226
|
-
- 0
|
227
|
-
hash: 216053856628192471
|
228
219
|
requirements: []
|
229
220
|
rubyforge_project:
|
230
|
-
rubygems_version: 1.8.
|
221
|
+
rubygems_version: 1.8.10
|
231
222
|
signing_key:
|
232
223
|
specification_version: 3
|
233
224
|
summary: A well-tested script for easy deploying to Heroku
|
234
225
|
test_files:
|
226
|
+
- features/git.feature
|
227
|
+
- features/jammit.feature
|
235
228
|
- features/kumade_executable.feature
|
236
229
|
- features/kumade_without_jammit.feature
|
230
|
+
- features/no_op_packager.feature
|
237
231
|
- features/railtie.feature
|
232
|
+
- features/rake_task_before_asset_compilation.feature
|
238
233
|
- features/step_definitions/bundler_steps.rb
|
239
|
-
- features/step_definitions/dependency_steps.rb
|
240
234
|
- features/step_definitions/git_steps.rb
|
235
|
+
- features/step_definitions/jammit_steps.rb
|
241
236
|
- features/step_definitions/kumade_steps.rb
|
242
237
|
- features/step_definitions/rails_steps.rb
|
243
238
|
- features/step_definitions/rake_steps.rb
|
244
239
|
- features/support/bundler.rb
|
240
|
+
- features/support/disable_bundler.rb
|
245
241
|
- features/support/env.rb
|
242
|
+
- features/support/git.rb
|
246
243
|
- features/support/git_remotes.rb
|
244
|
+
- features/support/jammit.rb
|
247
245
|
- features/support/project_path.rb
|
246
|
+
- features/support/rails.rb
|
248
247
|
- spec/kumade/cli_spec.rb
|
249
248
|
- spec/kumade/command_line_spec.rb
|
250
249
|
- spec/kumade/configuration_spec.rb
|