ikachan 0.0.1 → 0.0.2
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/LICENSE.txt +1 -1
- data/README.md +3 -0
- data/ikachan.gemspec +1 -1
- data/lib/ikachan.rb +5 -0
- data/lib/ikachan/version.rb +1 -1
- data/test/ikachan_test.rb +18 -0
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a329041640650e54b092f6ccb728fddab77cf88
|
4
|
+
data.tar.gz: 8a38d868fb172388c003737c2a66021d6ab5b520
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af72574494a5173754c9cae68c5d9a0c5fff89cb72a2c83b2490e53d20d7296455bde7e79a03e1f0c410c8953fff2d18cf8fd4eba4c30b90f8378091b168706d
|
7
|
+
data.tar.gz: 6acb6a0a0eb5471eeea4c5526beb65670de169c82b92ecc7c4063fbdab28db6dd1c57d7f43db21383b438c10df6cdd08866553979ee77400a393f357cae00785
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
data/ikachan.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["shibata.hiroshi@gmail.com"]
|
11
11
|
spec.summary = %q{Ruby wrapper of Ikachan}
|
12
12
|
spec.description = %q{Ruby wrapper of Ikachan}
|
13
|
-
spec.homepage = "https://github.com/
|
13
|
+
spec.homepage = "https://github.com/pepabo/ikachan"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
data/lib/ikachan.rb
CHANGED
@@ -18,6 +18,11 @@ module Ikachan
|
|
18
18
|
request('/notice', { 'channel' => @@channel, 'message' => message })
|
19
19
|
end
|
20
20
|
|
21
|
+
def privmsg(message)
|
22
|
+
join
|
23
|
+
request('/privmsg', { 'channel' => @@channel, 'message' => message })
|
24
|
+
end
|
25
|
+
|
21
26
|
def uri_for(path = nil)
|
22
27
|
uri = URI.parse("#{@@url}/#{path}")
|
23
28
|
uri.path = Pathname.new(uri.path).cleanpath.to_s
|
data/lib/ikachan/version.rb
CHANGED
data/test/ikachan_test.rb
CHANGED
@@ -43,6 +43,24 @@ class IkachanTest < Test::Unit::TestCase
|
|
43
43
|
Ikachan.notice('foo bar buzz')
|
44
44
|
end
|
45
45
|
|
46
|
+
def test_privmsg
|
47
|
+
Ikachan.expects(:join)
|
48
|
+
|
49
|
+
http = mock('http')
|
50
|
+
http.stub_everything
|
51
|
+
http.expects(:request)
|
52
|
+
Net::HTTP.expects(:new).with('irc.example.com', 4649).returns(http)
|
53
|
+
|
54
|
+
req = mock('req')
|
55
|
+
req.stub_everything
|
56
|
+
req.expects(:form_data=).with do |params|
|
57
|
+
(params['channel'] == '#example') && (params['message'] == 'foo bar buzz')
|
58
|
+
end
|
59
|
+
Net::HTTP::Post.expects(:new).with('/privmsg').returns(req)
|
60
|
+
|
61
|
+
Ikachan.privmsg('foo bar buzz')
|
62
|
+
end
|
63
|
+
|
46
64
|
def test_rescue_timeout_error
|
47
65
|
Ikachan.expects(:join)
|
48
66
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ikachan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SHIBATA Hiroshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -98,7 +98,7 @@ files:
|
|
98
98
|
- lib/ikachan/version.rb
|
99
99
|
- test/ikachan_test.rb
|
100
100
|
- test/test_helper.rb
|
101
|
-
homepage: https://github.com/
|
101
|
+
homepage: https://github.com/pepabo/ikachan
|
102
102
|
licenses:
|
103
103
|
- MIT
|
104
104
|
metadata: {}
|
@@ -118,11 +118,10 @@ 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.3.0
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: Ruby wrapper of Ikachan
|
125
125
|
test_files:
|
126
126
|
- test/ikachan_test.rb
|
127
127
|
- test/test_helper.rb
|
128
|
-
has_rdoc:
|