takosan 1.2.0 → 1.3.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
  SHA1:
3
- metadata.gz: 9322ee0eae07e74f6830003044eb1e82eff0be91
4
- data.tar.gz: 2fc331df355382b8bdb2417a6e5c00cef559d9d6
3
+ metadata.gz: d9e784f08b0f71d085b6486fe7fd57804a32ca35
4
+ data.tar.gz: c0f884f4bde7da2692b853f35ddf2d78f6468728
5
5
  SHA512:
6
- metadata.gz: 1932662ddcd679f821ef1c9162e134d0dd0ee57fa6db5606c5442c4c7379333fc18039f67b963854b4c7708ac54f8ea61641f1ac253d72432f0081d3cde319c4
7
- data.tar.gz: 8901baf2378c3a3497b452030d9d2a872bdefea35ad60bc3fdbae601152feedab63467e0dfe0148320d7350522614dba32b5b682866661f6bd12e39f23e77303
6
+ metadata.gz: d7f6aba78e68120af15c5767115e3036b70722667f5e74a77935deb43c0f53225f1bbfc5824d7c3c8392bfb48c51e3da68e237189b2cce618f60459467ab1efc
7
+ data.tar.gz: df6de3df3d3eacdfc3d8c641cd16fa2888df753f7cf8cbbd42e6b16c3e56f40cb6c0b20d1f129d4abab396439062f53b14acb190595a588368670686f02c0571
@@ -1,11 +1,11 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 1.9.3
5
4
  - 2.0.0
6
5
  - 2.1
7
6
  - 2.2
8
- - 2.3.0
7
+ - 2.3.3
8
+ - 2.4.0
9
9
  - ruby-head
10
10
 
11
11
  script: rake test
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in takosan.gemspec
4
4
  gemspec
5
+
6
+ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.2.2")
7
+ gem "activesupport", ">= 4.0.0", "< 5.0.0"
8
+ end
data/README.md CHANGED
@@ -27,6 +27,7 @@ Or install it yourself as:
27
27
  Takosan.url = "http://irc.example.com:4649"
28
28
  Takosan.channel = "#example"
29
29
  Takosan.privmsg 'awesome comment'
30
+ Takosan.privmsg 'awesome comment and title with link', color: '#000', title: 'black title', title_link: 'http://example.com'
30
31
  ```
31
32
 
32
33
  You can change Takosan's icon and name like the following:
@@ -9,8 +9,8 @@ module Takosan
9
9
 
10
10
  module_function
11
11
 
12
- def privmsg(message)
13
- request('/privmsg', { 'channel' => @@channel, 'message' => message, 'name' => @@name, 'icon' => @@icon })
12
+ def privmsg(message, **options)
13
+ request('/privmsg', options.merge({ 'channel' => @@channel, 'message' => message, 'name' => @@name, 'icon' => @@icon }))
14
14
  end
15
15
 
16
16
  def uri_for(path = nil)
@@ -1,3 +1,3 @@
1
1
  module Takosan
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -13,6 +13,8 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://github.com/pepabo/takosan"
14
14
  spec.license = "MIT"
15
15
 
16
+ spec.required_ruby_version = ">= 2.0.0"
17
+
16
18
  spec.files = `git ls-files -z`.split("\x0")
17
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
@@ -24,10 +24,26 @@ class TakosanTest < Test::Unit::TestCase
24
24
  Takosan.privmsg('foo bar buzz')
25
25
  end
26
26
 
27
+ def test_privmsg_with_message_attachments
28
+ http = mock('http')
29
+ http.stub_everything
30
+ http.expects(:request)
31
+ Net::HTTP.expects(:new).with('irc.example.com', 4649).returns(http)
32
+
33
+ req = mock('req')
34
+ req.stub_everything
35
+ req.expects(:form_data=).with do |params|
36
+ (params['channel'] == '#example') && (params['message'] == 'foo bar buzz')
37
+ end
38
+ Net::HTTP::Post.expects(:new).with('/privmsg').returns(req)
39
+
40
+ Takosan.privmsg('foo bar buzz', title: 'black', color: '#000')
41
+ end
42
+
27
43
  def test_rescue_timeout_error
28
44
  http = stub('http')
29
45
  http.stub_everything
30
- http.stubs(:request).raises(TimeoutError, 'timeout error!')
46
+ http.stubs(:request).raises(Timeout::Error, 'timeout error!')
31
47
  Net::HTTP.expects(:new).with('irc.example.com', 4649).returns(http)
32
48
 
33
49
  req = stub('req')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: takosan
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OKUMURA Takahiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-15 00:00:00.000000000 Z
11
+ date: 2017-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -110,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
110
  requirements:
111
111
  - - ">="
112
112
  - !ruby/object:Gem::Version
113
- version: '0'
113
+ version: 2.0.0
114
114
  required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - ">="
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  requirements: []
120
120
  rubyforge_project:
121
- rubygems_version: 2.5.1
121
+ rubygems_version: 2.6.8
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Ruby wrapper of Takosan