ass_launcher 0.2.2 → 0.3.0

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.
@@ -0,0 +1,28 @@
1
+ module AssLauncher
2
+ module Cmd
3
+ class Main
4
+ module SubCommands
5
+ # @api private
6
+ class Designer < Abstract::SubCommand
7
+ module SubCommands
8
+ class Cli < Abstract::Cli; end
9
+ # :nodoc:
10
+ class Run < Abstract::Run
11
+ include Abstract::Parameter::IB_PATH
12
+ end
13
+ end
14
+
15
+ def self.command_name
16
+ 'designer'
17
+ end
18
+
19
+ def self._banner
20
+ '1C:Enterprise Thick client in DESIGNER mode'
21
+ end
22
+
23
+ declare_subcommands
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,59 @@
1
+ module AssLauncher
2
+ module Cmd
3
+ class Main
4
+ module SubCommands
5
+ # @api private
6
+ class MakeIb < Abstract::SubCommand
7
+ include Abstract::Parameter::IB_PATH_NAME
8
+ include Abstract::Option::Dbms
9
+ include Abstract::Option::Dbsrv
10
+ include Abstract::Option::Esrv
11
+ include Abstract::Option::Pattern
12
+ include Abstract::Option::Version
13
+ include Abstract::Option::DryRun
14
+ include Abstract::Option::SearchPath
15
+ include Abstract::BinaryWrapper
16
+
17
+ def self.command_name
18
+ 'makeib'
19
+ end
20
+
21
+ def self._banner
22
+ 'Make new information base'
23
+ end
24
+
25
+ # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
26
+ def connection_string
27
+ return cs_file(file: ib_path) if dbms == 'File'
28
+ cs = cs_srv(srvr: esrv_host, ref: ib_path)
29
+ cs.dbms = dbms
30
+ cs.dbsrvr = dbsrv_host
31
+ cs.db = ib_path
32
+ cs.dbuid = dbsrv_user
33
+ cs.dbpwd = dbsrv_pass
34
+ cs.crsqldb = 'Y'
35
+ cs.susr = esrv_user
36
+ cs.spwd = esrv_pass
37
+ cs
38
+ end
39
+ # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
40
+
41
+ def make_command
42
+ cs = connection_string
43
+ template = pattern
44
+ binary_wrapper.command(:createinfobase) do
45
+ connection_string cs
46
+ useTemplate template if template
47
+ end
48
+ end
49
+
50
+ def execute
51
+ cmd = run_enterprise(make_command)
52
+ puts Colorize.green(cmd.process_holder.result.assout) unless\
53
+ dry_run?
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,28 @@
1
+ module AssLauncher
2
+ module Cmd
3
+ class Main
4
+ module SubCommands
5
+ # @api private
6
+ class Thick < Abstract::SubCommand
7
+ module SubCommands
8
+ class Cli < Abstract::Cli; end
9
+ # :nodoc:
10
+ class Run < Abstract::Run
11
+ include Abstract::Parameter::IB_PATH
12
+ end
13
+ end
14
+
15
+ def self.command_name
16
+ 'thick'
17
+ end
18
+
19
+ def self._banner
20
+ '1C:Enterprise Thick client in ENTERPRISE mode'
21
+ end
22
+
23
+ declare_subcommands
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module AssLauncher
2
+ module Cmd
3
+ class Main
4
+ module SubCommands
5
+ # @api private
6
+ class Thin < Abstract::SubCommand
7
+ module SubCommands
8
+ class Cli < Abstract::Cli; end
9
+ # :nodoc:
10
+ class Run < Abstract::Run
11
+ include Abstract::Parameter::IB_PATH
12
+ end
13
+ end
14
+
15
+ def self.command_name
16
+ 'thin'
17
+ end
18
+
19
+ def self._banner
20
+ '1C:Enterprise Thin client'
21
+ end
22
+
23
+ declare_subcommands
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,62 @@
1
+ module AssLauncher
2
+ module Cmd
3
+ class Main
4
+ module SubCommands
5
+ # @api private
6
+ class Web < Abstract::SubCommand
7
+ module SubCommands
8
+ class Cli < Abstract::Cli; end
9
+ # :nodoc:
10
+ class Uri < Abstract::SubCommand
11
+ include Abstract::Option::User
12
+ include Abstract::Option::Password
13
+ include Abstract::Option::Raw
14
+ include Abstract::Parameter::IB_PATH
15
+ include Abstract::ParseIbPath
16
+ include Abstract::ClientMode
17
+ include AssLauncher::Api
18
+
19
+ def self.command_name
20
+ 'uri'
21
+ end
22
+
23
+ def self._banner
24
+ 'Uri constructor for webclient'
25
+ end
26
+
27
+ def webclient
28
+ cl = web_client(ib_path)
29
+ cl.send(:add_to_query, cl.uri,
30
+ cl.send(:args_to_query, raw_param.flatten))
31
+ cl
32
+ end
33
+
34
+ def location
35
+ user_ = user
36
+ pass_ = password
37
+ webclient.location do
38
+ _N user_ if user_
39
+ _P pass_ if pass_
40
+ end.to_s
41
+ end
42
+
43
+ def execute
44
+ puts Colorize.yellow location.to_s
45
+ end
46
+ end
47
+ end
48
+
49
+ def self.command_name
50
+ 'web'
51
+ end
52
+
53
+ def self._banner
54
+ '1C:Enterprise Web client'
55
+ end
56
+
57
+ declare_subcommands
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -111,6 +111,8 @@ module AssLauncher::Enterprise::CliDef
111
111
  :- => 'поиск не выполняется')
112
112
  path_exist '/RunShortcut',
113
113
  'позволяет запустить систему со списком баз из указанного файла v8i'
114
+
115
+ string '/UC', 'код для установки соединения с заблокированной базой'
114
116
  end
115
117
 
116
118
  mode :enterprise do
@@ -119,7 +121,6 @@ module AssLauncher::Enterprise::CliDef
119
121
  'запуск толстого клиента в режиме обычного приложения', thick
120
122
  flag '/RunModeManagedApplication',
121
123
  'запуск толстого клиента в режиме управляемого приложения', thick
122
- string '/UC', 'код для установки соединения с заблокированной базой'
123
124
  path_exist '/Execute', 'запуска внешней обработки в режиме 1С:Предприятие непосредственно после старта системы'
124
125
  flag '/ClearCache', 'очистка кэша клиент-серверных вызовов'
125
126
  flag '/itdi', 'режим интерфейса с использованием закладок'
@@ -183,17 +184,6 @@ module AssLauncher::Enterprise::CliDef
183
184
  switch_value: (Proc.new do |value|; ":#{value}" end)
184
185
  end
185
186
 
186
- path '/CreateDistributive',
187
- 'создания комплекта поставки в указанном каталоге' do
188
- path_exist '-File', 'имя файла описания комплекта поставки'
189
- string '-Option','вариант поставки'
190
- switch '-Make', 'создать',
191
- switch_list: switch_list(
192
- Setup: 'комплект поставки (используется по умолчанию)',
193
- Files: 'файлы поставки'
194
- )
195
- path_exist '-digisign', 'файл с параметрами лицензирования'
196
- end
197
187
  flag '/ResetMasterNode', 'сброс главного узла РИБ'
198
188
  flag '/CheckConfig',
199
189
  'централизованная проверка конфигурации' do
@@ -293,7 +283,19 @@ module AssLauncher::Enterprise::CliDef
293
283
  path '-cfufile', 'создать обновление дистрибутива (.cfu файл)'
294
284
  path '-f', 'дистрибутив включаемый в обновление (.cf файл)'
295
285
  string '-v', 'версия дистрибутива включаемого в обновление'
296
- path_exist 'digisign', 'файл с параметрами лицензирования'
286
+ path_exist '-digisign', 'файл с параметрами лицензирования'
287
+ end
288
+
289
+ path '/CreateDistributive',
290
+ 'создания комплекта поставки в указанном каталоге' do
291
+ path_exist '-File', 'имя файла описания комплекта поставки'
292
+ string '-Option','вариант поставки'
293
+ switch '-Make', 'создать',
294
+ switch_list: switch_list(
295
+ Setup: 'комплект поставки (используется по умолчанию)',
296
+ Files: 'файлы поставки'
297
+ )
298
+ path_exist '-digisign', 'файл с параметрами лицензирования'
297
299
  end
298
300
  end
299
301
  end
@@ -78,10 +78,10 @@ module AssLauncher::Enterprise::CliDef
78
78
  mode :designer do
79
79
  flag '/ConfigurationRepositoryBindCfg',
80
80
  'подключение неподключенной конфигурации к хранилищу' do
81
- flag 'forceBindAlreadyBindedUser',
81
+ flag '-forceBindAlreadyBindedUser',
82
82
  'подключение будет выполнено даже в случае, если для данного'\
83
83
  ' пользователя уже есть конфигурация, связанная с данным хранилищем'
84
- flag 'forceReplaceCfg',
84
+ flag '-forceReplaceCfg',
85
85
  'если конфигурация не пустая, текущая конфигурация'\
86
86
  ' будет заменена конфигурацией из хранилища'
87
87
  end
@@ -279,7 +279,7 @@ module AssLauncher
279
279
  # Build args array suitable for
280
280
  # :createinfibase runmode
281
281
  def createinfobase_args
282
- [createinfobase_cmd]
282
+ [createinfobase_cmd.gsub(%r{=\s*"},"='").gsub(%r{"\s*;},"';")]
283
283
  end
284
284
 
285
285
  # (see DBMS_VALUES)
@@ -112,7 +112,7 @@ module AssLauncher
112
112
  # @raise [RunProcessError] if command is cmd.exe with /K key see
113
113
  # {cmd_exe_with_k?}
114
114
  # @api public
115
- # @raise (see initialize)
115
+ # @raise [ArgumentError] if command was already running
116
116
  def self.run(command, options = {})
117
117
  fail RunProcessError, 'Forbidden run cmd.exe with /K key'\
118
118
  if cmd_exe_with_k? command
@@ -122,7 +122,7 @@ module AssLauncher
122
122
  end
123
123
 
124
124
  # @param (see run)
125
- # @raise [ArgumentError] if command was already running
125
+ # @raise (see run)
126
126
  def initialize(command, options = {})
127
127
  fail ArgumentError, 'Command was already running' if command.running?
128
128
  @command = command
@@ -1,5 +1,5 @@
1
1
  module AssLauncher
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  module KNOWN_ENTERPRISE_VERSIONS
4
4
  require 'ass_launcher/enterprise/cli_defs_loader'
5
5
  extend AssLauncher::Enterprise::CliDefsLoader
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ass_launcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonid Vlasov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-15 00:00:00.000000000 Z
11
+ date: 2017-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inifile
@@ -52,6 +52,48 @@ dependencies:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.4.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: clamp
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: colorize
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: command_line_reporter
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
55
97
  - !ruby/object:Gem::Dependency
56
98
  name: bundler
57
99
  requirement: !ruby/object:Gem::Requirement
@@ -136,20 +178,6 @@ dependencies:
136
178
  - - ">="
137
179
  - !ruby/object:Gem::Version
138
180
  version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: clamp
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
181
  - !ruby/object:Gem::Dependency
154
182
  name: coderay
155
183
  requirement: !ruby/object:Gem::Requirement
@@ -167,11 +195,13 @@ dependencies:
167
195
  description: Don't ask why this necessary. Believe this necessary!
168
196
  email:
169
197
  - leoniv.vlasov@gmail.com
170
- executables: []
198
+ executables:
199
+ - ass-launcher
171
200
  extensions: []
172
201
  extra_rdoc_files: []
173
202
  files:
174
203
  - ".gitignore"
204
+ - ".rubocop.yml"
175
205
  - ".simplecov"
176
206
  - ".travis.yml"
177
207
  - Gemfile
@@ -201,8 +231,15 @@ files:
201
231
  - examples/troubles/with_running_1c_example.rb
202
232
  - examples/v8i_file_example.rb
203
233
  - examples/webclient_example.rb
234
+ - exe/ass-launcher
204
235
  - lib/ass_launcher.rb
205
236
  - lib/ass_launcher/api.rb
237
+ - lib/ass_launcher/cmd.rb
238
+ - lib/ass_launcher/cmd/designer.rb
239
+ - lib/ass_launcher/cmd/makeib.rb
240
+ - lib/ass_launcher/cmd/thick.rb
241
+ - lib/ass_launcher/cmd/thin.rb
242
+ - lib/ass_launcher/cmd/web.rb
206
243
  - lib/ass_launcher/enterprise.rb
207
244
  - lib/ass_launcher/enterprise/binary_wrapper.rb
208
245
  - lib/ass_launcher/enterprise/cli.rb
@@ -257,9 +294,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
257
294
  version: '0'
258
295
  requirements: []
259
296
  rubyforge_project:
260
- rubygems_version: 2.4.7
297
+ rubygems_version: 2.4.8
261
298
  signing_key:
262
299
  specification_version: 4
263
300
  summary: Ruby wrapper for 1C:Enterprise platform
264
301
  test_files: []
265
- has_rdoc: