capistrano-pending 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: 37ce7ef86f60cdca633a82a56acb70e5c6e3a5a6
4
+ data.tar.gz: 86c236435512d63bafa43eb9c29c8c632c8450fb
5
+ SHA512:
6
+ metadata.gz: 7ec8a7f467d23306baf3df5d7d1c527d1a87c6423e200c8e104c48a772607c2d3585431f478c1e8d77e2061aa84627caa7f378854990df9988eb8ce5834b2a1c
7
+ data.tar.gz: 41b122da63d62af480204fc155a9166f06519372e9f9b7172092194cd04acd31a222f5e4f2e9149bd82ca9cb2bb9f21f68f320bea33aec2ff5651d5a48e011a6
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-pending.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Masato Ikeda
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,43 @@
1
+ # capistrano-pending
2
+
3
+ This gem provides `cap deploy:pending` and `cap deploy:pending:diff` to Capistrano 3.
4
+ They were implemented in Capistrano 2.
5
+
6
+ Currently only git is supported.
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ gem 'capistrano-pending', :require => false
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install capistrano-pending
21
+
22
+ ## Usage
23
+
24
+ Add below to Capfile:
25
+
26
+ require 'capistrano-pending'
27
+
28
+ and run below to show commit logs between current revision on the servers and deploying branch:
29
+
30
+ $ bundle exec cap <stage> deploy:pending
31
+
32
+ or run below to show diff of them:
33
+
34
+ $ bundle exec cap <stage> deploy:pending:diff
35
+
36
+
37
+ ## Contributing
38
+
39
+ 1. Fork it ( https://github.com/a2ikm/capistrano-pending/fork )
40
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
41
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
42
+ 4. Push to the branch (`git push origin my-new-feature`)
43
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -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/pending/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "capistrano-pending"
8
+ spec.version = Capistrano::Pending::VERSION
9
+ spec.authors = ["Masato Ikeda"]
10
+ spec.email = ["masato.ikeda@gmail.com"]
11
+ spec.summary = %q{Provide deploy:pending task to Capistrano 3.}
12
+ spec.description = %q{Provide deploy:pending task to Capistrano 3 to show commit logs between current revision and deploying branch.}
13
+ spec.homepage = "https://github.com/a2ikm/capistrano-pending"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
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", ">= 3.2.0"
22
+ spec.add_development_dependency "bundler", "~> 1.6"
23
+ spec.add_development_dependency "rake"
24
+ end
@@ -0,0 +1 @@
1
+ require "capistrano/pending"
@@ -0,0 +1,19 @@
1
+ module Capistrano
2
+ module Pending
3
+ require "capistrano/pending/version"
4
+
5
+ module SCM
6
+ autoload :Git, "capistrano/pending/scm/git"
7
+
8
+ class <<self
9
+ def load(name)
10
+ const_get(name.to_s.capitalize).new
11
+ rescue NameError
12
+ abort "#{name} is not supported."
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+
19
+ load "capistrano/pending/tasks/pending.rake"
@@ -0,0 +1,29 @@
1
+ module Capistrano
2
+ module Pending
3
+ module SCM
4
+ class Base
5
+ class <<self
6
+ def command(name)
7
+ class_eval <<-RUBY_CODE, __FILE__, __LINE__+1
8
+ def #{name}(*args) # def git(*args)
9
+ local_exec(:#{name}, *args) # local_exec(:git, *args)
10
+ end # end
11
+ RUBY_CODE
12
+ end
13
+ end
14
+
15
+ def local_exec(*args)
16
+ ::Kernel.exec *args.map(&:to_s)
17
+ end
18
+
19
+ def log(from, to)
20
+ raise NotImplementedError
21
+ end
22
+
23
+ def diff(from, to)
24
+ raise NotImplementedError
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,19 @@
1
+ require "capistrano/pending/scm/base"
2
+
3
+ module Capistrano
4
+ module Pending
5
+ module SCM
6
+ class Git < Base
7
+ command :git
8
+
9
+ def log(from, to)
10
+ git :log, "#{from}..#{to}"
11
+ end
12
+
13
+ def diff(from, to)
14
+ git :diff, "#{from}..#{to}"
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,46 @@
1
+ namespace :deploy do
2
+
3
+ desc <<-DESC
4
+ Displays the commits since your last deploy. This is good for a summary \
5
+ of the changes that have occurred since the last deploy. Note that this \
6
+ might not be supported on all SCM's
7
+ DESC
8
+ task :pending => "deploy:pending:log"
9
+
10
+ namespace :pending do
11
+ def _scm
12
+ Capistrano::Pending::SCM.load(fetch(:scm))
13
+ end
14
+
15
+ def _log(from, to)
16
+ _scm.log(from, to)
17
+ end
18
+
19
+ def _diff(from, to)
20
+ _scm.diff(from, to)
21
+ end
22
+
23
+ task :log => :setup do
24
+ _log(fetch(:revision), fetch(:branch))
25
+ end
26
+
27
+ desc <<-DESC
28
+ Displays the `diff' since your last deploy. This is useful if you want \
29
+ to examine what changes are about to be deployed. Note that this might \
30
+ not be supported on all SCM's.
31
+ DESC
32
+ task :diff => :setup do
33
+ _diff(fetch(:revision), fetch(:branch))
34
+ end
35
+
36
+ task :setup => [:capture_revision]
37
+
38
+ task :capture_revision do
39
+ on roles fetch(:capistrano_pending_role, :db) do |host|
40
+ within current_path do
41
+ set :revision, capture(:cat, "REVISION")
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module Pending
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-pending
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Masato Ikeda
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-20 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: 3.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: 3.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.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
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: Provide deploy:pending task to Capistrano 3 to show commit logs between
56
+ current revision and deploying branch.
57
+ email:
58
+ - masato.ikeda@gmail.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - capistrano-pending.gemspec
69
+ - lib/capistrano-pending.rb
70
+ - lib/capistrano/pending.rb
71
+ - lib/capistrano/pending/scm/base.rb
72
+ - lib/capistrano/pending/scm/git.rb
73
+ - lib/capistrano/pending/tasks/pending.rake
74
+ - lib/capistrano/pending/version.rb
75
+ homepage: https://github.com/a2ikm/capistrano-pending
76
+ licenses:
77
+ - MIT
78
+ metadata: {}
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 2.2.2
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: Provide deploy:pending task to Capistrano 3.
99
+ test_files: []
100
+ has_rdoc: