traq_webhook 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 +4 -4
- data/Gemfile.lock +20 -0
- data/README.md +4 -10
- data/Rakefile +2 -0
- data/lib/traq_webhook.rb +2 -1
- data/lib/traq_webhook/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5898c433827e6665893d89e71f708ca1a9cf2095eb3439278e09b85c4f6c8268
|
4
|
+
data.tar.gz: d88358607bd3465b34565e5468eab0c8a9633528c107719c9e84405623cc087b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f95489ce6a24ebbb0fabfd285d6849db97dceb057f49eaf627a20dd9523315322f6d939551bc9f1b0860111f133d9a49d950cf4f34eee3812f3506fab077f9f
|
7
|
+
data.tar.gz: '02591a5ecf1ff7fa05fbb2dac72e22a91cde8e3d6cbd8387cab39672a568ad8e5c095802708be084d9b0d4c3dcad431c1e0b314e6c815859de985be0713c9b5e'
|
data/Gemfile.lock
ADDED
data/README.md
CHANGED
@@ -3,14 +3,7 @@ traQ Webhook用Rubyライブラリ
|
|
3
3
|
|
4
4
|
----
|
5
5
|
|
6
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/traq_webhook`. To experiment with that code, run `bin/console` for an interactive prompt.
|
7
|
-
|
8
|
-
TODO: Delete this and the text above, and describe your gem
|
9
|
-
|
10
6
|
## Installation
|
11
|
-
|
12
|
-
Add this line to your application's Gemfile:
|
13
|
-
|
14
7
|
```ruby
|
15
8
|
gem 'traq_webhook'
|
16
9
|
```
|
@@ -29,8 +22,9 @@ Or install it yourself as:
|
|
29
22
|
require 'traq_webhook'
|
30
23
|
|
31
24
|
client = TraqWebhook::Client.new do |config|
|
32
|
-
config.id
|
33
|
-
config.token
|
25
|
+
config.id = 'YOUR TRAQ_WEBHOOK_ID'
|
26
|
+
config.token = 'YOUR TRAQ_SECRET_TOKEN'
|
27
|
+
config.channel_id = 'TRAQ_CHANNEL_ID' # Option
|
34
28
|
end
|
35
29
|
|
36
30
|
message = 'example message'
|
@@ -45,4 +39,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
45
39
|
|
46
40
|
## Contributing
|
47
41
|
|
48
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
42
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/nagatea/traQ_webhook-ruby.
|
data/Rakefile
ADDED
data/lib/traq_webhook.rb
CHANGED
@@ -5,7 +5,7 @@ require "openssl"
|
|
5
5
|
|
6
6
|
module TraqWebhook
|
7
7
|
class Client
|
8
|
-
attr_accessor :id, :token
|
8
|
+
attr_accessor :id, :token, :channel_id
|
9
9
|
|
10
10
|
def initialize
|
11
11
|
yield self if block_given?
|
@@ -17,6 +17,7 @@ module TraqWebhook
|
|
17
17
|
req = Net::HTTP::Post.new(uri.path)
|
18
18
|
req['Content-Type'] = 'text/plain; charset=utf-8'
|
19
19
|
req['X-TRAQ-Signature'] = signature
|
20
|
+
req['X-TRAQ-Channel-Id'] = self.channel_id unless self.channel_id.nil?
|
20
21
|
req.body = message
|
21
22
|
option = {
|
22
23
|
use_ssl: uri.scheme = "https"
|
data/lib/traq_webhook/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traq_webhook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nagatech
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -47,8 +47,10 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- ".gitignore"
|
49
49
|
- Gemfile
|
50
|
+
- Gemfile.lock
|
50
51
|
- LICENSE
|
51
52
|
- README.md
|
53
|
+
- Rakefile
|
52
54
|
- lib/traq_webhook.rb
|
53
55
|
- lib/traq_webhook/version.rb
|
54
56
|
- traq_webhook.gemspec
|