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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b34c7cd65eac8fc38b71cf21d2b7409914b41b2f098a18a0c80393073574d4f
4
- data.tar.gz: 8275c92cb60eaf6e2f26901ff17e6cedc5c32451db544c65a9f8055ffeeb0d8e
3
+ metadata.gz: 7673e71ea1c5fd965d6bb33c03389de4b6a90874d312085cf0a07122e0cf2fc1
4
+ data.tar.gz: 16502691d41770c7ac30e179da8c99714ece573d549da8ab0df66c183a472824
5
5
  SHA512:
6
- metadata.gz: 611fbcdf96089e7df3f4cf4a03827c438a23a58ad122022b89a5a61b312be65e5a100ec6fd6e1c5abc99332656fc049418ba3729afd31dd7932d26dc9db92fd9
7
- data.tar.gz: bb36c905f53aac284010db88526dc2d0b1b792f10ce0742b5c3bf0da7dde404d4babbc1c9d14cbf75b814b6ef05561eae9f5948990358cd491c21c5bd6576c44
6
+ metadata.gz: '08b87a99e6051e70acc9c80ccd1ecec8c574b9219875bc61bec1852825971cd2b3107e002e10e820953dc8cd52a5a4bb643a667a877a779b5852a6cd63c43b54'
7
+ data.tar.gz: d92966e93a34f1ed810459186499c86b809011af2b01681f636040271771dbd51e202524fdc4ccc49ee46f8d6682c22d75a223cadbb3a863763badcaa5cf05ed
@@ -1,6 +1,12 @@
1
1
  # Changelog
2
2
  ## Unreleased
3
- [full changelog](https://github.com/sue445/capistrano-around_chatwork/compare/v1.0.0...master)
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
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module AroundChatwork
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  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.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-18 00:00:00.000000000 Z
11
+ date: 2018-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano