s41c 0.0.8 → 0.0.9

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/lib/s41c/server.rb CHANGED
@@ -11,7 +11,7 @@ module S41C
11
11
  # @param [ String ] адрес, на котором будет запущен сервер
12
12
  # @param [ Integer ] порт
13
13
  # @param [ String ] лог-файл
14
- def initialize(host='localhost', port=1421, log_file=nil)
14
+ def initialize(host='0.0.0.0', port=1421, log_file=nil)
15
15
  require 'socket'
16
16
  require 'win32ole'
17
17
 
@@ -32,6 +32,10 @@ module S41C
32
32
  self
33
33
  end
34
34
 
35
+ def white_list(*args)
36
+ @white_list = args
37
+ end
38
+
35
39
  # Параметры подключения к базе 1C
36
40
  #
37
41
  # @params [ String ] база
@@ -108,7 +112,7 @@ module S41C
108
112
  @conn = @ole.Initialize(
109
113
  @ole.RMTrade,
110
114
  (@conn_options),
111
- ''
115
+ 'NO_SPLASH_SHOW'
112
116
  )
113
117
  rescue WIN32OLERuntimeError => e
114
118
  @conn = nil
@@ -134,6 +138,11 @@ module S41C
134
138
  retry
135
139
  end
136
140
 
141
+ if @white_list && !@white_list.include?(session.remote_address.ip_address)
142
+ session.close
143
+ next
144
+ end
145
+
137
146
  if @login
138
147
  res = true
139
148
  session.print "login"
data/lib/s41c/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module S41C
2
2
 
3
- VERSION = '0.0.8'
3
+ VERSION = '0.0.9'
4
4
 
5
5
  end # S41C
data/s41c-0.0.8.gem ADDED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s41c
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-25 00:00:00.000000000 Z
12
+ date: 2012-04-27 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: TCP-socket сервер и клиент для платформы "1С:Предприятие"
15
15
  email:
@@ -29,6 +29,7 @@ files:
29
29
  - lib/s41c/server.rb
30
30
  - lib/s41c/client.rb
31
31
  - lib/s41c.rb
32
+ - s41c-0.0.8.gem
32
33
  - Gemfile
33
34
  - Rakefile
34
35
  - s41c-0.0.7.gem