ass_ole-snippets-shared 0.4.0 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 695fcd6c1d95365a3592620312f61342185c0a28
4
- data.tar.gz: 3dccb72013e0b28d8f3ea34bf3245ac279930f2d
3
+ metadata.gz: a749501ae52e9299ccd7e62964d34201bd5503dd
4
+ data.tar.gz: 1e6fc7198b5b88bac6900cc3cf82aa5e45ff575d
5
5
  SHA512:
6
- metadata.gz: 59787df2957c0ffac5666a812c72d850ca8f1b7b77045bd5eba5acdbcac825060171f45f4449a65087fa1d425950ebb8726914e6505d767f8b0c3c350afca49c
7
- data.tar.gz: 82558bf3c383d166f8aba8d1773f0d86835c0c64671f14ce44952c1cd0e97da6fe9341243ab21786a35a4fec027b0e31e548ed1c11cb1f6253924061898a866b
6
+ metadata.gz: 749a22cdd25b927c496eb263a6456c1ade9110bf67484f1811cc55b7b27c3f7990f73a4edf3bfc2455e64b200e8db9b11c983895e440cb39b9c27f0779a39945
7
+ data.tar.gz: 9490f999753e8b80b60dcee5b408385bde216a077919f4d6ba73b7d61de29626496bcf61baaa5b6924d7ca5a4b1a4d00b403513ca80ff07763d5ce3e12868c9a
data/README.md CHANGED
@@ -19,6 +19,34 @@ Or install it yourself as:
19
19
 
20
20
  $ gem install ass_ole-snippets-shared
21
21
 
22
+ ## Example
23
+
24
+ ```ruby
25
+ require 'ass_ole'
26
+ require 'ass_ole/snippets/shared'
27
+ require 'ass_maintainer/info_base'
28
+
29
+ # External connection runtime
30
+ module ExternalRuntime
31
+ is_ole_runtime :external
32
+ end
33
+
34
+ class Worker
35
+ like_ole_runtime ExternalRuntime
36
+ include AssOle::Snippets::Shared::Query
37
+
38
+ def initialize(connection_string)
39
+ ole_runtime_get.run AssMaintainer::InfoBase.new('ib_name', connection_string)
40
+ end
41
+
42
+ def select(value)
43
+ query('select &arg as arg', arg: value).Execute.Unload.Get(0).arg
44
+ end
45
+ end
46
+
47
+ Worker.new('File="path"').select('Hello') #=> "Hello"
48
+ ```
49
+
22
50
  ## Testing
23
51
 
24
52
  $ export SIMPLECOV=YES && rake test
@@ -162,6 +162,7 @@ module AssOle
162
162
  require 'ass_ole/snippets/shared/binary_data'
163
163
  require 'ass_ole/snippets/shared/value_table'
164
164
  require 'ass_ole/snippets/shared/in_transaction_do'
165
+ require 'ass_ole/snippets/shared/app_compatibility'
165
166
  end
166
167
  end
167
168
  end
@@ -0,0 +1,33 @@
1
+ module AssOle
2
+ module Snippets
3
+ module Shared
4
+ # Mixin provides helpers for get 1C application platform version
5
+ # compatibility
6
+ module AppCompatibility
7
+ is_ole_snippet
8
+
9
+ # @return [Gem::Version] real version of 1C:Enterprise platform from
10
+ # +SystemInfo+ object
11
+ def platform_version
12
+ Gem::Version.new newObject('SystemInfo').AppVersion
13
+ end
14
+
15
+ # @return [String] application +CompatibilityMode+ as a string
16
+ def app_compatibility_mode
17
+ sTring(metaData.CompatibilityMode)
18
+ end
19
+
20
+ # @return [Gem::Version] application platform version compatibility
21
+ def app_compatibility_version
22
+ def app_compatibility_version_get
23
+ return platform_version.segments.slice(0,3).join('.') if\
24
+ app_compatibility_mode =~ %r{(НеИспользовать|DontUse)}i
25
+ app_compatibility_mode.gsub(/(Версия|Version)/i,'').gsub(/_/,'.')
26
+ end
27
+
28
+ Gem::Version.new(app_compatibility_version_get)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -22,6 +22,7 @@ module AssOle
22
22
 
23
23
  # Snippet for worcking with 1C Map obect
24
24
  module Map
25
+ is_ole_snippet
25
26
  Shared.mapped_mixin self
26
27
  # Returns new Map builded from hash
27
28
  # @note If +key.is_a? Symbol+ key will be converts to +String+
@@ -34,6 +35,7 @@ module AssOle
34
35
 
35
36
  # Snippet for worcking with 1C Structure obect
36
37
  module Structure
38
+ is_ole_snippet
37
39
  Shared.mapped_mixin self
38
40
  # Returns new Structure builded from hash
39
41
  # @note (see Map#map)
@@ -2,7 +2,7 @@ module AssOle
2
2
  module Snippets
3
3
  #
4
4
  module Shared
5
- VERSION = '0.4.0'
5
+ VERSION = '0.5.0'
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ass_ole-snippets-shared
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.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-12-22 00:00:00.000000000 Z
11
+ date: 2017-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ass_ole
@@ -139,6 +139,7 @@ files:
139
139
  - bin/console
140
140
  - bin/setup
141
141
  - lib/ass_ole/snippets/shared.rb
142
+ - lib/ass_ole/snippets/shared/app_compatibility.rb
142
143
  - lib/ass_ole/snippets/shared/array.rb
143
144
  - lib/ass_ole/snippets/shared/binary_data.rb
144
145
  - lib/ass_ole/snippets/shared/in_transaction_do.rb