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 +4 -4
- data/.travis.yml +2 -2
- data/Gemfile +4 -0
- data/README.md +1 -0
- data/lib/takosan.rb +2 -2
- data/lib/takosan/version.rb +1 -1
- data/takosan.gemspec +2 -0
- data/test/takosan_test.rb +17 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9e784f08b0f71d085b6486fe7fd57804a32ca35
|
4
|
+
data.tar.gz: c0f884f4bde7da2692b853f35ddf2d78f6468728
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7f6aba78e68120af15c5767115e3036b70722667f5e74a77935deb43c0f53225f1bbfc5824d7c3c8392bfb48c51e3da68e237189b2cce618f60459467ab1efc
|
7
|
+
data.tar.gz: df6de3df3d3eacdfc3d8c641cd16fa2888df753f7cf8cbbd42e6b16c3e56f40cb6c0b20d1f129d4abab396439062f53b14acb190595a588368670686f02c0571
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
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:
|
data/lib/takosan.rb
CHANGED
@@ -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)
|
data/lib/takosan/version.rb
CHANGED
data/takosan.gemspec
CHANGED
@@ -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)/})
|
data/test/takosan_test.rb
CHANGED
@@ -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(
|
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.
|
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:
|
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:
|
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.
|
121
|
+
rubygems_version: 2.6.8
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: Ruby wrapper of Takosan
|