slack_message 1.7.0 → 1.7.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: a2cd232d81a66a48c9543a5b910c335bca7a82474a60472d03f7cffab3fce0d0
4
- data.tar.gz: c27312311ff02ee414f2882461fe5ea9b5c07d9d8e99847ae7af33faf4a31283
3
+ metadata.gz: f3438c93abd1488bafc0ee9f33df94674290b68bd94110e8f2e601d95d3254bc
4
+ data.tar.gz: 5eee7e715e66042ab6c3ccbc47eedba3e2ddddacd327e1096e3a2d3476b076b0
5
5
  SHA512:
6
- metadata.gz: 69352d5eb8d4f6837f66ba042817bfe0a51c3483356bbc64ded0cbc60fc7e72c084ea39df542a93bf79a6c0a8c4ad860cdb9791f28d807edb5b1c859b13f129f
7
- data.tar.gz: 740af84829c6b258b4788b5f83901f242a5732e98737781efb288ee426ed232726823d9fdde453da6c7d83eb55607733e1d4b55757580676921b37abba1c70ad
6
+ metadata.gz: ddc5ace3b66e6977b164accfeec16c67450ed8fbd182939e85aa1d56c251319f203c4527d75d410c2858bbfa7540889a83ed08aed12890488944077edf1867ed
7
+ data.tar.gz: 16601f240ee826b8cadbd03429b5fd431ba21a5b159c1ca3c70932da362b54388c32115544bf782c45f9e2b1c603801d82e2fd6827e7020abfcaed18669601ee
data/CHANGELOG.md CHANGED
@@ -2,7 +2,13 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.7.1] - 2021-10-06
6
+ - Fixed literally a syntax issue.
7
+ - Fixed specs.
8
+ - Fixed API to include JSON since consumers may not have loaded it.
9
+
5
10
  ## [1.7.0] - 2021-10-06
11
+ - THIS RELEASE IS BADLY BROKEN.
6
12
  - Added new error messages when API configuration is wrong / missing.
7
13
  - Fixed issue with `instance_eval` and using methods within block.
8
14
  - Fixed issue with sectionless `list_item`.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- slack_message (1.2.0)
4
+ slack_message (1.7.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -225,6 +225,8 @@ opinionated stances on how to make use of that API. For instance:
225
225
  * Generally, same goes for the `emoji` flag on almost every text element.
226
226
  * It's possible to ask for a `blank_line` in sections, even though that concept
227
227
  isn't real. In this case, a text line containing only an emspace is rendered.
228
+ * It's easy to configure a bot for consistent name / channel use. My previous
229
+ use of SlackNotifier led to frequently inconsistent names.
228
230
 
229
231
  What it Doesn't Do
230
232
  ------------
@@ -1,5 +1,6 @@
1
1
  require 'net/http'
2
2
  require 'net/https'
3
+ require 'json'
3
4
 
4
5
  class SlackMessage::Api
5
6
  def self.user_id_for(email)
@@ -6,7 +6,7 @@ class SlackMessage::Dsl
6
6
  def initialize(block)
7
7
  # Delegate missing methods to caller scope. Thanks 2008:
8
8
  # https://www.dan-manges.com/blog/ruby-dsls-instance-eval-with-delegation
9
- @caller_self = eval("self", block.binding
9
+ @caller_self = eval("self", block.binding)
10
10
 
11
11
  @body = []
12
12
  @default_section = Section.new
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'slack_message'
3
- gem.version = "1.7.0"
3
+ gem.version = "1.7.1"
4
4
  gem.summary = "A nice DSL for composing rich messages in Slack"
5
5
  gem.authors = ["Joe Mastey"]
6
6
  gem.email = 'hello@joemastey.com'
@@ -7,9 +7,10 @@ RSpec.describe SlackMessage do
7
7
 
8
8
  describe "API convenience" do
9
9
  it "can grab user IDs" do
10
- allow(SlackMessage::Api).to receive(:api_request)
11
- .with(/hello@joemastey.com/)
12
- .and_return({ "user" => { "id" => "ABC123" }})
10
+ SlackMessage.configure { |c| c.api_token = "asdf" }
11
+ allow(Net::HTTP).to receive(:start).and_return(
12
+ double(code: "200", body: '{ "user": { "id": "ABC123" }}')
13
+ )
13
14
 
14
15
  result = SlackMessage.user_id_for("hello@joemastey.com")
15
16
  expect(result).to eq("ABC123")
@@ -63,7 +64,6 @@ RSpec.describe SlackMessage do
63
64
  config.add_profile(:nonstandard, name: 'another profile', url: 'http://hooks.slack.com/1234/')
64
65
  end
65
66
 
66
-
67
67
  expect(SlackMessage.configuration.profile(:default)[:name]).to eq('default profile')
68
68
  expect(SlackMessage.configuration.profile(:nonstandard)[:name]).to eq('another profile')
69
69
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack_message
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Mastey