capistrano-notification 0.0.2 → 0.1.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.
- data/.gitignore +1 -21
- data/Gemfile +3 -0
- data/Gemfile.lock +45 -0
- data/Rakefile +2 -48
- data/capistrano-notification.gemspec +26 -0
- data/lib/capistrano-notification.rb +10 -5
- data/lib/capistrano-notification/version.rb +3 -0
- data/spec/capistrano-notification_spec.rb +65 -3
- data/spec/spec_helper.rb +4 -4
- metadata +23 -31
- data/VERSION +0 -1
data/.gitignore
CHANGED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
capistrano-notification (0.1.0)
|
5
|
+
capistrano
|
6
|
+
shout-bot
|
7
|
+
validatable
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: http://rubygems.org/
|
11
|
+
specs:
|
12
|
+
addressable (2.2.6)
|
13
|
+
capistrano (2.6.0)
|
14
|
+
highline
|
15
|
+
net-scp (>= 1.0.0)
|
16
|
+
net-sftp (>= 2.0.0)
|
17
|
+
net-ssh (>= 2.0.14)
|
18
|
+
net-ssh-gateway (>= 1.1.0)
|
19
|
+
diff-lcs (1.1.2)
|
20
|
+
highline (1.6.2)
|
21
|
+
net-scp (1.0.4)
|
22
|
+
net-ssh (>= 1.99.1)
|
23
|
+
net-sftp (2.0.5)
|
24
|
+
net-ssh (>= 2.0.9)
|
25
|
+
net-ssh (2.1.4)
|
26
|
+
net-ssh-gateway (1.1.0)
|
27
|
+
net-ssh (>= 1.99.1)
|
28
|
+
rspec (2.6.0)
|
29
|
+
rspec-core (~> 2.6.0)
|
30
|
+
rspec-expectations (~> 2.6.0)
|
31
|
+
rspec-mocks (~> 2.6.0)
|
32
|
+
rspec-core (2.6.2)
|
33
|
+
rspec-expectations (2.6.0)
|
34
|
+
diff-lcs (~> 1.1.2)
|
35
|
+
rspec-mocks (2.6.0)
|
36
|
+
shout-bot (0.0.4)
|
37
|
+
addressable
|
38
|
+
validatable (1.6.7)
|
39
|
+
|
40
|
+
PLATFORMS
|
41
|
+
ruby
|
42
|
+
|
43
|
+
DEPENDENCIES
|
44
|
+
capistrano-notification!
|
45
|
+
rspec
|
data/Rakefile
CHANGED
@@ -1,49 +1,3 @@
|
|
1
|
-
require '
|
2
|
-
require 'rake'
|
1
|
+
require 'bundler'
|
3
2
|
|
4
|
-
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = 'capistrano-notification'
|
8
|
-
gem.summary = %Q{Capistrano deployment notification}
|
9
|
-
gem.description = %Q{Capistrano deployment notification}
|
10
|
-
gem.email = 'ursm@ursm.jp'
|
11
|
-
gem.homepage = 'http://github.com/ursm/capistrano-notification'
|
12
|
-
gem.authors = ['Keita Urashima']
|
13
|
-
|
14
|
-
gem.add_dependency 'capistrano'
|
15
|
-
gem.add_dependency 'validatable'
|
16
|
-
gem.add_dependency 'shout-bot'
|
17
|
-
|
18
|
-
gem.add_development_dependency 'rspec', '>= 1.2.9'
|
19
|
-
end
|
20
|
-
Jeweler::GemcutterTasks.new
|
21
|
-
rescue LoadError
|
22
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
23
|
-
end
|
24
|
-
|
25
|
-
require 'spec/rake/spectask'
|
26
|
-
Spec::Rake::SpecTask.new(:spec) do |spec|
|
27
|
-
spec.libs << 'lib' << 'spec'
|
28
|
-
spec.spec_files = FileList['spec/**/*_spec.rb']
|
29
|
-
end
|
30
|
-
|
31
|
-
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
32
|
-
spec.libs << 'lib' << 'spec'
|
33
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
34
|
-
spec.rcov = true
|
35
|
-
end
|
36
|
-
|
37
|
-
task :spec => :check_dependencies
|
38
|
-
|
39
|
-
task :default => :spec
|
40
|
-
|
41
|
-
require 'rake/rdoctask'
|
42
|
-
Rake::RDocTask.new do |rdoc|
|
43
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
44
|
-
|
45
|
-
rdoc.rdoc_dir = 'rdoc'
|
46
|
-
rdoc.title = "capistrano-notification #{version}"
|
47
|
-
rdoc.rdoc_files.include('README*')
|
48
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
-
end
|
3
|
+
Bundler::GemHelper.install_tasks
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
$:.push File.expand_path("../lib", __FILE__)
|
4
|
+
require "capistrano-notification/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "capistrano-notification"
|
8
|
+
s.version = CapistranoNotification::VERSION
|
9
|
+
s.platform = Gem::Platform::RUBY
|
10
|
+
s.authors = ['Keita Urashima']
|
11
|
+
s.email = ['ursm@ursm.jp']
|
12
|
+
s.homepage = 'http://github.com/ursm/capistrano-notification'
|
13
|
+
s.summary = %q{Capistrano deployment notification}
|
14
|
+
s.description = %q{Capistrano deployment notification}
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_dependency 'capistrano'
|
22
|
+
s.add_dependency 'validatable'
|
23
|
+
s.add_dependency 'shout-bot'
|
24
|
+
|
25
|
+
s.add_development_dependency 'rspec'
|
26
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'capistrano'
|
1
2
|
require 'validatable'
|
2
3
|
require 'shout-bot'
|
3
4
|
|
@@ -11,14 +12,18 @@ module CapistranoNotification
|
|
11
12
|
include Validatable
|
12
13
|
|
13
14
|
def self.var(name, opts = {})
|
14
|
-
define_method name do |*args|
|
15
|
+
define_method name do |*args, &block|
|
15
16
|
case args.size
|
16
17
|
when 0
|
17
|
-
|
18
|
-
value
|
18
|
+
unless block
|
19
|
+
if value = instance_variable_get("@#{name}")
|
20
|
+
value.is_a?(Proc) ? value.call(self) : value
|
21
|
+
else
|
22
|
+
default = opts[:default]
|
23
|
+
send name, default.is_a?(Proc) ? default.call(self) : default
|
24
|
+
end
|
19
25
|
else
|
20
|
-
|
21
|
-
send name, default.is_a?(Proc) ? default.call(self) : default
|
26
|
+
instance_variable_set "@#{name}", block
|
22
27
|
end
|
23
28
|
when 1
|
24
29
|
instance_variable_set "@#{name}", args.first
|
@@ -1,7 +1,69 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
module CapistranoNotification
|
4
|
+
describe Base do
|
5
|
+
describe ".var" do
|
6
|
+
def base_subclass_instance(&block)
|
7
|
+
klass = Class.new(Base)
|
8
|
+
klass.module_eval(&block)
|
9
|
+
@subject = klass.new
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "w/ symbol only" do
|
13
|
+
subject do
|
14
|
+
base_subclass_instance do
|
15
|
+
var :name
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
before { subject.name("foo") }
|
20
|
+
its(:name) { should == "foo" }
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "w/ default value" do
|
24
|
+
subject do
|
25
|
+
base_subclass_instance do
|
26
|
+
var :name, :default => 'bar'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
its(:name) { should == "bar" }
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "w/ required" do
|
33
|
+
context "when valid" do
|
34
|
+
subject do
|
35
|
+
base_subclass_instance do
|
36
|
+
var :name, :required => true
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
before { subject.name("baz") }
|
41
|
+
it { should be_valid }
|
42
|
+
its(:name) { should == "baz" }
|
43
|
+
end
|
44
|
+
|
45
|
+
context "when invalid" do
|
46
|
+
subject do
|
47
|
+
base_subclass_instance do
|
48
|
+
var :name, :default => "anonymous_base_subclass"
|
49
|
+
var :foo, :required => true
|
50
|
+
end
|
51
|
+
end
|
52
|
+
specify do
|
53
|
+
subject.should_not be_valid
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe "pass via block" do
|
59
|
+
subject do
|
60
|
+
base_subclass_instance do
|
61
|
+
var :name
|
62
|
+
end
|
63
|
+
end
|
64
|
+
before { subject.name{ "pass_via_block" } }
|
65
|
+
its(:name) { should == "pass_via_block" }
|
66
|
+
end
|
67
|
+
end
|
6
68
|
end
|
7
69
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
2
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
3
|
require 'capistrano-notification'
|
4
|
-
require '
|
5
|
-
require '
|
4
|
+
require 'rspec'
|
5
|
+
require 'rspec/autorun'
|
6
|
+
|
7
|
+
RSpec.configure do |config|
|
6
8
|
|
7
|
-
Spec::Runner.configure do |config|
|
8
|
-
|
9
9
|
end
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-notification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
version: 0.0.2
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.1
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Keita Urashima
|
@@ -14,18 +10,17 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date:
|
13
|
+
date: 2011-05-24 00:00:00 +09:00
|
18
14
|
default_executable:
|
19
15
|
dependencies:
|
20
16
|
- !ruby/object:Gem::Dependency
|
21
17
|
name: capistrano
|
22
18
|
prerelease: false
|
23
19
|
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
24
21
|
requirements:
|
25
22
|
- - ">="
|
26
23
|
- !ruby/object:Gem::Version
|
27
|
-
segments:
|
28
|
-
- 0
|
29
24
|
version: "0"
|
30
25
|
type: :runtime
|
31
26
|
version_requirements: *id001
|
@@ -33,11 +28,10 @@ dependencies:
|
|
33
28
|
name: validatable
|
34
29
|
prerelease: false
|
35
30
|
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
36
32
|
requirements:
|
37
33
|
- - ">="
|
38
34
|
- !ruby/object:Gem::Version
|
39
|
-
segments:
|
40
|
-
- 0
|
41
35
|
version: "0"
|
42
36
|
type: :runtime
|
43
37
|
version_requirements: *id002
|
@@ -45,11 +39,10 @@ dependencies:
|
|
45
39
|
name: shout-bot
|
46
40
|
prerelease: false
|
47
41
|
requirement: &id003 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
48
43
|
requirements:
|
49
44
|
- - ">="
|
50
45
|
- !ruby/object:Gem::Version
|
51
|
-
segments:
|
52
|
-
- 0
|
53
46
|
version: "0"
|
54
47
|
type: :runtime
|
55
48
|
version_requirements: *id003
|
@@ -57,33 +50,33 @@ dependencies:
|
|
57
50
|
name: rspec
|
58
51
|
prerelease: false
|
59
52
|
requirement: &id004 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
60
54
|
requirements:
|
61
55
|
- - ">="
|
62
56
|
- !ruby/object:Gem::Version
|
63
|
-
|
64
|
-
- 1
|
65
|
-
- 2
|
66
|
-
- 9
|
67
|
-
version: 1.2.9
|
57
|
+
version: "0"
|
68
58
|
type: :development
|
69
59
|
version_requirements: *id004
|
70
60
|
description: Capistrano deployment notification
|
71
|
-
email:
|
61
|
+
email:
|
62
|
+
- ursm@ursm.jp
|
72
63
|
executables: []
|
73
64
|
|
74
65
|
extensions: []
|
75
66
|
|
76
|
-
extra_rdoc_files:
|
77
|
-
|
78
|
-
- README.rdoc
|
67
|
+
extra_rdoc_files: []
|
68
|
+
|
79
69
|
files:
|
80
70
|
- .document
|
81
71
|
- .gitignore
|
72
|
+
- Gemfile
|
73
|
+
- Gemfile.lock
|
82
74
|
- LICENSE
|
83
75
|
- README.rdoc
|
84
76
|
- Rakefile
|
85
|
-
-
|
77
|
+
- capistrano-notification.gemspec
|
86
78
|
- lib/capistrano-notification.rb
|
79
|
+
- lib/capistrano-notification/version.rb
|
87
80
|
- spec/capistrano-notification_spec.rb
|
88
81
|
- spec/spec.opts
|
89
82
|
- spec/spec_helper.rb
|
@@ -92,31 +85,30 @@ homepage: http://github.com/ursm/capistrano-notification
|
|
92
85
|
licenses: []
|
93
86
|
|
94
87
|
post_install_message:
|
95
|
-
rdoc_options:
|
96
|
-
|
88
|
+
rdoc_options: []
|
89
|
+
|
97
90
|
require_paths:
|
98
91
|
- lib
|
99
92
|
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
+
none: false
|
100
94
|
requirements:
|
101
95
|
- - ">="
|
102
96
|
- !ruby/object:Gem::Version
|
103
|
-
segments:
|
104
|
-
- 0
|
105
97
|
version: "0"
|
106
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
107
100
|
requirements:
|
108
101
|
- - ">="
|
109
102
|
- !ruby/object:Gem::Version
|
110
|
-
segments:
|
111
|
-
- 0
|
112
103
|
version: "0"
|
113
104
|
requirements: []
|
114
105
|
|
115
106
|
rubyforge_project:
|
116
|
-
rubygems_version: 1.
|
107
|
+
rubygems_version: 1.6.2
|
117
108
|
signing_key:
|
118
109
|
specification_version: 3
|
119
110
|
summary: Capistrano deployment notification
|
120
111
|
test_files:
|
121
|
-
- spec/spec_helper.rb
|
122
112
|
- spec/capistrano-notification_spec.rb
|
113
|
+
- spec/spec.opts
|
114
|
+
- spec/spec_helper.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.0.2
|