quandl_utility 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/UPGRADE.md +6 -0
- data/lib/quandl/utility/thor_tasks/ci.rb +34 -7
- data/lib/quandl/utility/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03eb516e16528dee425ec889bd77d73b0e0604d7
|
4
|
+
data.tar.gz: ea667879527199ab7de88114e2738f6ead865e35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e41e9bc4c3ce32b732e0ac767b27eda9df474bad28d6bd6fb1f88db366a2ff36548d264a096aeb3da8a88a12f91af25e5b270b32dfbcfaf079142eed704c0587
|
7
|
+
data.tar.gz: 15119a4ad2fb787f720446983492e003688bc81c92055a126d426f8ca5de438bbdfd6efcfadb5dac8186142753ece40bd269ec1a0f73d9ace8ec9a5ebf3d1340
|
data/UPGRADE.md
CHANGED
@@ -8,9 +8,10 @@ module Quandl
|
|
8
8
|
namespace 'qutil:ci'
|
9
9
|
|
10
10
|
desc 'notify_slack', 'Notify Quandl of build status of CI'
|
11
|
-
def notify_slack
|
11
|
+
def notify_slack(message = nil)
|
12
|
+
notification = message.nil? ? ci_build_message : "#{ci_build_message} - #{message}"
|
12
13
|
invoke 'qutil:notify:slack',
|
13
|
-
[
|
14
|
+
[notification, slack_channel],
|
14
15
|
emoji: slack_emoji
|
15
16
|
end
|
16
17
|
|
@@ -20,7 +21,7 @@ module Quandl
|
|
20
21
|
#
|
21
22
|
# Returns string
|
22
23
|
def ci_build_message
|
23
|
-
"*#{current_project}* (#{git_branch}) *#{tddium_build_status}* - #{tddium_report_url}"
|
24
|
+
"*#{current_project}* (#{git_branch}) *#{tddium_build_status}* - #{tddium_report_url} - (#{git_user})"
|
24
25
|
end
|
25
26
|
|
26
27
|
# Which slack channel to send build status to.
|
@@ -58,18 +59,44 @@ module Quandl
|
|
58
59
|
@git_branch ||= `git branch`.chomp.gsub(/\*/, '').strip
|
59
60
|
end
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
|
62
|
+
def git_user
|
63
|
+
@git_user ||= `git --no-pager show -s --format='%an'`.chomp
|
64
|
+
end
|
65
|
+
|
66
|
+
# Did the build end with failed status?
|
64
67
|
def failed?
|
65
68
|
ENV['TDDIUM_BUILD_STATUS'] == 'failed'
|
66
69
|
end
|
67
70
|
|
71
|
+
# Did the build end with success status?
|
72
|
+
def passed?
|
73
|
+
ENV['TDDIUM_BUILD_STATUS'] == 'passed'
|
74
|
+
end
|
75
|
+
|
76
|
+
def error?
|
77
|
+
!(failed? || passed?)
|
78
|
+
end
|
79
|
+
|
68
80
|
# Use different emojis for build statuses.
|
69
81
|
#
|
70
82
|
# Returns string
|
71
83
|
def slack_emoji
|
72
|
-
failed?
|
84
|
+
if failed?
|
85
|
+
fail_emoji
|
86
|
+
elsif passed?
|
87
|
+
pass_emoji
|
88
|
+
else
|
89
|
+
error_emoji
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# Return the emoji to use for an error build
|
94
|
+
# Can be overriden with environment variables in tddium.yml.
|
95
|
+
# Default is :warning:
|
96
|
+
#
|
97
|
+
# Returns string
|
98
|
+
def error_emoji
|
99
|
+
ENV.fetch('SLACK_ERROR_EMOJI', ':warning:')
|
73
100
|
end
|
74
101
|
|
75
102
|
# Return the emoji to use for a failed build
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quandl_utility
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Hilscher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|