p2ruby 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/HISTORY +8 -0
- data/README.rdoc +3 -2
- data/VERSION +1 -1
- data/bin/olegen.rb +0 -0
- data/lib/extension.rb +2 -2
- data/lib/p2ruby/connection.rb +12 -2
- data/lib/p2ruby/record.rb +1 -1
- data/lib/p2ruby.rb +1 -4
- data/lib/version.rb +1 -1
- data/lib/win32ole-pr.rb +4564 -4558
- data/spec/encoding_spec.rb +1 -0
- data/spec/p2ruby/application_spec.rb +2 -2
- data/spec/p2ruby/connection_spec.rb +28 -34
- data/spec/p2ruby/data_stream_spec.rb +2 -1
- data/spec/p2ruby/library_spec.rb +1 -1
- data/spec/p2ruby/message_factory_spec.rb +2 -8
- data/spec/p2ruby/message_spec.rb +9 -8
- data/spec/p2ruby/record_spec.rb +2 -1
- data/spec/p2ruby/router_spec.rb +2 -2
- data/spec/p2ruby/table_set_spec.rb +3 -1
- data/spec/p2ruby_spec.rb +2 -2
- data/spec/spec_helper.rb +16 -10
- data/tasks/common.rake +2 -2
- data/tasks/spec.rake +1 -1
- data/tasks/version.rake +7 -7
- metadata +8 -30
data/.gitignore
CHANGED
data/HISTORY
CHANGED
data/README.rdoc
CHANGED
@@ -4,12 +4,13 @@ url:: http://github.com/arvicco/p2ruby
|
|
4
4
|
|
5
5
|
== DESCRIPTION:
|
6
6
|
|
7
|
-
Ruby bindings and wrapper classes for P2ClientGate.
|
7
|
+
Ruby bindings and wrapper classes for RTS Plaza2 COM library (P2ClientGate).
|
8
8
|
|
9
9
|
== FEATURES/PROBLEMS:
|
10
10
|
|
11
11
|
All implemented COM classes wrapped except for CP2DataBuffer. Most event interfaces work,
|
12
|
-
except for IP2AsyncEvent* since they are not implemented anywhere
|
12
|
+
except for IP2AsyncEvent* since they are not implemented anywhere (see
|
13
|
+
http://forum.rts.ru/viewtopic.asp?t=20260).
|
13
14
|
|
14
15
|
== REQUIREMENTS:
|
15
16
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/bin/olegen.rb
CHANGED
File without changes
|
data/lib/extension.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
class String
|
2
2
|
# returns snake_case representation of string
|
3
3
|
def snake_case
|
4
|
-
gsub(/([a-z])([A-Z0-9])/, '\1_\2'
|
4
|
+
gsub(/([a-z])([A-Z0-9])/, '\1_\2').downcase
|
5
5
|
end
|
6
6
|
|
7
7
|
# returns camel_case representation of string
|
8
8
|
def camel_case
|
9
9
|
if self.include? '_'
|
10
|
-
self.split('_').map{|e| e.capitalize}.join
|
10
|
+
self.split('_').map { |e| e.capitalize }.join
|
11
11
|
else
|
12
12
|
unless self =~ (/^[A-Z]/)
|
13
13
|
self.capitalize
|
data/lib/p2ruby/connection.rb
CHANGED
@@ -152,8 +152,18 @@ module P2
|
|
152
152
|
end
|
153
153
|
|
154
154
|
# method UI4 Connect2
|
155
|
-
# �������� ���������� ���������� ���������� � ��������.
|
156
|
-
#
|
155
|
+
# �������� ���������� ���������� ���������� � ��������.
|
156
|
+
# ������� � ���������� � ������ Connection#Connect.
|
157
|
+
# !!!!!!!!! Can be used for LRPC transport instead of TCP/IP:
|
158
|
+
# -------------------------------------
|
159
|
+
# ����� HRESULT Connect2([in] BSTR connStr, [out,retval] ULONG *errClass).
|
160
|
+
# � connStr �������� ��������� ��������.
|
161
|
+
# ��� ����������� ������: *"APPNAME=superRobot;LRPCQ_PORT=4001"*,
|
162
|
+
# ��� ������ "APPNAME=superRobot;HOST=127.0.0.1;PORT=4001".
|
163
|
+
# �������� ������ ������ Connect. Properties AppName, Host, Port, Password
|
164
|
+
# � ����� ������� �� ������������. �������� � ������ 1.10.x
|
165
|
+
#
|
166
|
+
# BSTR conn_str [IN]
|
157
167
|
def Connect2(conn_str)
|
158
168
|
@ole._invoke(18, [conn_str], [VT_BSTR])
|
159
169
|
end
|
data/lib/p2ruby/record.rb
CHANGED
@@ -26,7 +26,7 @@ module P2
|
|
26
26
|
GetValAsStringByIndex(id)
|
27
27
|
else
|
28
28
|
GetValAsString(id.to_s)
|
29
|
-
end
|
29
|
+
end #.force_encoding('IBM866').encode('CP1251', :undef => :replace)
|
30
30
|
end
|
31
31
|
|
32
32
|
# Yields all fields (basis for mixed in Enumerable methods)
|
data/lib/p2ruby.rb
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
require 'version'
|
2
2
|
require 'win32ole'
|
3
3
|
require 'win32ole/property'
|
4
|
+
require 'win_gui'
|
4
5
|
#require 'win32ole-pr'
|
5
6
|
|
6
|
-
require 'rubygems'
|
7
|
-
require 'bundler/setup'
|
8
|
-
Bundler.require(:default)
|
9
|
-
|
10
7
|
# Namespace for loading P2ClientGate constants and helper methods
|
11
8
|
module P2
|
12
9
|
# enum TConnectionStatus � ��������� ����������/�������. �������� ��������� ��������:
|
data/lib/version.rb
CHANGED