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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16615aeb9eacc25370851a85e1dcad3724a254aab055e637753c55333f2db258
4
- data.tar.gz: 400711db9d91883997c299cbebdef2ff78c6a40ad0055dc5dba6ebcd5a0716b2
3
+ metadata.gz: 5898c433827e6665893d89e71f708ca1a9cf2095eb3439278e09b85c4f6c8268
4
+ data.tar.gz: d88358607bd3465b34565e5468eab0c8a9633528c107719c9e84405623cc087b
5
5
  SHA512:
6
- metadata.gz: 8d37aa1d018f8415a4eeadbf47a8666c46038ccb4ffa3dab58030b61b11c26b90744a5eaed90094bdee162e002f8bffb1bfa1ce0546a28a20513de23fd7df4f4
7
- data.tar.gz: 20da2c0f373ccf9ad2376924b65650e09acf8c7609624af84c3e3c98b99950412349185241b57f812b798b221f07ffc5b6818c8b6f9ce31c14ea7eab153a60d7
6
+ metadata.gz: 4f95489ce6a24ebbb0fabfd285d6849db97dceb057f49eaf627a20dd9523315322f6d939551bc9f1b0860111f133d9a49d950cf4f34eee3812f3506fab077f9f
7
+ data.tar.gz: '02591a5ecf1ff7fa05fbb2dac72e22a91cde8e3d6cbd8387cab39672a568ad8e5c095802708be084d9b0d4c3dcad431c1e0b314e6c815859de985be0713c9b5e'
data/Gemfile.lock ADDED
@@ -0,0 +1,20 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ traq_webhook (0.2.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.5.0)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ bundler (~> 2.0)
16
+ rake (~> 10.0)
17
+ traq_webhook!
18
+
19
+ BUNDLED WITH
20
+ 2.0.1
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 = 'YOUR TRAQ_WEBHOOK_ID'
33
- config.token = 'YOUR TRAQ_SECRET_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/[USERNAME]/traq_webhook.
42
+ Bug reports and pull requests are welcome on GitHub at https://github.com/nagatea/traQ_webhook-ruby.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
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"
@@ -1,3 +1,3 @@
1
1
  module TraqWebhook
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.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-05-15 00:00:00.000000000 Z
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