capistrano-around_chatwork 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +9 -0
- data/lib/capistrano/around_chatwork.rb +4 -0
- data/lib/capistrano/around_chatwork/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7673e71ea1c5fd965d6bb33c03389de4b6a90874d312085cf0a07122e0cf2fc1
|
4
|
+
data.tar.gz: 16502691d41770c7ac30e179da8c99714ece573d549da8ab0df66c183a472824
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08b87a99e6051e70acc9c80ccd1ecec8c574b9219875bc61bec1852825971cd2b3107e002e10e820953dc8cd52a5a4bb643a667a877a779b5852a6cd63c43b54'
|
7
|
+
data.tar.gz: d92966e93a34f1ed810459186499c86b809011af2b01681f636040271771dbd51e202524fdc4ccc49ee46f8d6682c22d75a223cadbb3a863763badcaa5cf05ed
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
## Unreleased
|
3
|
-
[full changelog](https://github.com/sue445/capistrano-around_chatwork/compare/v1.0.
|
3
|
+
[full changelog](https://github.com/sue445/capistrano-around_chatwork/compare/v1.0.1...master)
|
4
|
+
|
5
|
+
## 1.0.1
|
6
|
+
[full changelog](https://github.com/sue445/capistrano-around_chatwork/compare/v1.0.0...v1.0.1)
|
7
|
+
|
8
|
+
* Skip notify when message is empty
|
9
|
+
* https://github.com/sue445/capistrano-around_chatwork/pull/4
|
4
10
|
|
5
11
|
## 1.0.0
|
6
12
|
[full changelog](https://github.com/sue445/capistrano-around_chatwork/compare/v0.2.0...v1.0.0)
|
data/README.md
CHANGED
@@ -57,6 +57,15 @@ set :failure_message, -> {
|
|
57
57
|
}
|
58
58
|
```
|
59
59
|
|
60
|
+
When these are falsy (e.g. `nil` or `false`) or empty string (e.g. `""`), notification is skipped.
|
61
|
+
|
62
|
+
e.g.
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
set :starting_message, nil
|
66
|
+
set :ending_message, ""
|
67
|
+
```
|
68
|
+
|
60
69
|
### Variables
|
61
70
|
* `:task_name:` is replaced to current task name (e.g. `deploy`)
|
62
71
|
* `:elapsed_time:` is replaced to elapsed time of task (e.g. `1.234`)
|
@@ -4,6 +4,8 @@ require "cha"
|
|
4
4
|
module Capistrano
|
5
5
|
module AroundChatwork
|
6
6
|
def self.format_message(message:, task_name:, elapsed_time: 0, error: nil)
|
7
|
+
return "" unless message
|
8
|
+
|
7
9
|
formatted_message = message.
|
8
10
|
gsub(":task_name:", task_name).
|
9
11
|
gsub(":elapsed_time:", sprintf("%5.3f", elapsed_time))
|
@@ -19,6 +21,8 @@ module Capistrano
|
|
19
21
|
end
|
20
22
|
|
21
23
|
def self.post_chatwork(message)
|
24
|
+
return if message.empty?
|
25
|
+
|
22
26
|
client = Cha.new(api_token: fetch(:chatwork_api_token))
|
23
27
|
client.create_room_message(fetch(:chatwork_room_id), message)
|
24
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-around_chatwork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|