recap 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. data/.gitignore +2 -1
  2. data/README.md +55 -10
  3. data/Rakefile +19 -5
  4. data/bin/recap +2 -2
  5. data/features/managing-processes.feature +1 -1
  6. data/features/setting-environment-variables.feature +26 -1
  7. data/features/steps/capistrano_steps.rb +10 -6
  8. data/features/support/project.rb +24 -5
  9. data/features/templates/project/Capfile.erb +1 -1
  10. data/lib/recap/recipes/rails.rb +6 -0
  11. data/lib/recap/recipes/ruby.rb +11 -0
  12. data/lib/recap/recipes/static.rb +3 -0
  13. data/lib/recap/recipes.rb +18 -0
  14. data/lib/recap/support/capistrano_extensions.rb +85 -0
  15. data/lib/recap/support/cli.rb +57 -0
  16. data/lib/recap/{compatibility.rb → support/compatibility.rb} +2 -2
  17. data/lib/recap/support/environment.rb +61 -0
  18. data/lib/recap/support/namespace.rb +47 -0
  19. data/lib/recap/support/shell_command.rb +35 -0
  20. data/lib/recap/support/templates/Capfile.erb +6 -0
  21. data/lib/recap/tasks/bootstrap.rb +77 -0
  22. data/lib/recap/{bundler.rb → tasks/bundler.rb} +15 -6
  23. data/lib/recap/{deploy.rb → tasks/deploy.rb} +30 -17
  24. data/lib/recap/tasks/env.rb +111 -0
  25. data/lib/recap/{foreman.rb → tasks/foreman.rb} +20 -12
  26. data/lib/recap/{preflight.rb → tasks/preflight.rb} +13 -11
  27. data/lib/recap/tasks/rails.rb +42 -0
  28. data/lib/recap/tasks.rb +16 -0
  29. data/lib/recap/version.rb +1 -1
  30. data/lib/recap.rb +119 -10
  31. data/recap.gemspec +3 -2
  32. data/spec/models/capistrano_extensions_spec.rb +41 -0
  33. data/spec/models/cli_spec.rb +25 -0
  34. data/spec/models/environment_spec.rb +14 -14
  35. data/spec/models/shell_command_spec.rb +55 -0
  36. data/spec/spec_helper.rb +1 -1
  37. data/spec/tasks/bootstrap_spec.rb +9 -13
  38. data/spec/tasks/bundler_spec.rb +39 -7
  39. data/spec/tasks/deploy_spec.rb +42 -26
  40. data/spec/tasks/env_spec.rb +81 -5
  41. data/spec/tasks/foreman_spec.rb +10 -5
  42. data/spec/tasks/rails_spec.rb +80 -0
  43. metadata +65 -57
  44. data/doc/index.html +0 -235
  45. data/doc/lib/recap/bootstrap.html +0 -42
  46. data/doc/lib/recap/bundler.html +0 -168
  47. data/doc/lib/recap/capistrano_extensions.html +0 -208
  48. data/doc/lib/recap/cli.html +0 -42
  49. data/doc/lib/recap/compatibility.html +0 -73
  50. data/doc/lib/recap/deploy.html +0 -328
  51. data/doc/lib/recap/env.html +0 -108
  52. data/doc/lib/recap/foreman.html +0 -42
  53. data/doc/lib/recap/namespace.html +0 -42
  54. data/doc/lib/recap/preflight.html +0 -163
  55. data/doc/lib/recap/rails.html +0 -42
  56. data/doc/lib/recap/version.html +0 -42
  57. data/doc/lib/recap.html +0 -42
  58. data/index.rb +0 -62
  59. data/lib/recap/bootstrap.rb +0 -47
  60. data/lib/recap/capistrano_extensions.rb +0 -74
  61. data/lib/recap/cli.rb +0 -32
  62. data/lib/recap/deploy/templates/Capfile.erb +0 -6
  63. data/lib/recap/env.rb +0 -58
  64. data/lib/recap/environment.rb +0 -54
  65. data/lib/recap/namespace.rb +0 -37
  66. data/lib/recap/rails.rb +0 -24
  67. data/lib/recap/ruby.rb +0 -3
  68. data/lib/recap/static.rb +0 -1
@@ -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
@@ -1,3 +0,0 @@
1
- require 'recap/deploy'
2
- require 'recap/bundler'
3
- require 'recap/foreman'
data/lib/recap/static.rb DELETED
@@ -1 +0,0 @@
1
- require 'recap/deploy'