capistrano-subset-fix 0.0.1

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5d1c065f00c528de099d885d4817f74ff81678f5
4
+ data.tar.gz: db0bad5249d7faa98080db93c21ec7be2dddf0c3
5
+ SHA512:
6
+ metadata.gz: 032e6dc8577afe3846051f72e9ca658b897c0543b73f3b425cb8d611e8614ec741389e74a6d3e168e7ab57c6e049c2778f1e6201434b693c7f28625560ad8c12
7
+ data.tar.gz: 31f12b071aadb12210f2d5266d9c79c6cd4de4cca8dabbda66226efab278148828aae12111492b52b976ba94b8b1b8560ed531f966474f6fbf321dcc85f98ebe
data/.gitignore ADDED
@@ -0,0 +1,16 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ InstalledFiles
7
+ _yardoc
8
+ coverage
9
+ doc/
10
+ lib/bundler/man
11
+ pkg
12
+ rdoc
13
+ spec/reports
14
+ test/tmp
15
+ test/version_tmp
16
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-subset-fix.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,32 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ capistrano-subset-fix (0.0.1)
5
+ capistrano (~> 2.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ capistrano (2.15.5)
11
+ highline
12
+ net-scp (>= 1.0.0)
13
+ net-sftp (>= 2.0.0)
14
+ net-ssh (>= 2.0.14)
15
+ net-ssh-gateway (>= 1.1.0)
16
+ highline (1.6.20)
17
+ net-scp (1.1.2)
18
+ net-ssh (>= 2.6.5)
19
+ net-sftp (2.1.2)
20
+ net-ssh (>= 2.6.5)
21
+ net-ssh (2.8.0)
22
+ net-ssh-gateway (1.2.0)
23
+ net-ssh (>= 2.6.5)
24
+ rake (10.1.1)
25
+
26
+ PLATFORMS
27
+ ruby
28
+
29
+ DEPENDENCIES
30
+ bundler (~> 1.3)
31
+ capistrano-subset-fix!
32
+ rake
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 LI Daobing
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Capistrano::Subset::Fix
2
+
3
+ fix capistrano block when use max_hosts.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'capistrano-subset-fix'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install capistrano-subset-fix
18
+
19
+ ## Usage
20
+
21
+ ```ruby
22
+ require 'capistrano-scm-jenkins'
23
+ ```
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/subset/fix/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "capistrano-subset-fix"
8
+ spec.version = Capistrano::Subset::Fix::VERSION
9
+ spec.authors = ["LI Daobing"]
10
+ spec.email = ["lidaobing@gmail.com"]
11
+ spec.description = %q{fix capistrano block when use max_hosts}
12
+ spec.summary = %q{fix capistrano block when use max_hosts}
13
+ spec.homepage = "https://github.com/lidaobing/capistrano-subset-fix"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency 'capistrano', '~> 2.0'
22
+ spec.add_development_dependency "bundler", "~> 1.3"
23
+ spec.add_development_dependency "rake"
24
+ end
@@ -0,0 +1,46 @@
1
+ require 'capistrano'
2
+
3
+ module Capistrano
4
+ class Configuration
5
+ module Connections
6
+ # Determines the set of servers within the current task's scope and
7
+ # establishes connections to them, and then yields that list of
8
+ # servers.
9
+ def execute_on_servers(options={})
10
+ raise ArgumentError, "expected a block" unless block_given?
11
+
12
+ task, servers = filter_servers(options)
13
+ return if servers.empty?
14
+ logger.trace "servers: #{servers.map { |s| s.host }.inspect}"
15
+
16
+ max_hosts = (options[:max_hosts] || (task && task.max_hosts) || servers.size).to_i
17
+ is_subset = max_hosts < servers.size
18
+
19
+ # establish connections to those servers in groups of max_hosts, as necessary
20
+ servers.each_slice(max_hosts) do |servers_slice|
21
+ begin
22
+ establish_connections_to(servers_slice)
23
+ rescue ConnectionError => error
24
+ raise error unless task && task.continue_on_error?
25
+ error.hosts.each do |h|
26
+ servers_slice.delete(h)
27
+ failed!(h)
28
+ end
29
+ end
30
+
31
+ begin
32
+ yield servers_slice
33
+ rescue RemoteError => error
34
+ raise error unless task && task.continue_on_error?
35
+ error.hosts.each { |h| failed!(h) }
36
+ end
37
+
38
+ # if dealing with a subset (e.g., :max_hosts is less than the
39
+ # number of servers available) teardown the subset of connections
40
+ # that were just made, so that we can make room for the next subset.
41
+ #teardown_connections_to(servers_slice) if is_subset
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,9 @@
1
+ require "capistrano/subset/fix/version"
2
+
3
+ module Capistrano
4
+ module Subset
5
+ module Fix
6
+ # Your code goes here...
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ module Capistrano
2
+ module Subset
3
+ module Fix
4
+ VERSION = "0.0.1"
5
+ end
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-subset-fix
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - LI Daobing
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: fix capistrano block when use max_hosts
56
+ email:
57
+ - lidaobing@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - Gemfile.lock
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - capistrano-subset-fix.gemspec
69
+ - lib/capistrano-subset-fix.rb
70
+ - lib/capistrano/subset/fix.rb
71
+ - lib/capistrano/subset/fix/version.rb
72
+ homepage: https://github.com/lidaobing/capistrano-subset-fix
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.2.0.rc.1
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: fix capistrano block when use max_hosts
96
+ test_files: []