dde 0.2.9 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -5
- data/.gitignore +21 -22
- data/LICENSE +20 -20
- data/README.rdoc +19 -19
- data/Rakefile +60 -60
- data/VERSION +1 -1
- data/bin/dde_main +32 -32
- data/dde.gemspec +99 -99
- data/doc/ddeml.d.txt +374 -374
- data/doc/types.txt +159 -159
- data/exp/exp_client.rb +44 -44
- data/exp/exp_dde_monitor.rb +18 -18
- data/exp/exp_dde_server.rb +36 -36
- data/exp/exp_lib.rb +38 -38
- data/exp/exp_server.rb +44 -44
- data/features/dde.feature +9 -9
- data/features/support/env.rb +4 -4
- data/lib/dde.rb +9 -9
- data/lib/dde/app.rb +91 -91
- data/lib/dde/client.rb +102 -102
- data/lib/dde/dde_string.rb +32 -32
- data/lib/dde/monitor.rb +93 -93
- data/lib/dde/server.rb +40 -40
- data/lib/dde/xl_server.rb +89 -89
- data/lib/dde/xl_table.rb +190 -190
- data/spec/dde/app_shared.rb +84 -84
- data/spec/dde/app_spec.rb +7 -7
- data/spec/dde/client_spec.rb +199 -199
- data/spec/dde/dde_string_spec.rb +39 -39
- data/spec/dde/monitor_spec.rb +33 -33
- data/spec/dde/server_shared.rb +91 -91
- data/spec/dde/server_spec.rb +36 -36
- data/spec/dde/xl_server_spec.rb +63 -63
- data/spec/dde/xl_table_spec.rb +50 -50
- data/spec/spec.opts +2 -2
- data/spec/spec_helper.rb +21 -25
- metadata +35 -18
data/spec/dde/xl_table_spec.rb
CHANGED
@@ -1,51 +1,51 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
module
|
4
|
-
|
5
|
-
DDE_DATA = "\x10\x00\x04\x00\b\x00\t\x00\x02\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x18\x00fffff\x8Ee@\x00\x00\x00\x00\x00y\xB7@\x00\x00\x00\x00\x80b\xC1@\x02\x00\x01\x00\x00\x01\x00(\x00\x9A\x99\x99\x99\x99\x99\xB9?q=\n\xD7\xA3\x98e@)\\\x8F\xC2\xF5`e@\\\x8F\xC2\xF5(\x8Ce@H\xE1z$XLZA\x01\x00H\x00q=\n\xD7\xA3\x88e@\x00\x00\x00\x00\x80\xED\xC9@\x00\x00\x00\x00\x00\x00\x00\x00\xB8\x1E\x85\xEBQ e@{\x14\xAEG\xE1z\xF4?\xAEG\xE1z\x14\xCEe@\xA4p=\n\xD7\ve@H\xE1z\x14\xAE\x7Fe@\x00\x00\x80\x94\xC0-\aB\x01\x00H\x00ffff&\xF4\xB2@\x00\x00\x00\x00\x00P\x91@\x00\x00\x00\x00\x00\x00\x00\x00=\n\xD7\xA30\xA2\xB2@ffffff\xEE?\x00\x00\x00\x00\x00$\xB3@\x00\x00\x00\x00\x00\x9A\xB2@=\n\xD7\xA3\xF0\xE1\xB2@\x00\x00\x90\x9DEy\xF0A\x01\x00H\x00\x00\x00\x00\x00\x00\xD0m@\x00\x00\x00\x00\x00\xF9\xBE@\x00\x00\x00\x00\x00\x00\x00\x00\x9A\x99\x99\x99\x99\x99m@\xB8\x1E\x85\xEBQ\xB8\xAE?H\xE1z\x14\xAE\xFFm@\x00\x00\x00\x00\x00hm@\xECQ\xB8\x1E\x85\xC3m@\x00\x00\xC0\x8Fp\x80\xE6A\x01\x00H\x00\xCD\xCC\xCC\xCC\xCC\xBCT@\x00\x00\x00\x00\x80\xAF\xE7@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x90T@{\x14\xAEG\xE1z\xA4?fffff\xE6T@\x9A\x99\x99\x99\x99YT@\x1F\x85\xEBQ\xB8\xAET@\x00\x00t\x80r<\x12B\x01\x00\b\x00\xF6(\\\x8F\xC2\n\x97@\x02\x00\b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00H\x00\x83\xC0\xCA\xA1E\xB6\xB3?\x00\x00\x00\x00 \xC8\xF1@\x00\x00\x00\x00\x00\x00\x00\x00@\xA4\xDF\xBE\x0E\x9C\xB3?\xA4p=\n\xD7\xA3\xC0?\t\xF9\xA0g\xB3\xEA\xB3?\xBAk\t\xF9\xA0g\xB3?r\xF9\x0F\xE9\xB7\xAF\xB3?\x00\x00 \xBC\xA35\xE9A"
|
6
|
-
DRAW_OUTPUT = "-----
|
7
|
-
[G]V
|
8
|
-
[G]V 172.45 6009 8901 0.1 172.77 171.03 172.38 6893920.57
|
9
|
-
[G]V 172.27 13275 0 169.01 1.28 174.44 168.37 171.99 12443980432
|
10
|
-
[G]V 4852.15 1108 0 4770.19 0.95 4900 4762 4833.94 4422130137
|
11
|
-
[G]V 238.5 7929 0 236.8 0.06 239.99 235.25 238.11 3020129406
|
12
|
-
[G]V 82.95 48508 0 82.25 0.04 83.6 81.4 82.73 19580887069
|
13
|
-
[G]V 1474.69
|
14
|
-
[G]V 0.077 72834 0 0.0766 0.13 0.0778 0.0758 0.0769 3383565793
|
15
|
-
Last: 8 in 0.0 s(0.0 s/rec), total: 8 in 0.0 s(0.0 s/rec)"
|
16
|
-
|
17
|
-
describe
|
18
|
-
before(:each) {@data =
|
19
|
-
|
20
|
-
it 'starts out empty and without topic' do
|
21
|
-
@data.should be_empty
|
22
|
-
@data.topic.should == nil
|
23
|
-
end
|
24
|
-
|
25
|
-
context 'with server/client pair and started conversation' do
|
26
|
-
before(:each )do
|
27
|
-
start_callback_recorder do|*args|
|
28
|
-
@server_calls << extract_values(*args)
|
29
|
-
if args[0] == XTYP_POKE
|
30
|
-
p extract_values(*args)
|
31
|
-
@data.receive(args[5]) #, :debug)
|
32
|
-
end
|
33
|
-
DDE_FACK
|
34
|
-
end
|
35
|
-
@client.start_conversation 'service', 'topic'
|
36
|
-
end
|
37
|
-
|
38
|
-
after(:each ){stop_callback_recorder}
|
39
|
-
|
40
|
-
it 'starts out empty and without topic' do
|
41
|
-
pending
|
42
|
-
@client.send_data DDE_DATA, CF_TEXT, "item"
|
43
|
-
@data.should_not be_empty
|
44
|
-
@data.topic.should == nil
|
45
|
-
@data.draw.should == nil
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
50
|
-
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
module DdeTest
|
4
|
+
|
5
|
+
DDE_DATA = "\x10\x00\x04\x00\b\x00\t\x00\x02\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x18\x00fffff\x8Ee@\x00\x00\x00\x00\x00y\xB7@\x00\x00\x00\x00\x80b\xC1@\x02\x00\x01\x00\x00\x01\x00(\x00\x9A\x99\x99\x99\x99\x99\xB9?q=\n\xD7\xA3\x98e@)\\\x8F\xC2\xF5`e@\\\x8F\xC2\xF5(\x8Ce@H\xE1z$XLZA\x01\x00H\x00q=\n\xD7\xA3\x88e@\x00\x00\x00\x00\x80\xED\xC9@\x00\x00\x00\x00\x00\x00\x00\x00\xB8\x1E\x85\xEBQ e@{\x14\xAEG\xE1z\xF4?\xAEG\xE1z\x14\xCEe@\xA4p=\n\xD7\ve@H\xE1z\x14\xAE\x7Fe@\x00\x00\x80\x94\xC0-\aB\x01\x00H\x00ffff&\xF4\xB2@\x00\x00\x00\x00\x00P\x91@\x00\x00\x00\x00\x00\x00\x00\x00=\n\xD7\xA30\xA2\xB2@ffffff\xEE?\x00\x00\x00\x00\x00$\xB3@\x00\x00\x00\x00\x00\x9A\xB2@=\n\xD7\xA3\xF0\xE1\xB2@\x00\x00\x90\x9DEy\xF0A\x01\x00H\x00\x00\x00\x00\x00\x00\xD0m@\x00\x00\x00\x00\x00\xF9\xBE@\x00\x00\x00\x00\x00\x00\x00\x00\x9A\x99\x99\x99\x99\x99m@\xB8\x1E\x85\xEBQ\xB8\xAE?H\xE1z\x14\xAE\xFFm@\x00\x00\x00\x00\x00hm@\xECQ\xB8\x1E\x85\xC3m@\x00\x00\xC0\x8Fp\x80\xE6A\x01\x00H\x00\xCD\xCC\xCC\xCC\xCC\xBCT@\x00\x00\x00\x00\x80\xAF\xE7@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x90T@{\x14\xAEG\xE1z\xA4?fffff\xE6T@\x9A\x99\x99\x99\x99YT@\x1F\x85\xEBQ\xB8\xAET@\x00\x00t\x80r<\x12B\x01\x00\b\x00\xF6(\\\x8F\xC2\n\x97@\x02\x00\b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00H\x00\x83\xC0\xCA\xA1E\xB6\xB3?\x00\x00\x00\x00 \xC8\xF1@\x00\x00\x00\x00\x00\x00\x00\x00@\xA4\xDF\xBE\x0E\x9C\xB3?\xA4p=\n\xD7\xA3\xC0?\t\xF9\xA0g\xB3\xEA\xB3?\xBAk\t\xF9\xA0g\xB3?r\xF9\x0F\xE9\xB7\xAF\xB3?\x00\x00 \xBC\xA35\xE9A"
|
6
|
+
DRAW_OUTPUT = "-----
|
7
|
+
[G]V
|
8
|
+
[G]V 172.45 6009 8901 0.1 172.77 171.03 172.38 6893920.57
|
9
|
+
[G]V 172.27 13275 0 169.01 1.28 174.44 168.37 171.99 12443980432
|
10
|
+
[G]V 4852.15 1108 0 4770.19 0.95 4900 4762 4833.94 4422130137
|
11
|
+
[G]V 238.5 7929 0 236.8 0.06 239.99 235.25 238.11 3020129406
|
12
|
+
[G]V 82.95 48508 0 82.25 0.04 83.6 81.4 82.73 19580887069
|
13
|
+
[G]V 1474.69
|
14
|
+
[G]V 0.077 72834 0 0.0766 0.13 0.0778 0.0758 0.0769 3383565793
|
15
|
+
Last: 8 in 0.0 s(0.0 s/rec), total: 8 in 0.0 s(0.0 s/rec)"
|
16
|
+
|
17
|
+
describe Dde::XlTable do
|
18
|
+
before(:each) {@data = Dde::XlTable.new}
|
19
|
+
|
20
|
+
it 'starts out empty and without topic' do
|
21
|
+
@data.should be_empty
|
22
|
+
@data.topic.should == nil
|
23
|
+
end
|
24
|
+
|
25
|
+
context 'with server/client pair and started conversation' do
|
26
|
+
before(:each )do
|
27
|
+
start_callback_recorder do|*args|
|
28
|
+
@server_calls << extract_values(*args)
|
29
|
+
if args[0] == XTYP_POKE
|
30
|
+
p extract_values(*args)
|
31
|
+
@data.receive(args[5]) #, :debug)
|
32
|
+
end
|
33
|
+
DDE_FACK
|
34
|
+
end
|
35
|
+
@client.start_conversation 'service', 'topic'
|
36
|
+
end
|
37
|
+
|
38
|
+
after(:each ){stop_callback_recorder}
|
39
|
+
|
40
|
+
it 'starts out empty and without topic' do
|
41
|
+
pending
|
42
|
+
@client.send_data DDE_DATA, CF_TEXT, "item"
|
43
|
+
@data.should_not be_empty
|
44
|
+
@data.topic.should == nil
|
45
|
+
@data.draw.should == nil
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
51
|
end
|
data/spec/spec.opts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
--color
|
2
|
-
--format nested
|
1
|
+
--color
|
2
|
+
--format nested
|
data/spec/spec_helper.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'spork'
|
3
|
-
|
4
|
-
Spork.prefork do
|
5
|
-
# Loading more in this block will cause your tests to run faster. However,
|
6
|
-
# if you change any configuration or code from libraries loaded here, you'll
|
7
|
-
# need to restart spork for it take effect.
|
8
|
-
|
9
|
-
end
|
10
|
-
|
11
|
-
Spork.each_run do
|
12
|
-
# This code will be run each time you run your specs.
|
13
|
-
|
14
|
-
end
|
15
|
-
|
1
|
+
#require 'rubygems'
|
2
|
+
#require 'spork'
|
3
|
+
#
|
4
|
+
#Spork.prefork do
|
5
|
+
# # Loading more in this block will cause your tests to run faster. However,
|
6
|
+
# # if you change any configuration or code from libraries loaded here, you'll
|
7
|
+
# # need to restart spork for it take effect.
|
8
|
+
#
|
9
|
+
#end
|
10
|
+
#
|
11
|
+
#Spork.each_run do
|
12
|
+
# # This code will be run each time you run your specs.
|
13
|
+
#
|
14
|
+
#end
|
15
|
+
#
|
16
16
|
# --- Instructions ---
|
17
17
|
# - Sort through your spec_helper file. Place as much environment loading
|
18
18
|
# code that you don't normally modify during development in the
|
@@ -22,10 +22,6 @@ end
|
|
22
22
|
# and during each_run!
|
23
23
|
# - These instructions should self-destruct in 10 seconds. If they don't,
|
24
24
|
# feel free to delete them.
|
25
|
-
#
|
26
|
-
|
27
|
-
|
28
|
-
|
29
25
|
|
30
26
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
31
27
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
@@ -60,10 +56,10 @@ end
|
|
60
56
|
|
61
57
|
Spec::Runner.configure { |config| config.extend(SpecMacros) }
|
62
58
|
|
63
|
-
module
|
59
|
+
module DdeTest
|
64
60
|
|
65
|
-
include Win::
|
66
|
-
# @@monitor =
|
61
|
+
include Win::Dde
|
62
|
+
# @@monitor = Dde::Monitor.new
|
67
63
|
|
68
64
|
TEST_IMPOSSIBLE = 'Impossible'
|
69
65
|
TEST_STRING = "Data String"
|
@@ -79,8 +75,8 @@ module DDETest
|
|
79
75
|
def start_callback_recorder(&server_block)
|
80
76
|
@client_calls = []
|
81
77
|
@server_calls = []
|
82
|
-
@client =
|
83
|
-
@server =
|
78
|
+
@client = Dde::Client.new {|*args| @client_calls << extract_values(*args); DDE_FACK}
|
79
|
+
@server = Dde::Server.new &server_block || proc {|*args| @server_calls << extract_values(*args); DDE_FACK }
|
84
80
|
@server.start_service('service')
|
85
81
|
end
|
86
82
|
|
@@ -100,7 +96,7 @@ module DDETest
|
|
100
96
|
id = @client.id if @client
|
101
97
|
id ||= @server.id if @server
|
102
98
|
dde_query_string(id, arg)\
|
103
|
-
|| Win::
|
99
|
+
|| Win::Dde.constants(false).inject(nil) {|res, const| arg == Win::Dde.const_get(const) ? res || const : res }\
|
104
100
|
|| arg
|
105
101
|
else
|
106
102
|
arg
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dde
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 11
|
9
|
+
version: 0.2.11
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- arvicco
|
@@ -9,39 +14,49 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-04-06 00:00:00 +04:00
|
13
18
|
default_executable: dde_main
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: win
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
23
|
-
|
24
|
-
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 3
|
30
|
+
- 1
|
31
|
+
version: 0.3.1
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
- !ruby/object:Gem::Dependency
|
26
35
|
name: rspec
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
38
|
requirements:
|
31
39
|
- - ">="
|
32
40
|
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 1
|
43
|
+
- 2
|
44
|
+
- 9
|
33
45
|
version: 1.2.9
|
34
|
-
|
46
|
+
type: :development
|
47
|
+
version_requirements: *id002
|
35
48
|
- !ruby/object:Gem::Dependency
|
36
49
|
name: cucumber
|
37
|
-
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
52
|
requirements:
|
41
53
|
- - ">="
|
42
54
|
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 0
|
43
57
|
version: "0"
|
44
|
-
|
58
|
+
type: :development
|
59
|
+
version_requirements: *id003
|
45
60
|
description: Server that mimics Excel receiving XLTable data via DDE protocol
|
46
61
|
email: arvitallian@gmail.com
|
47
62
|
executables:
|
@@ -104,18 +119,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
119
|
requirements:
|
105
120
|
- - ">="
|
106
121
|
- !ruby/object:Gem::Version
|
122
|
+
segments:
|
123
|
+
- 0
|
107
124
|
version: "0"
|
108
|
-
version:
|
109
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
126
|
requirements:
|
111
127
|
- - ">="
|
112
128
|
- !ruby/object:Gem::Version
|
129
|
+
segments:
|
130
|
+
- 0
|
113
131
|
version: "0"
|
114
|
-
version:
|
115
132
|
requirements: []
|
116
133
|
|
117
134
|
rubyforge_project:
|
118
|
-
rubygems_version: 1.3.
|
135
|
+
rubygems_version: 1.3.6
|
119
136
|
signing_key:
|
120
137
|
specification_version: 3
|
121
138
|
summary: DDE server for Ruby
|