fdlcap 0.4.0 → 0.4.2

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 CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.2
data/fdlcap.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fdlcap}
8
- s.version = "0.4.0"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Factory Design Labs", "Gabe Varela", "Jay Zeschin"]
12
- s.date = %q{2010-01-11}
12
+ s.date = %q{2010-01-14}
13
13
  s.default_executable = %q{fdlcap}
14
14
  s.email = %q{interactive@factorylabs.com}
15
15
  s.executables = ["fdlcap"]
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
30
30
  "features/step_definitions/fdlcap_steps.rb",
31
31
  "features/support/env.rb",
32
32
  "lib/fdlcap.rb",
33
+ "lib/fdlcap/extensions/check_for_changes.rb",
33
34
  "lib/fdlcap/extensions/configuration.rb",
34
35
  "lib/fdlcap/extensions/recipe_definition.rb",
35
36
  "lib/fdlcap/recipes.rb",
@@ -0,0 +1,17 @@
1
+ Capistrano::Configuration.instance(:must_exist).load do
2
+
3
+ def look_for_db_changes
4
+ fetch(:db_changed?, nil) || set(:db_changed?) { check_for_changes('db/migrate') }
5
+ end
6
+
7
+ def look_for_stylesheet_changes
8
+ fetch(:stylesheets_changed?, nil) || set(:stylesheets_changed?) { check_for_changes('public/stylesheets') }
9
+ end
10
+
11
+ def check_for_changes(dir)
12
+ result = capture("cd #{current_release} && git diff-tree `cat #{previous_release}/REVISION` #{branch} -- #{dir} | wc -l").to_i > 0
13
+ puts "Looking for changes in #{dir}... [ #{result ? 'yes' : 'no'} ]"
14
+ result
15
+ end
16
+
17
+ end
@@ -1,7 +1,10 @@
1
1
  Capistrano::Configuration.instance(:must_exist).load do
2
2
 
3
3
  define_recipe :automigrate do
4
- after "deploy:update", "deploy:migrate"
4
+ after 'deploy:finalize_update' do
5
+ look_for_db_changes
6
+ after("deploy:symlink_configs", "deploy:migrate") if db_changed?
7
+ end
5
8
  end
6
9
 
7
10
  end
@@ -15,6 +15,9 @@ Capistrano::Configuration.instance(:must_exist).load do
15
15
  #
16
16
 
17
17
  # Generate all the stylesheets manually (from their Sass templates) before each restart.
18
- before 'deploy:restart', 'sass:update'
18
+ after 'deploy:finalize_update' do
19
+ look_for_stylesheet_changes
20
+ before('deploy:restart', 'sass:update') if stylesheets_changed?
21
+ end
19
22
  end
20
23
  end
@@ -3,9 +3,14 @@ Capistrano::Configuration.instance(:must_exist).load do
3
3
 
4
4
  # searchd assumes indexing and configuring being called directly on searchd
5
5
  define_recipe :thinking_sphinx do
6
- after "deploy:symlink_configs", "thinking_sphinx:symlink"
7
- after "deploy:migrate", "sphinx:configure"
8
- after "deploy:migrate", "sphinx:reindex"
6
+ after 'deploy:finalize_update' do
7
+ look_for_db_changes
8
+ if db_changed?
9
+ after "deploy:symlink_configs", "thinking_sphinx:symlink"
10
+ after "deploy:migrate", "sphinx:configure"
11
+ after "deploy:migrate", "sphinx:reindex"
12
+ end
13
+ end
9
14
  end
10
15
 
11
16
  end
@@ -1,6 +1,7 @@
1
1
  # Pull in cap extensions
2
2
  require 'fdlcap/extensions/configuration'
3
3
  require 'fdlcap/extensions/recipe_definition'
4
+ require 'fdlcap/extensions/check_for_changes'
4
5
 
5
6
  # Load external fdlcap dependencies
6
7
  require 'eycap/recipes'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fdlcap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Factory Design Labs
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2010-01-11 00:00:00 -07:00
14
+ date: 2010-01-14 00:00:00 -07:00
15
15
  default_executable: fdlcap
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -76,6 +76,7 @@ files:
76
76
  - features/step_definitions/fdlcap_steps.rb
77
77
  - features/support/env.rb
78
78
  - lib/fdlcap.rb
79
+ - lib/fdlcap/extensions/check_for_changes.rb
79
80
  - lib/fdlcap/extensions/configuration.rb
80
81
  - lib/fdlcap/extensions/recipe_definition.rb
81
82
  - lib/fdlcap/recipes.rb