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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3922731ee0fae6d9b57651cd56aa6c05fc43712e
4
- data.tar.gz: 8a7e49f4bb9cd958ea951c19c21b9c46a6d85198
3
+ metadata.gz: 2ee133fe221ff06912b00edf86e317ba229e7154
4
+ data.tar.gz: fc77a7f7a79bc1b914e14838110ca8b0487111a8
5
5
  SHA512:
6
- metadata.gz: 03bf0e1a11647358fa36c01bd3f1b7820ded612c02a334ab2316d58bab4d6955439b1de36ad07951593e2fb4687663788f869e04d15bddea70086cacd3724041
7
- data.tar.gz: 50a458ba35f70823e83d1d1501811e3c848b4cdeb1cf7de0753d5e6ba7d6cf11fe96770e8d95c34029fcd237c1a7dcb517bb1468716cbc495b0c57ccb1b03cb6
6
+ metadata.gz: 34e413488e8df0de267d2f3a962c57d0576ee1c24bd5ebb27705220bcff6f9b53bbe4569445dc97b82e8e2b6a496003cc0af9d60cbaf5b6ec7ff26d4536e8716
7
+ data.tar.gz: 3dae720cd4c23a489cbaec68436df826297c459a39d469b5714c89c0da869cc6b20bb4844703acd1c26908c9de64764e070ed8c44d2cf3fe3244f7e5e4f46335
data/.gitignore CHANGED
@@ -43,7 +43,7 @@ build-iPhoneSimulator/
43
43
 
44
44
  # for a library or gem, you might want to ignore these files since the code is
45
45
  # intended to run in multiple environments; otherwise, check them in:
46
- # Gemfile.lock
46
+ Gemfile.lock
47
47
  # .ruby-version
48
48
  # .ruby-gemset
49
49
 
@@ -1,15 +1,10 @@
1
- require 'digest/sha2'
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
- Base58.encode(
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
@@ -31,6 +31,7 @@ module Odca
31
31
  schemas = separate_schemas(records)
32
32
  schemas.each do |schema|
33
33
  schema_base, overlays = schema.call
34
+ next unless schema_base && overlays
34
35
  save(schema_base: schema_base, overlays: overlays)
35
36
  end
36
37
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Odca
2
- VERSION = '0.2.2'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
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 'base58', '~> 0.2'
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.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: 2020-01-30 00:00:00.000000000 Z
13
+ date: 2021-06-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: base58
16
+ name: hashlink
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '0.2'
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: '0.2'
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