metric_tools 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +0 -6
- data/doc/AWS.html +150 -0
- data/doc/{Pref/Skype.html → AWS/S3.html} +19 -25
- data/doc/Gemfile.html +16 -8
- data/doc/MetricTools.html +21 -9
- data/doc/MetricTools/IndexTree.html +197 -20
- data/doc/MetricTools/S3.html +47 -21
- data/doc/MetricTools/SpreadSheet.html +139 -22
- data/doc/MetricTools/Table.html +210 -48
- data/doc/Object.html +16 -27
- data/doc/Pref.html +18 -7
- data/doc/Pref/GoogleDocs.html +17 -7
- data/doc/Pref/S3.html +17 -7
- data/doc/README_md.html +170 -0
- data/doc/created.rid +24 -13
- data/doc/doc/created_rid.html +111 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/index.html +15 -7
- data/doc/js/darkfish.js +9 -7
- data/doc/js/search_index.js +1 -1
- data/doc/metric_tools_gemspec.html +132 -0
- data/doc/rdoc.css +52 -0
- data/doc/table_of_contents.html +48 -22
- data/metric_tools.gemspec +1 -2
- metadata +7 -21
- data/doc/MetricTools/Skype.html +0 -343
- data/lib/metric_tools/skype.rb +0 -68
- data/spec/skype_spec.rb +0 -39
data/lib/metric_tools/skype.rb
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
require 'rb-skypemac'
|
2
|
-
|
3
|
-
module MetricTools
|
4
|
-
|
5
|
-
#
|
6
|
-
# Skypeのチャットにメッセージをpostするクラスです。
|
7
|
-
# 使用するMac上でSkype for Mac OSXが起動していて、
|
8
|
-
# 対象のチャットルームに発言できるアカウントでログインされている必要があります。
|
9
|
-
#
|
10
|
-
class Skype
|
11
|
-
|
12
|
-
class << self
|
13
|
-
|
14
|
-
#
|
15
|
-
# nameで指定したチャットルームに発言出来る状態にします。
|
16
|
-
# login_chat("[GREE] パンカク連絡チャット")
|
17
|
-
#
|
18
|
-
def login_chat(name)
|
19
|
-
chats = SkypeMac::Skype.send_(:command => 'SEARCH RECENTCHATS')
|
20
|
-
chats = chats.sub("CHATS ","").split(/,/)
|
21
|
-
|
22
|
-
for id in chats
|
23
|
-
chat_info = SkypeMac::Skype.send_(:command => 'GET CHAT %s FRIENDLYNAME' % id).split(' ')
|
24
|
-
friendly_name = chat_info[3]
|
25
|
-
|
26
|
-
if friendly_name.include?(name)
|
27
|
-
@chat_id = chat_info[1]
|
28
|
-
@chat_name = friendly_name
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
raise "not existing chat room : #{name}" if @chat_id.nil?
|
33
|
-
@chat_id
|
34
|
-
end
|
35
|
-
|
36
|
-
def logout
|
37
|
-
@chat_id = nil
|
38
|
-
@chat_name = nil
|
39
|
-
end
|
40
|
-
|
41
|
-
#
|
42
|
-
# 現在のチャットルームのidを返します
|
43
|
-
#
|
44
|
-
def current_chat_id
|
45
|
-
@chat_id
|
46
|
-
end
|
47
|
-
|
48
|
-
#
|
49
|
-
# 現在のチャットルームの表示名を返します
|
50
|
-
#
|
51
|
-
def current_chat_name
|
52
|
-
@chat_name
|
53
|
-
end
|
54
|
-
|
55
|
-
#
|
56
|
-
# 現在のチャットルームに発言します
|
57
|
-
#
|
58
|
-
def post(message)
|
59
|
-
return puts 'please login before.' if current_chat_id.nil?
|
60
|
-
|
61
|
-
SkypeMac::Skype.send_(:command => "CHATMESSAGE #{current_chat_id} #{message}");
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
data/spec/skype_spec.rb
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
require 'metric_tools'
|
4
|
-
|
5
|
-
include MetricTools
|
6
|
-
|
7
|
-
describe MetricTools::Skype do
|
8
|
-
before do
|
9
|
-
Skype.logout
|
10
|
-
end
|
11
|
-
|
12
|
-
describe '#login_chat' do
|
13
|
-
context 'when specified existing room name' do
|
14
|
-
it 'login chat room has specified friendly name' do
|
15
|
-
Skype.login_chat(Pref::Skype::TEST_CHAT_ROOM)
|
16
|
-
|
17
|
-
Skype.current_chat_id.should_not be_nil
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
context 'when specified not existing room name' do
|
22
|
-
it 'login chat room has specified friendly name' do
|
23
|
-
proc { Skype.login_chat("そんな部屋はない") }.should raise_error(RuntimeError, 'not existing chat room : そんな部屋はない')
|
24
|
-
Skype.current_chat_id.should be_nil
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
describe '#post' do
|
30
|
-
before do
|
31
|
-
Skype.login_chat(Pref::Skype::TEST_CHAT_ROOM)
|
32
|
-
end
|
33
|
-
|
34
|
-
it "post a message to specified id's chat" do
|
35
|
-
Skype.post("テストです。" + DateTime.now.to_s)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|