vidar 1.2.0 → 1.3.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
  SHA256:
3
- metadata.gz: 83c8c6c6ba4f29390724e9d5b055801e1b4ba0f6c105895b50594e18531de0f4
4
- data.tar.gz: 0ba04cc7ae67755f1e818f60bffd4777873318d82b73eeb472d2e6fd31757912
3
+ metadata.gz: 550fa5fad13e11baf5d526d4f0bc9ec1355d1dba83b08ad6cda0a48907b770f0
4
+ data.tar.gz: e459ab46f1c3f0c68900af01d1a20f44506121b5da52d9305653748c458daa8e
5
5
  SHA512:
6
- metadata.gz: 9023aacabd0553df35925014213f4448b91c787c0bbff0753689d746348b966540c04b9e78d40a0b0cf6c4928814d015ff1210875e47923520b93dc50a916974
7
- data.tar.gz: f24b624aed6700dae5f1c9506eb0e70171b421c8108b9e3c6e372969c0f04880a1da9aaea737971b67b65b65f1bd3acaff67ed7b9ea791680e75fc7a2d6886c6
6
+ metadata.gz: 15b9365745e2993d24a8121649ae9e86000b7e5a30615805fbb3b526824c3d5aed5e09ff33cf2f11a6a40c947b8921e5bd9fc018bd52f0a320d624926391be17
7
+ data.tar.gz: e559f868fb17e582f495796d9090ad770012f62e11006739732b464e0ecba94e544559397fa3d3651438b6f06639fdaf9feda1c50973baf3e39431ec15199c8e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vidar (1.2.0)
4
+ vidar (1.3.0)
5
5
  colorize
6
6
  faraday
7
7
  thor (~> 1.0)
@@ -29,19 +29,19 @@ GEM
29
29
  rake (13.0.1)
30
30
  regexp_parser (1.8.2)
31
31
  rexml (3.2.4)
32
- rspec (3.9.0)
33
- rspec-core (~> 3.9.0)
34
- rspec-expectations (~> 3.9.0)
35
- rspec-mocks (~> 3.9.0)
36
- rspec-core (3.9.3)
37
- rspec-support (~> 3.9.3)
38
- rspec-expectations (3.9.3)
32
+ rspec (3.10.0)
33
+ rspec-core (~> 3.10.0)
34
+ rspec-expectations (~> 3.10.0)
35
+ rspec-mocks (~> 3.10.0)
36
+ rspec-core (3.10.0)
37
+ rspec-support (~> 3.10.0)
38
+ rspec-expectations (3.10.0)
39
39
  diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.9.0)
41
- rspec-mocks (3.9.1)
40
+ rspec-support (~> 3.10.0)
41
+ rspec-mocks (3.10.0)
42
42
  diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.9.0)
44
- rspec-support (3.9.4)
43
+ rspec-support (~> 3.10.0)
44
+ rspec-support (3.10.0)
45
45
  rubocop (0.93.1)
46
46
  parallel (~> 1.10)
47
47
  parser (>= 2.7.1.5)
data/Rakefile CHANGED
@@ -5,4 +5,4 @@ require 'rubocop/rake_task'
5
5
  RSpec::Core::RakeTask.new(:spec)
6
6
  RuboCop::RakeTask.new
7
7
 
8
- task default: %i[rubocop:auto_correct spec]
8
+ task default: %i[spec rubocop:auto_correct]
@@ -5,7 +5,6 @@ module Vidar
5
5
  @revision = revision
6
6
  @revision_name = revision_name
7
7
  @build_url = build_url
8
- @build_hostname = ::URI.parse(build_url || '').hostname
9
8
  @deploy_name = deploy_config.name
10
9
  @deploy_url = deploy_config.url
11
10
  @default_color = deploy_config.default_color
@@ -20,12 +19,19 @@ module Vidar
20
19
  end
21
20
 
22
21
  def failure
23
- message = "Failed deploy of #{github_link} to #{deploy_link} :fire: <!channel> #{build_link}"
22
+ message = [
23
+ "Failed deploy of #{github_link} to #{deploy_link}.",
24
+ ":fire: <!channel>",
25
+ build_link
26
+ ]
24
27
  perform_with data(message: message, color: failure_color)
25
28
  end
26
29
 
27
30
  def success
28
- message = "Successful deploy of #{github_link} to #{deploy_link}. #{build_link}"
31
+ message = [
32
+ "Successful deploy of #{github_link} to #{deploy_link}.",
33
+ build_link
34
+ ]
29
35
  perform_with data(message: message, color: success_color)
30
36
  end
31
37
 
@@ -46,17 +52,18 @@ module Vidar
46
52
  attr_reader :github, :revision, :revision_name,
47
53
  :deploy_name, :deploy_url, :webhook_url,
48
54
  :default_color, :success_color, :failure_color,
49
- :connection, :build_url, :build_hostname
55
+ :connection, :build_url
50
56
 
51
57
  def data(message:, color:)
58
+ text = [message].flatten.compact.join("\n")
52
59
  {
53
60
  "attachments": [
54
61
  {
55
62
  "title": github,
56
63
  "title_link": github_url,
57
64
  "color": color,
58
- "text": message,
59
- "fallback": message
65
+ "text": text,
66
+ "fallback": text,
60
67
  }
61
68
  ]
62
69
  }
@@ -75,7 +82,7 @@ module Vidar
75
82
  end
76
83
 
77
84
  def build_link
78
- build_url && "<#{build_url}|View the build on #{build_hostname}>"
85
+ build_url && "<#{build_url}|View the build.>"
79
86
  end
80
87
  end
81
88
  end
@@ -1,3 +1,3 @@
1
1
  module Vidar
2
- VERSION = '1.2.0'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Knapik
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-10-27 00:00:00.000000000 Z
12
+ date: 2020-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize