capistrano_kvm_git 1.0.0
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/Manifest +4 -0
- data/README +0 -0
- data/Rakefile +14 -0
- data/capistrano_kvm_git.gemspec +30 -0
- data/lib/capistrano/recipes/deploy/scm/kvm_git.rb +32 -0
- metadata +75 -0
    
        data/Manifest
    ADDED
    
    
    
        data/README
    ADDED
    
    | 
            File without changes
         | 
    
        data/Rakefile
    ADDED
    
    | @@ -0,0 +1,14 @@ | |
| 1 | 
            +
            require 'rubygems'
         | 
| 2 | 
            +
            require 'rake'
         | 
| 3 | 
            +
            require 'echoe'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            Echoe.new('capistrano_kvm_git', '1.0.0') do |p|
         | 
| 6 | 
            +
              p.description    = "Capistrano KVM Git"
         | 
| 7 | 
            +
              p.url            = "http://github.com/sloanwu/capistrano_kvm_git.git"
         | 
| 8 | 
            +
              p.author         = "Philip"
         | 
| 9 | 
            +
              p.email          = ""
         | 
| 10 | 
            +
              p.ignore_pattern = ["tmp/*", "script/*"]
         | 
| 11 | 
            +
              p.development_dependencies = []
         | 
| 12 | 
            +
            end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
            Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
         | 
| @@ -0,0 +1,30 @@ | |
| 1 | 
            +
            # -*- encoding: utf-8 -*-
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            Gem::Specification.new do |s|
         | 
| 4 | 
            +
              s.name = %q{capistrano_kvm_git}
         | 
| 5 | 
            +
              s.version = "1.0.0"
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
         | 
| 8 | 
            +
              s.authors = ["Philip"]
         | 
| 9 | 
            +
              s.date = %q{2010-10-14}
         | 
| 10 | 
            +
              s.description = %q{Capistrano KVM Git}
         | 
| 11 | 
            +
              s.email = %q{}
         | 
| 12 | 
            +
              s.extra_rdoc_files = ["README", "lib/capistrano/recipes/deploy/scm/kvm_git.rb"]
         | 
| 13 | 
            +
              s.files = ["Manifest", "README", "Rakefile", "lib/capistrano/recipes/deploy/scm/kvm_git.rb", "capistrano_kvm_git.gemspec"]
         | 
| 14 | 
            +
              s.homepage = %q{http://github.com/sloanwu/capistrano_kvm_git.git}
         | 
| 15 | 
            +
              s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Capistrano_kvm_git", "--main", "README"]
         | 
| 16 | 
            +
              s.require_paths = ["lib"]
         | 
| 17 | 
            +
              s.rubyforge_project = %q{capistrano_kvm_git}
         | 
| 18 | 
            +
              s.rubygems_version = %q{1.3.7}
         | 
| 19 | 
            +
              s.summary = %q{Capistrano KVM Git}
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              if s.respond_to? :specification_version then
         | 
| 22 | 
            +
                current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
         | 
| 23 | 
            +
                s.specification_version = 3
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
         | 
| 26 | 
            +
                else
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
              else
         | 
| 29 | 
            +
              end
         | 
| 30 | 
            +
            end
         | 
| @@ -0,0 +1,32 @@ | |
| 1 | 
            +
            require 'capistrano/recipes/deploy/scm/git'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Capistrano
         | 
| 4 | 
            +
              module Deploy
         | 
| 5 | 
            +
                module SCM
         | 
| 6 | 
            +
                  class KvmGit < Git
         | 
| 7 | 
            +
            				def command
         | 
| 8 | 
            +
                      "git"
         | 
| 9 | 
            +
                    end
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                    def query_revision(revision)
         | 
| 12 | 
            +
                      raise ArgumentError, "Deploying remote branches is no longer supported.  Specify the remote branch as a local branch for the git repository you're deploying from (ie: '#{revision.gsub('origin/', '')}' rather than '#{revision}')." if revision =~ /^origin\//
         | 
| 13 | 
            +
                      return revision if revision =~ /^[0-9a-f]{40}$/
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                      command = scm('ls-remote', variable(:remote_repository), revision)
         | 
| 16 | 
            +
                      result = yield(command)
         | 
| 17 | 
            +
                      revdata = result.split(/[\t\n]/)
         | 
| 18 | 
            +
                      newrev = nil
         | 
| 19 | 
            +
                      revdata.each_slice(2) do |refs|
         | 
| 20 | 
            +
                        rev, ref = *refs
         | 
| 21 | 
            +
                        if ref.sub(/refs\/.*?\//, '').strip == revision.to_s
         | 
| 22 | 
            +
                          newrev = rev
         | 
| 23 | 
            +
                          break
         | 
| 24 | 
            +
                        end
         | 
| 25 | 
            +
                      end
         | 
| 26 | 
            +
                      raise "Unable to resolve revision for '#{revision}' on repository '#{repository}'." unless newrev =~ /^[0-9a-f]{40}$/
         | 
| 27 | 
            +
                      return newrev
         | 
| 28 | 
            +
                    end 
         | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
              end
         | 
| 32 | 
            +
            end
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,75 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification 
         | 
| 2 | 
            +
            name: capistrano_kvm_git
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            +
              prerelease: false
         | 
| 5 | 
            +
              segments: 
         | 
| 6 | 
            +
              - 1
         | 
| 7 | 
            +
              - 0
         | 
| 8 | 
            +
              - 0
         | 
| 9 | 
            +
              version: 1.0.0
         | 
| 10 | 
            +
            platform: ruby
         | 
| 11 | 
            +
            authors: 
         | 
| 12 | 
            +
            - Philip
         | 
| 13 | 
            +
            autorequire: 
         | 
| 14 | 
            +
            bindir: bin
         | 
| 15 | 
            +
            cert_chain: []
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            date: 2010-10-14 00:00:00 +08:00
         | 
| 18 | 
            +
            default_executable: 
         | 
| 19 | 
            +
            dependencies: []
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            description: Capistrano KVM Git
         | 
| 22 | 
            +
            email: ""
         | 
| 23 | 
            +
            executables: []
         | 
| 24 | 
            +
             | 
| 25 | 
            +
            extensions: []
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            extra_rdoc_files: 
         | 
| 28 | 
            +
            - README
         | 
| 29 | 
            +
            - lib/capistrano/recipes/deploy/scm/kvm_git.rb
         | 
| 30 | 
            +
            files: 
         | 
| 31 | 
            +
            - Manifest
         | 
| 32 | 
            +
            - README
         | 
| 33 | 
            +
            - Rakefile
         | 
| 34 | 
            +
            - lib/capistrano/recipes/deploy/scm/kvm_git.rb
         | 
| 35 | 
            +
            - capistrano_kvm_git.gemspec
         | 
| 36 | 
            +
            has_rdoc: true
         | 
| 37 | 
            +
            homepage: http://github.com/sloanwu/capistrano_kvm_git.git
         | 
| 38 | 
            +
            licenses: []
         | 
| 39 | 
            +
             | 
| 40 | 
            +
            post_install_message: 
         | 
| 41 | 
            +
            rdoc_options: 
         | 
| 42 | 
            +
            - --line-numbers
         | 
| 43 | 
            +
            - --inline-source
         | 
| 44 | 
            +
            - --title
         | 
| 45 | 
            +
            - Capistrano_kvm_git
         | 
| 46 | 
            +
            - --main
         | 
| 47 | 
            +
            - README
         | 
| 48 | 
            +
            require_paths: 
         | 
| 49 | 
            +
            - lib
         | 
| 50 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement 
         | 
| 51 | 
            +
              none: false
         | 
| 52 | 
            +
              requirements: 
         | 
| 53 | 
            +
              - - ">="
         | 
| 54 | 
            +
                - !ruby/object:Gem::Version 
         | 
| 55 | 
            +
                  segments: 
         | 
| 56 | 
            +
                  - 0
         | 
| 57 | 
            +
                  version: "0"
         | 
| 58 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement 
         | 
| 59 | 
            +
              none: false
         | 
| 60 | 
            +
              requirements: 
         | 
| 61 | 
            +
              - - ">="
         | 
| 62 | 
            +
                - !ruby/object:Gem::Version 
         | 
| 63 | 
            +
                  segments: 
         | 
| 64 | 
            +
                  - 1
         | 
| 65 | 
            +
                  - 2
         | 
| 66 | 
            +
                  version: "1.2"
         | 
| 67 | 
            +
            requirements: []
         | 
| 68 | 
            +
             | 
| 69 | 
            +
            rubyforge_project: capistrano_kvm_git
         | 
| 70 | 
            +
            rubygems_version: 1.3.7
         | 
| 71 | 
            +
            signing_key: 
         | 
| 72 | 
            +
            specification_version: 3
         | 
| 73 | 
            +
            summary: Capistrano KVM Git
         | 
| 74 | 
            +
            test_files: []
         | 
| 75 | 
            +
             |