kelredd-useful 0.1.8.5 → 0.1.9

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.
@@ -1,11 +1,14 @@
1
1
  Capistrano::Configuration.instance.load do
2
2
  namespace :gems do
3
-
3
+
4
4
  desc "Update code, run 'rake gems:install'"
5
- task :install, :roles => :app do
5
+ task :install, :roles => fetch(:install_roles, :app) do
6
6
  deploy.update_code
7
- run "cd #{current_release}; sudo #{fetch(:rake, "rake")} #{"RAILS_ENV=#{rails_env}" if defined?(rails_env)} gems:install"
7
+ run_with_password("sudo #{fetch(:rake, "rake")} -f #{current_release}/Rakefile #{"RAILS_ENV=#{rails_env}" if rails_env} #{fetch(:gems, "gems")}:install", {
8
+ :prompt => "Enter sudo pw: ",
9
+ :pty => false
10
+ })
8
11
  end
9
-
10
- end
12
+
13
+ end
11
14
  end
@@ -1,12 +1,11 @@
1
- def run_with_password(cmd, prompt = 'Password: ', confirmation = "Running '#{cmd}'", password = nil)
2
- with_env("LC_ALL", "C") {
3
- run cmd do |ch, stream, out|
4
- password ||= Capistrano::CLI.password_prompt(prompt)
5
- ch.send_data(password)
6
- ch.send_data("\n")
7
- log confirmation
8
- end
9
- }
1
+ def run_with_password(cmd, options={})
2
+ prompt = options.delete(:prompt) || 'Password: '
3
+ password = options.delete(:password)
4
+ log (options.delete(:confirmation) || "Running: '#{cmd}'")
5
+ password ||= Capistrano::CLI.password_prompt(prompt)
6
+ run cmd, options do |ch, stream, out|
7
+ ch.send_data(password+"\n")
8
+ end
10
9
  password
11
10
  end
12
11
 
@@ -3,11 +3,10 @@ module Useful
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- TINY = 8
7
- FIX = 5
6
+ TINY = 9
8
7
 
9
8
  def self.to_s # :nodoc:
10
- [MAJOR, MINOR, TINY, FIX].join('.')
9
+ [MAJOR, MINOR, TINY].join('.')
11
10
  end
12
11
 
13
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kelredd-useful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.5
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelredd
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-21 00:00:00 -07:00
12
+ date: 2009-06-23 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15