ass_launcher 0.1.1.alpha

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9a5b8798a403c888bd5947f3edb2030e81f17c68
4
+ data.tar.gz: 762c0454cbc5b5505b090bc94112c929de13a624
5
+ SHA512:
6
+ metadata.gz: 9a010b42049e37397630746ec11ec815bde30b4205ded2aeeea658adc37e4de9296cc95a36f915b3269d5c89c40ef0774bfcb8e285860127a200779d2348e1f5
7
+ data.tar.gz: 5a642317ae14b69c5a8b9c3181eb29ed023a34e636b5e4364a8987ed30fd010b8e70d604fd66625b9522aaf057056377410d2c4aa071c10f94e2c959fe07ce62
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.gem
data/.simplecov ADDED
@@ -0,0 +1 @@
1
+ SimpleCov.start if ENV['SIMPLECOV']
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ before_install: gem install bundler -v 1.10.5
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ass_launcher.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Leonid Vlasov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,122 @@
1
+ # AssLauncher
2
+
3
+ Ruby wrapper for 1C:Enterprise platform. Don't ask why this necessary. Believe this necessary!
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'ass_launcher'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install ass_launcher
20
+
21
+ ## Usage
22
+
23
+ For example:
24
+
25
+ ```ruby
26
+ require 'ass_launcher'
27
+
28
+ include AssLauncher::API
29
+
30
+ #
31
+ # Get 1C:Enterprise v8.3.7 binary wrapper
32
+ #
33
+
34
+ cl = thick_clients('~> 8.3.7').last
35
+
36
+ raise '1C:Enterprise v8.3.7 not found' if cl.nil?
37
+
38
+ #
39
+ # create new infobase
40
+ #
41
+
42
+ conn_str = connection_string 'File="./new.ib"'
43
+
44
+ ph = cl.command(:createinfobase) do
45
+ connection_string conn_str
46
+ _AddInList
47
+ end.run.wait
48
+
49
+ raise 'Error while create infobase' if ph.result.success?
50
+
51
+ #
52
+ # dump infobase
53
+ #
54
+
55
+ command = cl.command(:designer) do
56
+ connection_string 'File="./new.ib"'
57
+ _DumpIB './new.ib.dt'
58
+ end
59
+
60
+ ph = command.run
61
+ ph.wait
62
+
63
+ ph.result.verify! # raised error unless executing success
64
+
65
+ #
66
+ # run designer for development
67
+ #
68
+
69
+ ph = cl.command(:designer) do
70
+ connection_string 'File="./new.ib"'
71
+ end.run
72
+
73
+ # .... do in designer
74
+
75
+ ph.kill # kill designer
76
+
77
+ ```
78
+
79
+ ## Releases
80
+
81
+ ### 0.1.1.alpha
82
+ - ```Cli::ArgumentsBuilder``` not implements
83
+ - ```Cli::CliSpec``` require extracts in standalone ```gem```
84
+ - ```WebClients``` not implements
85
+ - ```API``` not implements
86
+ - ```Support::``` stable
87
+ - ```Enterprse``` stable
88
+ - ```BinaryWrapper``` mostly stable, depends ```Cli::ArgumentsBuilder```
89
+ - ```Enterprse::Ole``` stable
90
+
91
+ #### Small exaple:
92
+
93
+ ```ruby
94
+ require 'ass_launcher'
95
+ cs = AssLauncher::Support::ConnectionString.new('File="tmp/tmp.i";Usr="root"')
96
+ tc = AssLauncher::Enterprise.thick_clients('~> 8.3').last
97
+ cmd = tc.command :designer, cs.to_args
98
+ cmd.run # Opens 1C Designer
99
+
100
+ com_conn = AssLauncher::Enterprise::Ole::IbConnection.new '~>8.3'
101
+ com_conn.__open__ cs # Open ole connection into infobase
102
+
103
+ a = com_conn.newObject 'array'
104
+ a.add 'Hello World'
105
+
106
+ puts com_con.string a.get(0) # => "Hello World"
107
+
108
+ com_con.__close__
109
+
110
+ cmd.process_holder.kill # Not forget to kill 1C Designer process!
111
+ ```
112
+
113
+ ## Development
114
+
115
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
116
+
117
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
118
+
119
+ ## Contributing
120
+
121
+ Bug reports and pull requests are welcome on GitHub at https://github.com/leoniv/ass_launcher.
122
+
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,32 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ass_launcher/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ass_launcher"
8
+ spec.version = AssLauncher::VERSION
9
+ spec.authors = ["Leonid Vlasov"]
10
+ spec.email = ["leoniv.vlasov@gmail.com"]
11
+
12
+ spec.summary = %q{Ruby wrapper for 1C:Enterprise platform}
13
+ spec.description = %q{Don't ask why this necessary. Believe this necessary!}
14
+ spec.homepage = "https://github.com/leoniv/ass_launcher"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+ spec.license = 'MIT'
21
+
22
+ spec.add_dependency "inifile"
23
+ spec.add_dependency "ffi"
24
+ spec.add_dependency "methadone"
25
+
26
+ spec.add_development_dependency "bundler", "~> 1.10"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "minitest"
29
+ spec.add_development_dependency "pry"
30
+ spec.add_development_dependency "mocha"
31
+ spec.add_development_dependency "simplecov"
32
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "ass_launcher"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ require "pry"
11
+ Pry.start
12
+
13
+ #require "irb"
14
+ #IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,367 @@
1
+ # encoding: utf-8
2
+
3
+ module AssLauncher
4
+ #
5
+ module Enterprise
6
+ require 'ass_launcher/enterprise/cli'
7
+ # rubocop:disable all
8
+ # TODO: перенести этот текст в другое место
9
+ # fucking 1C: команда `CEATEINFOBASE` принимает фаловую строку
10
+ # соединения в котрой путь должен быть в формате win т.е. H:\bla\bla.
11
+ # При этом команды `ETERPRISE` и `DESIGNER` понимают и смешаный формат пути:
12
+ # H:/bla/bla. При передаче команде `CREATEINFOBASE` некорректного пути
13
+ # база будет создана абы где и в косоль вернется успех $?=0. Какие бывают
14
+ # некоректные пути:
15
+ # - (!! Похоже в v 8.3.8 устранили) H:/bla/bla - будет создана база H: где? Да прямо в корне диска H:. Вывод 1С win-xp:
16
+ # `Создание информационной базы ("File=H:;Locale = "ru_RU";") успешно завершено`
17
+ # - (!! Похоже в v 8.3.8 устранили) H:/путь/котрого/нет/имябазы - будет оздана база в каталоге по умолчанию
18
+ # с именем InfoBase[N]. Вывод 1С win-xp:
19
+ # `Создание информационной базы ("File = "C:\Documents and Settings\vlv\Мои документы\InfoBase41";Locale = "ru_RU";") успешно завершено`
20
+ # в linux отработает корректно и попытается содать каталоги или вылитит с
21
+ # ошибкой ?$>0
22
+ # - ../empty.ib - использование относительного пути в win создает базу по
23
+ # умолчанию как в предидущем пункте в linux создаст базу empty.ib в текущем
24
+ # каталоге при этом вывод 1C в linux:
25
+ # `Создание информационной базы ("File=../empty.ib;Locale = "en_US";") успешно завершено`
26
+ # - H(!! Похоже в v 8.3.8 устранили):\путь\содержит-тире - в win создаст базу H:\путь\содержит вывод 1С:
27
+ # `Создание информационной базы ("File=H:\genm\содержит;Locale = "ru_RU";") успешно завершено`
28
+ # в linux отработет корректно
29
+ # rubocop:enable all
30
+
31
+ # Class for wrapping 1C:Enterprise platform binary executables such as
32
+ # 1cv8.exe and 1cv8c.exe.
33
+ # Class makes it easy to juggle with the different versions of
34
+ # 1C:Enterprise installations
35
+ #
36
+ # @abstract
37
+ # @api private
38
+ # @note (see #version)
39
+ # @note (see #arch)
40
+ class BinaryWrapper
41
+ include AssLauncher::Support::Platforms
42
+ attr_reader :path
43
+
44
+ def initialize(binpath)
45
+ @path = platform.path(binpath).realpath
46
+ fail ArgumentError, "Is not a file `#{binpath}'" unless @path.file?
47
+ fail ArgumentError,
48
+ "Invalid binary #{@path.basename} for #{self.class}"\
49
+ unless @path.basename.to_s.upcase == expects_basename.upcase
50
+ end
51
+
52
+ # Define version of 1C platform.
53
+ # @note version parsed from path and may content incorrect value - not
54
+ # real 1C platform version see {#extract_version}. In windows,
55
+ # if 1C platform instaled in standart directories it work correctly.
56
+ # In Linux it have only 2 major
57
+ # digits.
58
+ #
59
+ # @api public
60
+ # @return [Gem::Version]
61
+ def version
62
+ @version ||= extract_version(path.to_s)
63
+ end
64
+
65
+ # Define arch on 1C platform.
66
+ # @note Arch of platform actual for Linux. In windows return i386
67
+ # @api public
68
+ # @return [String]
69
+ def arch
70
+ @arch ||= extract_arch(path.to_s)
71
+ end
72
+
73
+ # Extract version from path
74
+ # @note
75
+ # - In windows 1C V > 8.2 default install into path:
76
+ # +bla/1cv?/8.3.8.1502/bin/1cv8.exe+
77
+ # - In Linux 1V default install into path:
78
+ # +/opt/1C/v8.3/i386/1cv8+
79
+ def extract_version(realpath)
80
+ extracted = realpath.to_s.split('/')[-3]
81
+ extracted =~ /(\d+\.\d+\.?\d*\.?\d*)/i
82
+ extracted = (Regexp.last_match(1).to_s.split('.')\
83
+ + [0, 0, 0, 0])[0, 4].join('.')
84
+ Gem::Version.new(extracted)
85
+ end
86
+ private :extract_version
87
+
88
+ # Extract arch from path
89
+ # @note (see #extract_version)
90
+ def extract_arch(realpath)
91
+ if linux?
92
+ extracted = realpath.to_s.split('/')[-2]
93
+ else
94
+ extracted = 'i386'
95
+ end
96
+ extracted
97
+ end
98
+ private :extract_arch
99
+
100
+ # Compare wrappers on version for sortable
101
+ # @param other [BinaryWrapper]
102
+ # @return [Bollean]
103
+ # @api public
104
+ def <=>(other)
105
+ version <=> other.version
106
+ end
107
+
108
+ def expects_basename
109
+ Enterprise.binaries(self.class)
110
+ end
111
+ private :expects_basename
112
+
113
+ # True if file exsists
114
+ # @api public
115
+ def exists?
116
+ path.file?
117
+ end
118
+
119
+ # Return 2 major digits from version
120
+ # @return [String]
121
+ # @api public
122
+ def major_v
123
+ version.to_s.split('.')[0, 2].join('.')
124
+ end
125
+
126
+ # Convert to {AssLauncher::Support::Shell::Command} instance
127
+ # @param args (see AssLauncher::Support::Shell::Command#initialize)
128
+ # @option options (see AssLauncher::Support::Shell::Command#initialize)
129
+ # @return [AssLauncher::Support::Shell::Command]
130
+ def to_command(args = [], options = {})
131
+ AssLauncher::Support::Shell::Command.new(path.to_s, args, options)
132
+ end
133
+ private :to_command
134
+
135
+ # Convert to {AssLauncher::Support::Shell::Script} instance
136
+ # @param args [String] string arguments for run 1C binary wrapped in
137
+ # +cmd.exe+ or +sh+ script like as: +'/Arg1 "Value" /Arg2 "value"'+
138
+ # @option options (see AssLauncher::Support::Shell::Script#initialize)
139
+ # @return [AssLauncher::Support::Shell::Script]
140
+ def to_script(args = '', options = {})
141
+ AssLauncher::Support::Shell::Script\
142
+ .new("#{path.win_string.to_cmd} #{args}", options)
143
+ end
144
+ private :to_script
145
+
146
+ def fail_if_wrong_mode(run_mode)
147
+ fail ArgumentError, "Invalid run_mode `#{run_mode}' for #{self.class}"\
148
+ unless run_modes.include? run_mode
149
+ run_mode
150
+ end
151
+ private :fail_if_wrong_mode
152
+
153
+ # @param run_mode [Symbol]
154
+ # Valid values define in the {#run_modes}
155
+ # @raise [ArgumentError]
156
+ # @return [String] run mode for run 1C binary
157
+ def mode(run_mode)
158
+ fail_if_wrong_mode(run_mode).to_s.upcase
159
+ end
160
+ private :mode
161
+
162
+ # @api public
163
+ # @return (see Cli.defined_modes_for)
164
+ def run_modes
165
+ Cli.defined_modes_for(self)
166
+ end
167
+
168
+ # @return (see Cli::CliSpec#parameters)
169
+ def defined_parameters(run_mode)
170
+ cli_spec(run_mode).parameters
171
+ end
172
+ private :defined_parameters
173
+
174
+ # @api public
175
+ # @param run_mode [Symbol] run mode 1C binary.
176
+ # @return [Cli::CliSpec]
177
+ def cli_spec(run_mode = :enterprise)
178
+ Cli::CliSpec.for(self, fail_if_wrong_mode(run_mode))
179
+ end
180
+
181
+ def build_args(run_mode, &block)
182
+ arguments_builder = Cli::ArgumentsBuilder\
183
+ .new(defined_parameters(run_mode), run_mode)
184
+ arguments_builder.instance_eval(&block)
185
+ arguments_builder.builded_args
186
+ end
187
+ private :build_args
188
+
189
+ # Wrapper for 1C thick client binary
190
+ # @api public
191
+ #
192
+ # @example
193
+ #
194
+ # script = cl.script(:createinfobase, 'File="path\\new.ib"')
195
+ # ph = script.run # this waiting until process executing
196
+ # ph.result.expected_assout = /\("File="path\\new.ib";.*"\)/i
197
+ # ph.result.verify!
198
+ #
199
+ # @example
200
+ #
201
+ # # Get 1C:Enterprise last release for 8.3.6 version:
202
+ #
203
+ # cl = AssLauncher::Enterprise.thick_clients('~> 8.3.6').last
204
+ # raise 'Can\'t find 1C binary' if cl.nil?
205
+ #
206
+ # @example
207
+ #
208
+ # # Run 1C:Enterprise designer
209
+ # # Directly pass parameters:
210
+ #
211
+ # args = ['/F', 'path/to/file/infobase']
212
+ # ph = cl.command(:designer, args).run
213
+ #
214
+ # ph.wait.result.assout # => "Информационная база не обнаружена!"
215
+ # ph.result.exitstatus # => 0
216
+ #
217
+ # # Fucking 1C: "Информационная база не обнаружена!" but exit with 0 ????
218
+ #
219
+ # @example
220
+ #
221
+ # # Dump infobase
222
+ # # Directly pass parameters:
223
+ #
224
+ # args = ['/F', 'path/infobase', '/DumpIB', 'dump/path/file.dt']
225
+ # cm = cl.command(:designer, args)
226
+ #
227
+ # cm.run.wait.result.verify!
228
+ # #=> RunAssResult::RunAssError: Информационная база не обнаружена!
229
+ #
230
+ # @example
231
+ #
232
+ # TODO `verify' exaples:
233
+ #
234
+ # # Dump infobase
235
+ # # Uses Cli::ArgumentsBuilder:
236
+ #
237
+ # conn_str = AssLauncher::Support::ConnectionString.\
238
+ # new('File="//host/infobase"')
239
+ #
240
+ # command = cl.command(:designer) do
241
+ # connection_string conn_str
242
+ # DumpIB './infobase.dt'
243
+ # end
244
+ # ph = command.run.wait
245
+ #
246
+ # ph.result.verify!
247
+ #
248
+ # # Crete info base
249
+ #
250
+ # ph = cl.command(:createinfobase) do
251
+ # connection_string "File='//host/new.ib';"
252
+ # _UseTemplate './application.cf'
253
+ # _AddInList
254
+ # end.run.wait
255
+ #
256
+ # ph.result.verify!
257
+ #
258
+ # # Check configuration
259
+ #
260
+ # ph = cl.command(:designer) do
261
+ # _S '1c-server/infobase'
262
+ # _N 'admin'
263
+ # _P 'password'
264
+ # _CheckConfig do
265
+ # _ConfigLogIntegrity
266
+ # _IncorrectReferences
267
+ # _Extension :all
268
+ # end
269
+ # end.run.wait
270
+ #
271
+ # ph.result.verify!
272
+ #
273
+ # # Run enterprise Hello World
274
+ #
275
+ # # Prepare external data processor 'processor.epf'
276
+ # # Make OnOpen form handler for main form of processor:
277
+ # # procedure OnOpen(Cansel)
278
+ # # message("Ass listen: " + LaunchParameter)
279
+ # # exit()
280
+ # # endprocedure
281
+ #
282
+ # ph = cl.command(:enterprise) do
283
+ # connection_string 'File="./infobase";Usr="admin";Pwd="password"'
284
+ # _Execute './processor.epf'
285
+ # _C 'Hello World'
286
+ # end.run.wait
287
+ #
288
+ # ph.result.verify!
289
+ #
290
+ # puts ph.result.assout #=> 'Ass listen: Hello World'
291
+ #
292
+ class ThickClient < BinaryWrapper
293
+ # (see ThinClient#accepted_connstr)
294
+ def accepted_connstr
295
+ [:file, :server]
296
+ end
297
+
298
+ # Run 1C:Enterprise client as command.
299
+ # @note For correct pass cli parameters
300
+ # to 1C:Enterprise binary, you can passes block. Block will be eval in
301
+ # instance of {Cli::ArgumentsBuilder}. +ArgumentsBuilder+ use
302
+ # {Cli::CliSpec} and verify parameters and prameters values.
303
+ # Also you can pass arguments directly, without verify, uses +args+
304
+ # array.
305
+ #
306
+ # @note Command not wait while 1C:Enterprise execution. You can
307
+ # manipulate with many 1C clients runned at once.
308
+ #
309
+ # @param run_mode [Symbol] run mode 1C binary. It will be puts fierst
310
+ # parameter in +args+
311
+ # @param args (see BinaryWrapper#to_command)
312
+ # @option options (see BinaryWrapper#to_command)
313
+ # @return (see #to_command)
314
+ def command(run_mode, args = [], **options, &block)
315
+ args_ = args.dup
316
+ args_.unshift mode(run_mode)
317
+ args_ += build_args(run_mode, &block) if block_given?
318
+ to_command(args_, options)
319
+ end
320
+
321
+ # Run 1C:Enterprise client as cmd or shell script.
322
+ # @note It waiting for script
323
+ # execution.
324
+ # @note It not use arguments builder and not expects of block.
325
+ # Arguments string make as you want
326
+ #
327
+ # @param run_mode (see #command)
328
+ # @param args (see #to_script)
329
+ # @option options (see #to_script)
330
+ # @return (see #to_script)
331
+ def script(run_mode, args = '', **options)
332
+ args_ = "#{mode(run_mode)} #{args}"
333
+ to_script(args_, options)
334
+ end
335
+ end
336
+
337
+ # Wrapper for 1C thin client binary
338
+ # @api public
339
+ class ThinClient < ThickClient
340
+ # Define type of connection_string
341
+ # suitable for 1C binary
342
+ # @return [Array<Symbol>]
343
+ def accepted_connstr
344
+ [:file, :server, :http]
345
+ end
346
+
347
+ # Run 1C:Enterprise client as command.
348
+ # @note (see ThickClient#command)
349
+ # @param args (see ThickClient#command)
350
+ # @option options (see ThickClient#command)
351
+ # @return (see ThickClient#command)
352
+ def command(args = [], **options, &block)
353
+ super(:enterprise, args, options, &block)
354
+ end
355
+
356
+ # Run 1C:Enterprise client as cmd or shell script.
357
+ # @note (see ThickClient#script)
358
+ # @param args (see ThickClient#script)
359
+ # @option options (see ThickClient#script)
360
+ # @return (see ThickClient#script)
361
+ def script(args = '', **options)
362
+ super(:enterprise, args, options)
363
+ end
364
+ end
365
+ end
366
+ end
367
+ end
@@ -0,0 +1,41 @@
1
+ # encoding: utf-8
2
+
3
+ module AssLauncher
4
+ module Enterprise
5
+ module Cli
6
+ # @api private
7
+ class ArgumentsBuilder
8
+ attr_reader :run_mode, :defined_parameters, :builded_args
9
+
10
+ # @param defined_arguments [Parameters::ParamtersList]
11
+ def initialize(defined_arguments, run_mode)
12
+ @builded_args = []
13
+ @defined_parameters = defined_arguments
14
+ @run_mode = run_mode
15
+ end
16
+
17
+ def connection_string(conn_str)
18
+ conn_str = AssLauncher::Support::ConnectionString.\
19
+ new(conn_str) if conn_str.is_a? String
20
+ args = conn_str_to_args(conn_str)
21
+ args += build_args
22
+ end
23
+
24
+ def conn_str_to_args(conn_str)
25
+ return conn_str.createinfobase_args if run_mode == :createinfobase
26
+ conn_str.to_args
27
+ end
28
+
29
+ def method_missing(method, *args, &block)
30
+ param_name = method_to_param_name(method)
31
+ FIXME
32
+ end
33
+
34
+ def method_to_param_name(method)
35
+ FIXME
36
+ end
37
+
38
+ end
39
+ end
40
+ end
41
+ end