kelredd-useful 0.1.8.1 → 0.1.8.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.
| 
         @@ -0,0 +1,11 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Capistrano::Configuration.instance.load do
         
     | 
| 
      
 2 
     | 
    
         
            +
              namespace :cache do
         
     | 
| 
      
 3 
     | 
    
         
            +
              
         
     | 
| 
      
 4 
     | 
    
         
            +
                desc "Update code, run 'rake gems:install'"
         
     | 
| 
      
 5 
     | 
    
         
            +
                task :install, :roles => :app do
         
     | 
| 
      
 6 
     | 
    
         
            +
                  deploy.update_code
         
     | 
| 
      
 7 
     | 
    
         
            +
                  run "cd #{current_release}; sudo #{fetch(:rake, "rake")} #{"RAILS_ENV=#{rails_env}" if defined?(rails_env)} gems:install"
         
     | 
| 
      
 8 
     | 
    
         
            +
                end
         
     | 
| 
      
 9 
     | 
    
         
            +
              
         
     | 
| 
      
 10 
     | 
    
         
            +
              end  
         
     | 
| 
      
 11 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,11 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Capistrano::Configuration.instance.load do
         
     | 
| 
      
 2 
     | 
    
         
            +
              namespace :gems do
         
     | 
| 
      
 3 
     | 
    
         
            +
              
         
     | 
| 
      
 4 
     | 
    
         
            +
                desc "Update code, run 'rake gems:install'"
         
     | 
| 
      
 5 
     | 
    
         
            +
                task :install, :roles => :app do
         
     | 
| 
      
 6 
     | 
    
         
            +
                  deploy.update_code
         
     | 
| 
      
 7 
     | 
    
         
            +
                  run "cd #{current_release}; sudo #{fetch(:rake, "rake")} #{"RAILS_ENV=#{rails_env}" if defined?(rails_env)} gems:install"
         
     | 
| 
      
 8 
     | 
    
         
            +
                end
         
     | 
| 
      
 9 
     | 
    
         
            +
              
         
     | 
| 
      
 10 
     | 
    
         
            +
              end  
         
     | 
| 
      
 11 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,35 @@ 
     | 
|
| 
      
 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 
     | 
    
         
            +
              }
         
     | 
| 
      
 10 
     | 
    
         
            +
              password
         
     | 
| 
      
 11 
     | 
    
         
            +
            end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            def run_locally(cmd)
         
     | 
| 
      
 14 
     | 
    
         
            +
              log cmd
         
     | 
| 
      
 15 
     | 
    
         
            +
              resp = `#{cmd}` rescue nil
         
     | 
| 
      
 16 
     | 
    
         
            +
              log resp
         
     | 
| 
      
 17 
     | 
    
         
            +
            end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            def log(msg, opts = {})
         
     | 
| 
      
 20 
     | 
    
         
            +
              if opts[:force]
         
     | 
| 
      
 21 
     | 
    
         
            +
                puts " ** #{msg}"
         
     | 
| 
      
 22 
     | 
    
         
            +
              else
         
     | 
| 
      
 23 
     | 
    
         
            +
                logger.info(msg)
         
     | 
| 
      
 24 
     | 
    
         
            +
              end
         
     | 
| 
      
 25 
     | 
    
         
            +
            end
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            def total_time_in_values(total_time)
         
     | 
| 
      
 28 
     | 
    
         
            +
              total_time = total_time.round
         
     | 
| 
      
 29 
     | 
    
         
            +
              values = Hash.new
         
     | 
| 
      
 30 
     | 
    
         
            +
              values[:minutes] = (total_time) / (60)
         
     | 
| 
      
 31 
     | 
    
         
            +
              values[:seconds] = total_time - values[:minutes]*60
         
     | 
| 
      
 32 
     | 
    
         
            +
              values
         
     | 
| 
      
 33 
     | 
    
         
            +
            end
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
    
        data/lib/useful/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.8.2
         
     | 
| 
       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- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2009-06-20 00:00:00 -07:00
         
     | 
| 
       13 
13 
     | 
    
         
             
            default_executable: 
         
     | 
| 
       14 
14 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
         @@ -29,9 +29,9 @@ files: 
     | 
|
| 
       29 
29 
     | 
    
         
             
            - lib/useful/active_record_helpers/mysql_migration_helpers.rb
         
     | 
| 
       30 
30 
     | 
    
         
             
            - lib/useful/active_record_helpers.rb
         
     | 
| 
       31 
31 
     | 
    
         
             
            - lib/useful/cap_tasks
         
     | 
| 
       32 
     | 
    
         
            -
            - lib/useful/cap_tasks/ 
     | 
| 
       33 
     | 
    
         
            -
            - lib/useful/cap_tasks/ 
     | 
| 
       34 
     | 
    
         
            -
            - lib/useful/cap_tasks/ 
     | 
| 
      
 32 
     | 
    
         
            +
            - lib/useful/cap_tasks/cache.rb
         
     | 
| 
      
 33 
     | 
    
         
            +
            - lib/useful/cap_tasks/gems.rb
         
     | 
| 
      
 34 
     | 
    
         
            +
            - lib/useful/cap_tasks/globals.rb
         
     | 
| 
       35 
35 
     | 
    
         
             
            - lib/useful/cap_tasks.rb
         
     | 
| 
       36 
36 
     | 
    
         
             
            - lib/useful/rails_extensions
         
     | 
| 
       37 
37 
     | 
    
         
             
            - lib/useful/rails_extensions/environment_tests.rb
         
     | 
| 
         @@ -1,14 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            Capistrano::Configuration.instance.load do
         
     | 
| 
       2 
     | 
    
         
            -
              namespace :gems do
         
     | 
| 
       3 
     | 
    
         
            -
              
         
     | 
| 
       4 
     | 
    
         
            -
                desc "Update code, run rails 'rake gems:install'"
         
     | 
| 
       5 
     | 
    
         
            -
                task :install, :roles => :app do
         
     | 
| 
       6 
     | 
    
         
            -
                  rake = fetch(:rake, "rake")
         
     | 
| 
       7 
     | 
    
         
            -
                  rails_env = fetch(:rails_env, "production")
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
                  deploy.update_code
         
     | 
| 
       10 
     | 
    
         
            -
                  run "cd #{current_release}; #{rake} RAILS_ENV=#{rails_env} gems:install", :pty => false
         
     | 
| 
       11 
     | 
    
         
            -
                end
         
     | 
| 
       12 
     | 
    
         
            -
              
         
     | 
| 
       13 
     | 
    
         
            -
              end  
         
     | 
| 
       14 
     | 
    
         
            -
            end
         
     |