capistrano-pending 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a24d2f16155b395d9f22495291850dc93cb45c3f
4
- data.tar.gz: f712c951b36a53efcabb49d5ac4c176c11c280a2
3
+ metadata.gz: 9c19dcb4e7a3fd64e3c8c1deda687b7e8a364fb4
4
+ data.tar.gz: 05061b119ad4664ae816b8f84608008efe745a4f
5
5
  SHA512:
6
- metadata.gz: c9a4e66ec11b6917db585fcee8b3dc8b6b98787c93ef77427d4b4d2358a030a9623b6cca25156a8ecfc63a3c408ac5a9f77c363506e0f79dfe4d273adc93ca98
7
- data.tar.gz: 343d6af1c52781a7dc6c5e36246118a7db777539ec7691a4b69b866d5bf695baa3327579eda8607f1ec2f058dc18e35d19c6aa4d5939b762bd070a88edfb60a8
6
+ metadata.gz: a6eb2fed6edc8afa0f8488ee767d1099a663a3ec28b280e93217902a9586eada6abaab2ca7c4149829ef63d0905bebc5a12e6e54596ec9ea863ac5bcb78e8f43
7
+ data.tar.gz: 6379ff457d421d7e216b5606bb0fad89a677a6f1e0190d3ece285f51111b0e02d02ad457ca11cdc5c5d8c730310f6349ee9353311c39bf7bcddc44e25e428922
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  This gem provides `cap deploy:pending` and `cap deploy:pending:diff` to Capistrano 3.
4
4
  They were implemented in Capistrano 2.
5
5
 
6
- Currently only git is supported.
6
+ Currently git and svn is supported.
7
7
 
8
8
  ## Installation
9
9
 
@@ -4,6 +4,7 @@ module Capistrano
4
4
 
5
5
  module SCM
6
6
  autoload :Git, "capistrano/pending/scm/git"
7
+ autoload :Svn, "capistrano/pending/scm/svn"
7
8
 
8
9
  class <<self
9
10
  def load(name)
@@ -0,0 +1,21 @@
1
+ require "capistrano/pending/scm/base"
2
+
3
+ module Capistrano
4
+ module Pending
5
+ module SCM
6
+ class Svn < Base
7
+ command :svn
8
+
9
+ def log(from, to)
10
+ to = :HEAD if to == :master
11
+ svn :log, "-r#{from}:#{to}"
12
+ end
13
+
14
+ def diff(from, to)
15
+ to = :HEAD if to == :master
16
+ svn :diff, "-r#{from}:#{to}"
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -5,13 +5,7 @@ namespace :deploy do
5
5
  of the changes that have occurred since the last deploy. Note that this \
6
6
  might not be supported on all SCM's
7
7
  DESC
8
- task :pending do
9
- on roles fetch(:capistrano_pending_role, :db) do |host|
10
- if test "[ -f #{current_path}/REVISION ]"
11
- invoke "deploy:pending:log"
12
- end
13
- end
14
- end
8
+ task :pending => "deploy:pending:log"
15
9
 
16
10
  namespace :pending do
17
11
  def _scm
@@ -26,6 +20,15 @@ namespace :deploy do
26
20
  _scm.diff(from, to)
27
21
  end
28
22
 
23
+ def _ensure_revision
24
+ if test "[ -f #{current_path}/REVISION ]"
25
+ yield
26
+ else
27
+ error "REVISION file doesn't exist"
28
+ exit 1
29
+ end
30
+ end
31
+
29
32
  task :log => :setup do
30
33
  _log(fetch(:revision), fetch(:branch))
31
34
  end
@@ -43,8 +46,10 @@ namespace :deploy do
43
46
 
44
47
  task :capture_revision do
45
48
  on roles fetch(:capistrano_pending_role, :db) do |host|
46
- within current_path do
47
- set :revision, capture(:cat, "REVISION")
49
+ _ensure_revision do
50
+ within current_path do
51
+ set :revision, capture(:cat, "REVISION")
52
+ end
48
53
  end
49
54
  end
50
55
  end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Pending
3
- VERSION = "0.0.2"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-pending
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masato Ikeda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-14 00:00:00.000000000 Z
11
+ date: 2015-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -70,6 +70,7 @@ files:
70
70
  - lib/capistrano/pending.rb
71
71
  - lib/capistrano/pending/scm/base.rb
72
72
  - lib/capistrano/pending/scm/git.rb
73
+ - lib/capistrano/pending/scm/svn.rb
73
74
  - lib/capistrano/pending/tasks/pending.rake
74
75
  - lib/capistrano/pending/version.rb
75
76
  homepage: https://github.com/a2ikm/capistrano-pending
@@ -92,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
93
  version: '0'
93
94
  requirements: []
94
95
  rubyforge_project:
95
- rubygems_version: 2.2.2
96
+ rubygems_version: 2.4.5
96
97
  signing_key:
97
98
  specification_version: 4
98
99
  summary: Provide deploy:pending task to Capistrano 3.