odca 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/lib/odca/hashlink_generator.rb +2 -7
- data/lib/odca/parser.rb +1 -0
- data/lib/odca/schema_parser.rb +3 -0
- data/lib/odca/version.rb +1 -1
- data/odca.gemspec +1 -1
- metadata +5 -6
- data/Gemfile.lock +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ee133fe221ff06912b00edf86e317ba229e7154
|
4
|
+
data.tar.gz: fc77a7f7a79bc1b914e14838110ca8b0487111a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34e413488e8df0de267d2f3a962c57d0576ee1c24bd5ebb27705220bcff6f9b53bbe4569445dc97b82e8e2b6a496003cc0af9d60cbaf5b6ec7ff26d4536e8716
|
7
|
+
data.tar.gz: 3dae720cd4c23a489cbaec68436df826297c459a39d469b5714c89c0da869cc6b20bb4844703acd1c26908c9de64764e070ed8c44d2cf3fe3244f7e5e4f46335
|
data/.gitignore
CHANGED
@@ -1,15 +1,10 @@
|
|
1
|
-
require '
|
2
|
-
require 'base58'
|
1
|
+
require 'hashlink'
|
3
2
|
require 'json'
|
4
3
|
|
5
4
|
module Odca
|
6
5
|
class HashlinkGenerator
|
7
6
|
def self.call(schema)
|
8
|
-
|
9
|
-
Digest::SHA2.hexdigest(
|
10
|
-
JSON.generate(schema)
|
11
|
-
).to_i(16)
|
12
|
-
)
|
7
|
+
Hashlink.encode(data: JSON.generate(schema)).split(':')[1]
|
13
8
|
end
|
14
9
|
end
|
15
10
|
end
|
data/lib/odca/parser.rb
CHANGED
data/lib/odca/schema_parser.rb
CHANGED
@@ -8,6 +8,7 @@ module Odca
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def call
|
11
|
+
return unless records.first[0]
|
11
12
|
schema_base = Odca::SchemaBase.new(
|
12
13
|
Odca::SchemaBase::Header.new(
|
13
14
|
name: records.first[0],
|
@@ -23,6 +24,8 @@ module Odca
|
|
23
24
|
attr_name = row[3]
|
24
25
|
attr_type = row[4]
|
25
26
|
|
27
|
+
next unless attr_name && attr_type
|
28
|
+
|
26
29
|
schema_base.add_attribute(
|
27
30
|
SchemaBase::Attribute.new(
|
28
31
|
name: attr_name,
|
data/lib/odca/version.rb
CHANGED
data/odca.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
26
|
spec.require_paths = ['lib']
|
27
27
|
|
28
|
-
spec.add_dependency '
|
28
|
+
spec.add_dependency 'hashlink', '~> 0.0.1'
|
29
29
|
|
30
30
|
spec.add_development_dependency 'rake', '~> 13.0'
|
31
31
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: odca
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Mitwicki
|
@@ -10,22 +10,22 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-06-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: hashlink
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 0.0.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
28
|
+
version: 0.0.1
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rake
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,7 +65,6 @@ files:
|
|
65
65
|
- ".rspec"
|
66
66
|
- ".travis.yml"
|
67
67
|
- Gemfile
|
68
|
-
- Gemfile.lock
|
69
68
|
- LICENSE
|
70
69
|
- README.md
|
71
70
|
- Rakefile
|
data/Gemfile.lock
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
odca (0.2.1)
|
5
|
-
base58 (~> 0.2)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
base58 (0.2.3)
|
11
|
-
diff-lcs (1.3)
|
12
|
-
rake (13.0.0)
|
13
|
-
rspec (3.9.0)
|
14
|
-
rspec-core (~> 3.9.0)
|
15
|
-
rspec-expectations (~> 3.9.0)
|
16
|
-
rspec-mocks (~> 3.9.0)
|
17
|
-
rspec-core (3.9.0)
|
18
|
-
rspec-support (~> 3.9.0)
|
19
|
-
rspec-expectations (3.9.0)
|
20
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
-
rspec-support (~> 3.9.0)
|
22
|
-
rspec-mocks (3.9.0)
|
23
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
-
rspec-support (~> 3.9.0)
|
25
|
-
rspec-support (3.9.0)
|
26
|
-
|
27
|
-
PLATFORMS
|
28
|
-
ruby
|
29
|
-
|
30
|
-
DEPENDENCIES
|
31
|
-
odca!
|
32
|
-
rake (~> 13.0)
|
33
|
-
rspec (~> 3.0)
|
34
|
-
|
35
|
-
BUNDLED WITH
|
36
|
-
1.16.2
|