chat_notifier 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11bbd1390ca03c1f99d0ff66a5e3a361f259f40704575db73ae255e67e48b94b
4
- data.tar.gz: 24781a89995cf1384962fb46b5a60d8ed5095e442af92162a85e5e82489007ee
3
+ metadata.gz: b345042cb02425e4111b2895d482919d53042479e3d31024628dfbeed9a613d2
4
+ data.tar.gz: 530e457fa2b8b1fa13325180d7faf7cc8b75d5eabcf753203e8d2ebee0f9818d
5
5
  SHA512:
6
- metadata.gz: a2584238466e94fc1efba40198f83761464f6bf399b9e99b8b640eb21a074a13699fe18bb42a4c1be049e1d0ccdb5950d721ce1342c04f1bfbc277f4195be189
7
- data.tar.gz: f6e4ac759352ba03f7a21a283f3e43eb4202f0fad8ddd7125b1024713fe96bdac3b283a9bc3f5555495005c96bc92b5438307f55cf1b318556b79674c7143f32
6
+ metadata.gz: a61d479f99e2393f84b76bd2733b1cc7defd04d4e21aecea9a332a2873e35f001c90eefd335c0d82f4836ad0e335b86c67a3f45aed52ae5a4efea5b3cc45295c
7
+ data.tar.gz: 572f34fe2117c051b5df7f108c540c4c3ab208fb93b077b5443801762046cdaea8f492e5cd0963cd86f60928624104cd7b4ae1598fa4f22ac61788cf627c2781
data/README.md CHANGED
@@ -14,6 +14,29 @@ Add to your `spec_helper.rb` or `rails_helper.rb`:
14
14
 
15
15
  ```
16
16
  require "chat_notifier/rspec_formatter"
17
+
18
+ config.add_formatter "ChatNotifier::RspecFormatter" if ENV["CI"]
19
+ ```
20
+
21
+ Add to your config/application.rb within your namespaced module
22
+
23
+ ```
24
+ def self.sha
25
+ `git rev-parse --short HEAD`.chomp
26
+ end
27
+
28
+ def self.branch
29
+ `git branch --show-current`.chomp
30
+ end
31
+ ```
32
+
33
+ Add these variables to your env files
34
+
35
+ ```
36
+ NOTIFY_SLACK_WEBHOOK_URL
37
+ NOTIFY_SLACK_NOTIFY_CHANNEL
38
+ NOTIFY_CURRENT_REPOSITORY_URL
39
+ NOTIFY_TEST_RUN_ID
17
40
  ```
18
41
 
19
42
  ### Debug your Slack setup
@@ -22,14 +45,15 @@ Create rake task to test the connection to your Slack channel
22
45
 
23
46
  ```ruby
24
47
  namespace :chat_notifier do
48
+ desc "Tests chat notifier"
25
49
  task debug: :environment do
26
- unless ENV["SLACK_WEBHOOK_URL"]
27
- puts "You MUST set the environment variables for:\nSLACK_WEBHOOK_URL"
50
+ unless ENV["NOTIFY_SLACK_WEBHOOK_URL"]
51
+ puts "You MUST set the environment variables for:\nNOTIFY_SLACK_WEBHOOK_URL"
28
52
  return
29
53
  end
30
54
  ENV["DEBUG"] = "1"
31
- ENV["CURRENT_REPOSITORY_URL"] = "https://example.com"
32
- ENV["TEST_RUN_ID"] = "9999"
55
+ ENV["NOTIFY_CURRENT_REPOSITORY_URL"] = "https://example.com"
56
+ ENV["NOTIFY_TEST_RUN_ID"] = "9999"
33
57
  require "chat_notifier"
34
58
 
35
59
  failure = ChatNotifier::DebugExceptionLocation.new(location: "fake/path.rb")
@@ -12,11 +12,11 @@ module ChatNotifier
12
12
  end
13
13
 
14
14
  def webhook_url
15
- settings.fetch("SLACK_WEBHOOK_URL", nil)
15
+ settings.fetch("NOTIFY_SLACK_WEBHOOK_URL", nil)
16
16
  end
17
17
 
18
18
  def channel
19
- settings.fetch("SLACK_NOTIFY_CHANNEL", nil)
19
+ settings.fetch("NOTIFY_SLACK_NOTIFY_CHANNEL", nil)
20
20
  end
21
21
 
22
22
  def payload(data)
@@ -4,7 +4,7 @@ module ChatNotifier
4
4
  class Repository
5
5
  class Github < self
6
6
  def url
7
- settings.fetch("CURRENT_REPOSITORY_URL", nil)
7
+ settings.fetch("NOTIFY_CURRENT_REPOSITORY_URL", nil)
8
8
  end
9
9
 
10
10
  def link(sha)
@@ -8,7 +8,7 @@ module ChatNotifier
8
8
  end
9
9
 
10
10
  def run_id
11
- settings.fetch("TEST_RUN_ID")
11
+ settings.fetch("NOTIFY_TEST_RUN_ID")
12
12
  end
13
13
  end
14
14
  end
@@ -22,7 +22,7 @@ module ChatNotifier
22
22
  end
23
23
 
24
24
  def url
25
- settings.fetch("CURRENT_REPOSITORY_URL")
25
+ settings.fetch("NOTIFY_CURRENT_REPOSITORY_URL")
26
26
  end
27
27
 
28
28
  def test_run_url
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ChatNotifier
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chat_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Gay
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-19 00:00:00.000000000 Z
11
+ date: 2023-05-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Send test results to chat
14
14
  email:
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  requirements: []
56
- rubygems_version: 3.4.6
56
+ rubygems_version: 3.4.10
57
57
  signing_key:
58
58
  specification_version: 4
59
59
  summary: Notify chat of test results