README.md in ass_maintainer-info_base-0.1.2 vs README.md in ass_maintainer-info_base-1.0.0

- old
+ new

@@ -1,21 +1,39 @@ # AssMaintainer::InfoBase +Gem for juggle with the [1C:Enterprise](http://1c.ru) application instances +(aka infobase or information base) as easy as possible. +Main thing of this gem is the class `AssMaintainer::InfoBase` which provides +features to do it. -Gem provides features for manipulate with 1C:Enterprise applications as easy -as possible. +In this gem defined two types of 1C application instance: -Main thing of this gem `class AssMaintainer::InfoBase` provides -some methods for manipulate with information base; +1. application deployed on a 1C:Enterprise application server aka *server infobase* +2. application deployed as a file aka *file infobase* -## Realase note +Class `AssMaintainer::InfoBase` implements both types of applications but using +difference mixins for each of them in constructor. Type of application, +detects per type of [connection string](https://github.com/leoniv/ass_launcher/blob/master/lib/ass_launcher/support/connection_string.rb). -### v.0.1.0 +## Restriction -- Not support infobases deployed on 1C:Enterprise server -- Not support configuration extensions +Fully work with server infobse possible in Windows(Cygwin) +x86 Ruby only. Cause of this is in-process OLE server `V83.COMConnector` which +used for connect to 1C:Enterprise application server when require check for +infobase exist or get infobase sessions or drop infobase or etc. actions. +Furthermore, for fully working with server infobse require logging on a +1C:Enterprise application server as a central-server administrator and +as a cluster administrator. + +Structure 1C:Enterprise application server is complex and confusing. +For more info about 1C:Enterprise server look 1C documentation. + +Some examples for restrictions look in +[example](./test/ass_maintainer/examples_test.rb) defined as `Restrictions for` +spec + ## Installation Add this line to your application's Gemfile: ```ruby @@ -30,44 +48,105 @@ $ gem install ass_maintainer-info_base ## Usage -Small example: +### Small example: ```ruby reqiure 'ass_maintainer/info_base' # As infobase admin you should make backups of infobase # Describe connection string connection_string = 'File="infobase_path";' # Get InfoBase instance -ib = AssMaintainer::InfoBase.new('infobase_name', connection_string, read_only) +ib = AssMaintainer::InfoBase.new('infobase_name', connection_string) # Dump data ib.dump(dump_path) - # As 1C application developer you should make dump of infobase configuration # Dump configuration ib.cfg.dump(cf_dump_path) # ... etc +``` +### Destructive actions protection + +On default all instance of `AssMaintainer::InfoBase` marked as `read_only`. If +infobase is `read_only` all destructive actions denied, +`MethodDenied` exception will be raised. For control it behavior uses +`read_only` parameter of constructor. + +```ruby +ib = AssMaintainer::InfoBase.new('ib_name', 'File="path"') +ib.rm! :yes #raised AssMaintainer::InfoBase::MethodDenied + +ib = AssMaintainer::InfoBase.new('ib_name', 'File="path"', false) +ib.rm! :yes #=> nil ``` +### Define 1C:Enterprise version requirement + +On default using last installed 1C:Enterprise version. But +`AssMaintainer::InfoBase` provides feature for define 1C:Enterprise version +manually. + +Example for define 1C:Enterprise platform requirement + +```ruby +# Define platform version for single instance +ib = AssMaintainer::InfoBase.new('ib_name', 'File="path"', platform_require: '~> 8.3.10.0') +ib.platform_require #=> "~> 8.3.10.0" + +# Define platform verion for all instances +AssMaintainer::InfoBase.configure do |conf| + conf.platform_require = '~> 8.3.9.0' +end + +ib = AssMaintainer::InfoBase.new('ib_name', 'File="path"') +ib.platform_require #=> "~> 8.3.9.0" +``` + +### More examples + For more examples see [examples](./test/ass_maintainer/examples_test.rb) ## Test -For running tests require installs 1C:Enterprise platform version defined in constant -`PLATFORM_REQUIRE` from -[test_helper.rb](./test/test_helper.rb) +For execute all tests require 1C:Enterprise platform installed. +Version defined in constant `PLATFORM_REQUIRE` in +[platform_require.rb](./test/test_helper/platform_require.rb) - $export SIMPLECOV=YES && rake test +For execute server infobase tests defined in +[examples](./test/ass_maintainer/examples_test.rb) require: +- running 1C:Enterprise application server. Version defined in `PLATFORM_REQUIRE` +- running data base(DBMS) server suitable for 1C:Enterprise. + +On default, server infobase tests skipped. For execute server infobase tests +require to pass server parameters in `ENV[ESRV_ENV]` like this: + +``` +$export ESRV_ENV="--ragent user:pass@host:port \ + --rmngr user:pass@host:port \ + --dbms MSSQLServer \ + --dbsrv user:pass@localhost\\sqlexpress" +``` + +For running local 1C:Enterprise application server instance can use +[bin/runsrv](bin/runsrv): + + $bin/runsrv -h + +But `runsrv` running 1C server only! DBMS server must be already running manually + +Running all tests: + + $bundler exec rake test SIMPLECOV=YES ## Development 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. Run `bundle exec ass_maintainer-info_base` to use the gem in this directory, ignoring other installed copies of this gem.