fdlcap 0.3.29 → 0.3.30

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.3.29
1
+ 0.3.30
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.3.29"
8
+ s.version = "0.3.30"
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"]
12
- s.date = %q{2009-10-09}
12
+ s.date = %q{2009-10-13}
13
13
  s.default_executable = %q{fdlcap}
14
14
  s.email = %q{interactive@factorylabs.com}
15
15
  s.executables = ["fdlcap"]
@@ -45,9 +45,15 @@ class Capistrano::Configuration
45
45
  puts cmd
46
46
  puts options
47
47
  success = false
48
- invoke_command("if [#{cmd}]; then echo exists; else echo not_found; fi", options) do |ch, stream, out|
48
+ if options[:check_exit_code]
49
+ command = "#{cmd}; if [ $? = 0 ]; then echo pass; else echo fail; fi"
50
+
51
+ else
52
+ command = "if [#{cmd}]; then echo pass; else echo fail; fi"
53
+ end
54
+ invoke_command(command, options) do |ch, stream, out|
49
55
  warn "#{ch[:server]}: #{out}" if stream == :err
50
- success = out.strip == 'exists' ? true : false
56
+ success = out.strip == 'pass' ? true : false
51
57
  break if stream == :err
52
58
  end
53
59
  success
@@ -1,7 +1,8 @@
1
1
  Capistrano::Configuration.instance(:must_exist).load do
2
2
  define_recipe :geminstaller do |*sources|
3
- gem_sources = sources || ['http://gems.github.com', 'http://gemcutter.org']
4
- set :gem_sources, gem_sources.flatten unless exists?(:gem_sources) && !gem_sources.empty?
3
+ DEFAULT_GEM_SOURCES = ['http://gems.github.com', 'http://gemcutter.org']
4
+
5
+ set :gem_sources, (sources + DEFAULT_GEM_SOURCES).flatten unless exists?(:gem_sources)
5
6
 
6
7
  #
7
8
  # Tasks
@@ -45,10 +46,12 @@ Capistrano::Configuration.instance(:must_exist).load do
45
46
  task :source_gem_servers, :only => { :geminstaller => true } do
46
47
  as = fetch(:runner, "app")
47
48
  via = fetch(:run_method, :sudo)
49
+
50
+ puts "Checking gem sources => #{gem_sources.inspect}"
48
51
  gem_sources.each do |source|
49
52
  puts source
50
- unless check("gem source | grep '#{source}' = '#{source}'", :via => via, :as => as)
51
- invoke_command "gem source -a #{source}", :via => via, :as => as
53
+ unless check("gem source | grep -q '#{source}'", :via => via, :as => as, :check_exit_code => true)
54
+ sudo "gem source -a #{source}"
52
55
  end
53
56
  end
54
57
  end
@@ -56,7 +59,7 @@ Capistrano::Configuration.instance(:must_exist).load do
56
59
  #
57
60
  # Callbacks
58
61
  #
59
- before "deploy:check", "geminstaller:add_remote_gem_dependencies"
62
+ before "deploy:check", "geminstaller:add_remote_gem_dependencies"
60
63
  after "deploy:setup", "geminstaller:install"
61
64
  after "geminstaller:install", "geminstaller:run"
62
65
  after "deploy:update", "geminstaller:run"
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.3.29
4
+ version: 0.3.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Factory Design Labs
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-09 00:00:00 -06:00
12
+ date: 2009-10-13 00:00:00 -06:00
13
13
  default_executable: fdlcap
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency