Pulse 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/library/pulse/client.rb +3 -4
- data/library/pulse/handling.rb +1 -5
- data/library/pulse/script/cache.rb +3 -3
- data/library/pulse/script.rb +7 -1
- metadata +3 -3
data/library/pulse/client.rb
CHANGED
@@ -17,15 +17,14 @@ module Pulse
|
|
17
17
|
@conversations = {}
|
18
18
|
|
19
19
|
load_scripts
|
20
|
-
end
|
21
20
|
|
22
|
-
def connect
|
23
21
|
trap 2 do
|
24
22
|
unload_scripts
|
25
|
-
@connection.close
|
26
|
-
Thread.list.each &:kill
|
27
23
|
transmit :QUIT, "I was interrupted"
|
28
24
|
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def connect
|
29
28
|
@connection.establish
|
30
29
|
end
|
31
30
|
|
data/library/pulse/handling.rb
CHANGED
@@ -57,11 +57,7 @@ module Pulse
|
|
57
57
|
user.channel = conversation
|
58
58
|
|
59
59
|
if message =~ /^\x01DCC (.*?)\x01$/
|
60
|
-
|
61
|
-
emit :dcc_resume_file, user, conversation, $1.split
|
62
|
-
else
|
63
|
-
emit :dcc, user, conversation, $1.split
|
64
|
-
end
|
60
|
+
emit :dcc, user, conversation, $1.split
|
65
61
|
else
|
66
62
|
emit :conversation, user, conversation, message
|
67
63
|
end
|
@@ -24,9 +24,9 @@ module Pulse
|
|
24
24
|
|
25
25
|
puts "Imported cache from #{path} …"
|
26
26
|
end
|
27
|
-
rescue
|
28
27
|
|
29
|
-
|
28
|
+
rescue
|
29
|
+
puts "The cache is corrupted. Removing."
|
30
30
|
File.unlink path
|
31
31
|
end
|
32
32
|
|
@@ -34,7 +34,7 @@ module Pulse
|
|
34
34
|
def clear sure = false; @containers.clear if sure end
|
35
35
|
|
36
36
|
def [] key; @containers[key] ||= {} end
|
37
|
-
def []= key, value; @containers[key]
|
37
|
+
def []= key, value; @containers[key] = value end
|
38
38
|
|
39
39
|
private
|
40
40
|
|
data/library/pulse/script.rb
CHANGED
@@ -32,10 +32,17 @@ module Pulse
|
|
32
32
|
%{#<#{self.class.name} @name=#{@name.inspect} @version=#{@version.inspect} @author=#{@author.inspect}}
|
33
33
|
end
|
34
34
|
|
35
|
+
def cache_for name
|
36
|
+
script = @client.scripts.find { |script| script.name == name }
|
37
|
+
script ? script.cache : nil
|
38
|
+
end
|
39
|
+
|
35
40
|
def has_cache?
|
36
41
|
File.exists? "#{File.expand_path File.dirname $0}/cache/#@name.yml"
|
37
42
|
end
|
38
43
|
|
44
|
+
def cache; @cache ||= Cache.new self end
|
45
|
+
|
39
46
|
private
|
40
47
|
|
41
48
|
def evaluate_script
|
@@ -44,6 +51,5 @@ module Pulse
|
|
44
51
|
puts "Parse error: #{$!.message}"
|
45
52
|
end
|
46
53
|
|
47
|
-
def cache; @cache ||= Cache.new self end
|
48
54
|
end
|
49
55
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 1.2.
|
8
|
+
- 3
|
9
|
+
version: 1.2.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Mikkel Kroman
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: executables
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-11-
|
17
|
+
date: 2010-11-28 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|