recap 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/README.md +55 -10
- data/Rakefile +19 -5
- data/bin/recap +2 -2
- data/features/managing-processes.feature +1 -1
- data/features/setting-environment-variables.feature +26 -1
- data/features/steps/capistrano_steps.rb +10 -6
- data/features/support/project.rb +24 -5
- data/features/templates/project/Capfile.erb +1 -1
- data/lib/recap/recipes/rails.rb +6 -0
- data/lib/recap/recipes/ruby.rb +11 -0
- data/lib/recap/recipes/static.rb +3 -0
- data/lib/recap/recipes.rb +18 -0
- data/lib/recap/support/capistrano_extensions.rb +85 -0
- data/lib/recap/support/cli.rb +57 -0
- data/lib/recap/{compatibility.rb → support/compatibility.rb} +2 -2
- data/lib/recap/support/environment.rb +61 -0
- data/lib/recap/support/namespace.rb +47 -0
- data/lib/recap/support/shell_command.rb +35 -0
- data/lib/recap/support/templates/Capfile.erb +6 -0
- data/lib/recap/tasks/bootstrap.rb +77 -0
- data/lib/recap/{bundler.rb → tasks/bundler.rb} +15 -6
- data/lib/recap/{deploy.rb → tasks/deploy.rb} +30 -17
- data/lib/recap/tasks/env.rb +111 -0
- data/lib/recap/{foreman.rb → tasks/foreman.rb} +20 -12
- data/lib/recap/{preflight.rb → tasks/preflight.rb} +13 -11
- data/lib/recap/tasks/rails.rb +42 -0
- data/lib/recap/tasks.rb +16 -0
- data/lib/recap/version.rb +1 -1
- data/lib/recap.rb +119 -10
- data/recap.gemspec +3 -2
- data/spec/models/capistrano_extensions_spec.rb +41 -0
- data/spec/models/cli_spec.rb +25 -0
- data/spec/models/environment_spec.rb +14 -14
- data/spec/models/shell_command_spec.rb +55 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/tasks/bootstrap_spec.rb +9 -13
- data/spec/tasks/bundler_spec.rb +39 -7
- data/spec/tasks/deploy_spec.rb +42 -26
- data/spec/tasks/env_spec.rb +81 -5
- data/spec/tasks/foreman_spec.rb +10 -5
- data/spec/tasks/rails_spec.rb +80 -0
- metadata +65 -57
- data/doc/index.html +0 -235
- data/doc/lib/recap/bootstrap.html +0 -42
- data/doc/lib/recap/bundler.html +0 -168
- data/doc/lib/recap/capistrano_extensions.html +0 -208
- data/doc/lib/recap/cli.html +0 -42
- data/doc/lib/recap/compatibility.html +0 -73
- data/doc/lib/recap/deploy.html +0 -328
- data/doc/lib/recap/env.html +0 -108
- data/doc/lib/recap/foreman.html +0 -42
- data/doc/lib/recap/namespace.html +0 -42
- data/doc/lib/recap/preflight.html +0 -163
- data/doc/lib/recap/rails.html +0 -42
- data/doc/lib/recap/version.html +0 -42
- data/doc/lib/recap.html +0 -42
- data/index.rb +0 -62
- data/lib/recap/bootstrap.rb +0 -47
- data/lib/recap/capistrano_extensions.rb +0 -74
- data/lib/recap/cli.rb +0 -32
- data/lib/recap/deploy/templates/Capfile.erb +0 -6
- data/lib/recap/env.rb +0 -58
- data/lib/recap/environment.rb +0 -54
- data/lib/recap/namespace.rb +0 -37
- data/lib/recap/rails.rb +0 -24
- data/lib/recap/ruby.rb +0 -3
- data/lib/recap/static.rb +0 -1
data/lib/recap/namespace.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'capistrano'
|
2
|
-
require 'recap/capistrano_extensions'
|
3
|
-
|
4
|
-
module Recap::Namespace
|
5
|
-
def self.default_config
|
6
|
-
@default_config
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.default_config=(config)
|
10
|
-
@default_config = config
|
11
|
-
end
|
12
|
-
|
13
|
-
if Capistrano::Configuration.instance
|
14
|
-
self.default_config = Capistrano::Configuration.instance(:must_exist)
|
15
|
-
end
|
16
|
-
|
17
|
-
def capistrano_definitions
|
18
|
-
@capistrano_definitions ||= []
|
19
|
-
end
|
20
|
-
|
21
|
-
def namespace(name, &block)
|
22
|
-
capistrano_definitions << Proc.new do
|
23
|
-
namespace name do
|
24
|
-
instance_eval(&block)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
load_into(Recap::Namespace.default_config) if Recap::Namespace.default_config
|
29
|
-
end
|
30
|
-
|
31
|
-
def load_into(configuration)
|
32
|
-
configuration.extend(self)
|
33
|
-
capistrano_definitions.each do |definition|
|
34
|
-
configuration.load(&definition)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
data/lib/recap/rails.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'recap/deploy'
|
2
|
-
|
3
|
-
module Recap::Rails
|
4
|
-
extend Recap::Namespace
|
5
|
-
|
6
|
-
namespace :rails do
|
7
|
-
namespace :db do
|
8
|
-
task :load_schema do
|
9
|
-
if deployed_file_exists?("db/schema.rb")
|
10
|
-
as_app './bin/rake db:create db:schema:load'
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
task :migrate do
|
15
|
-
if deployed_file_changed?("db/schema.rb")
|
16
|
-
as_app './bin/rake db:migrate'
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
after "deploy:clone_code", "rails:db:load_schema"
|
22
|
-
after "deploy:update_code", "rails:db:migrate"
|
23
|
-
end
|
24
|
-
end
|
data/lib/recap/ruby.rb
DELETED
data/lib/recap/static.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'recap/deploy'
|