flashplayer 10.1.6.pre → 10.1.7.pre
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.
- data/VERSION +1 -1
- data/lib/flashplayer/log_file.rb +18 -7
- data/test/unit/log_file_test.rb +12 -1
- data/test/unit/task_test.rb +3 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
10.1.
|
1
|
+
10.1.7.pre
|
data/lib/flashplayer/log_file.rb
CHANGED
@@ -9,7 +9,7 @@ module FlashPlayer
|
|
9
9
|
@logger = $stdout
|
10
10
|
end
|
11
11
|
|
12
|
-
def tail thread
|
12
|
+
def tail thread=nil
|
13
13
|
tail_path flashlog_path, thread
|
14
14
|
end
|
15
15
|
|
@@ -23,7 +23,7 @@ module FlashPlayer
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def read_flashlog_at path, thread=nil
|
26
|
-
thread ||=
|
26
|
+
thread ||= fake_thread
|
27
27
|
lines_put = 0
|
28
28
|
|
29
29
|
trap("INT") { thread.kill }
|
@@ -74,11 +74,22 @@ module FlashPlayer
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
+
def fake_thread
|
78
|
+
Thread.new do
|
79
|
+
while true
|
80
|
+
sleep(0.2)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
77
85
|
end
|
78
86
|
end
|
79
87
|
|
80
|
-
desc "Tail the flashlog.txt and block"
|
81
|
-
task :flashlog do
|
82
|
-
|
83
|
-
|
84
|
-
|
88
|
+
#desc "Tail the flashlog.txt and block"
|
89
|
+
#task :flashlog do
|
90
|
+
#mm_config = FlashPlayer::MMConfig.new
|
91
|
+
#mm_config.create
|
92
|
+
#reader = FlashPlayer::LogFile.new
|
93
|
+
#reader.tail
|
94
|
+
#end
|
95
|
+
|
data/test/unit/log_file_test.rb
CHANGED
@@ -20,7 +20,6 @@ class LogFileTest < Test::Unit::TestCase
|
|
20
20
|
end
|
21
21
|
|
22
22
|
should "read until killed" do
|
23
|
-
|
24
23
|
blocked = true
|
25
24
|
t = Thread.new {
|
26
25
|
@reader.tail
|
@@ -31,6 +30,18 @@ class LogFileTest < Test::Unit::TestCase
|
|
31
30
|
t.kill
|
32
31
|
end
|
33
32
|
|
33
|
+
|
34
|
+
# This method only works when run alone -
|
35
|
+
# Under normal circumstances, the SproutTestCase
|
36
|
+
# clears out any Rake tasks that have been defined
|
37
|
+
# and we don't have an easy way to redefine the
|
38
|
+
# task...
|
39
|
+
#should "read from rake task" do
|
40
|
+
#FlashPlayer::LogFile.any_instance.stubs(:logger).returns StringIO.new
|
41
|
+
#FlashPlayer::LogFile.any_instance.expects(:read_flashlog_at)
|
42
|
+
#Rake.application[:flashlog].invoke
|
43
|
+
#end
|
44
|
+
|
34
45
|
end
|
35
46
|
end
|
36
47
|
|
data/test/unit/task_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), 'test_helper')
|
2
2
|
|
3
|
-
class
|
3
|
+
class TaskTest < Test::Unit::TestCase
|
4
4
|
include SproutTestCase
|
5
5
|
|
6
6
|
context "A FlashPlayerTask" do
|
@@ -73,10 +73,11 @@ class FlashPlayerTaskTest < Test::Unit::TestCase
|
|
73
73
|
|
74
74
|
def configure_task t
|
75
75
|
t.logger = StringIO.new
|
76
|
+
|
76
77
|
# Comment following lines to really launch the player:
|
77
78
|
sys = FakeSystem.new
|
78
79
|
t.stubs(:current_system).returns sys
|
79
|
-
sys.expects(:open_flashplayer_with)
|
80
|
+
sys.expects(:open_flashplayer_with).returns Thread.new{}
|
80
81
|
end
|
81
82
|
end
|
82
83
|
|
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 10
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 7
|
9
9
|
- pre
|
10
|
-
version: 10.1.
|
10
|
+
version: 10.1.7.pre
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Luke Bayes
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-28 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|