slack_message 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/slack_message.rb +31 -0
- metadata +88 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a57ae906ede72e7fa4d7a1425403bff7ceac205867076da31ba8d134b29cb9d3
|
4
|
+
data.tar.gz: 75c900293ec441d1ce75847617df5b3bb0a427df847a844e423fa9b2de9d803d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 98ed70ad1291694b3e7c468e7094db4b915ef6ee5539a820473e4aaa62bc163272dddd004dcfec159beeeac828aef6f8f8e78ccf709356bf1ffeb3e804c36bc6
|
7
|
+
data.tar.gz: 10faaa8dee70db69d2437cd436bc67e456919d2a7ad358c5e242ab80f6c6bd44dc665131f4657cf439472f016d2d01626edeae44fe0a1a9306917bea93c6cfce
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module SlackMessage
|
2
|
+
require 'slack_message/dsl'
|
3
|
+
require 'slack_message/api'
|
4
|
+
require 'slack_message/configuration'
|
5
|
+
|
6
|
+
def self.configuration
|
7
|
+
Configuration
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.configure(&block)
|
11
|
+
configuration.configure(&block)
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.user_id_for(email)
|
15
|
+
Api::user_id_for(email)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.post_to(target, as: :default, &block)
|
19
|
+
payload = build(&block)
|
20
|
+
profile = Configuration.profile(as)
|
21
|
+
target = user_id_for(target) if target =~ /^\S{1,}@\S{2,}\.\S{2,}$/
|
22
|
+
|
23
|
+
Api.post(payload, target, profile)
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.build(&block)
|
27
|
+
Dsl.new.tap do |instance|
|
28
|
+
instance.instance_eval(&block)
|
29
|
+
end.send(:render)
|
30
|
+
end
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: slack_message
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Joe Mastey
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-09-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.10.0
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.10.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.14.1
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.14.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rb-readline
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.5.5
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.5.5
|
55
|
+
description:
|
56
|
+
email: hello@joemastey.com
|
57
|
+
executables: []
|
58
|
+
extensions: []
|
59
|
+
extra_rdoc_files: []
|
60
|
+
files:
|
61
|
+
- lib/slack_message.rb
|
62
|
+
homepage: https://rubygemgem.org/gems/slack_message
|
63
|
+
licenses:
|
64
|
+
- MIT
|
65
|
+
metadata:
|
66
|
+
homepage_uri: http://github.com/jmmastey/slack_message
|
67
|
+
changelog_uri: https://github.com/jmmastey/slack_message/blob/master/CHANGELOG.md
|
68
|
+
source_code_uri: http://github.com/jmmastey/slack_message
|
69
|
+
post_install_message:
|
70
|
+
rdoc_options: []
|
71
|
+
require_paths:
|
72
|
+
- lib
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
requirements: []
|
84
|
+
rubygems_version: 3.1.6
|
85
|
+
signing_key:
|
86
|
+
specification_version: 4
|
87
|
+
summary: A nice DSL for composing rich messages in Slack
|
88
|
+
test_files: []
|