cbor-elision 0.0.1

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
+ SHA256:
3
+ metadata.gz: cdd78bc9cb9e28d583bda6fd95a46dc60581ff1c7c37e79c6250083c268a9f9f
4
+ data.tar.gz: 9ca8f6d93f55acc6f6f66e02c6eee0b60391d9bc5367210a4c099f67dd1403d5
5
+ SHA512:
6
+ metadata.gz: ec2f45cfcb0bcc500a47d6c3be3552a6a1588672a1e36581b12d12382ce5138264443990d57ed96368828a0973a4d9e905d0fabe28c285dc09fe9d43dd06c95a
7
+ data.tar.gz: 1b76e49d8a34bc9490409209c69fe1c17e7bbf0da8f8f4a2cb4f65f69f940b3a3f82a77a3413acdf7f5299af4176a4d3b2d9e3b88557bbb65af70219ae13efae
@@ -0,0 +1,17 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "cbor-elision"
3
+ s.version = "0.0.1"
4
+ s.summary = "CBOR (Concise Binary Object Representation) diagnostic notation"
5
+ s.description = %q{cbor-elision implements elision for CBOR diagnostic notation}
6
+ s.author = "Carsten Bormann"
7
+ s.email = "cabo@tzi.org"
8
+ s.license = "MIT"
9
+ s.homepage = "http://cbor.io/"
10
+ s.files = Dir['lib/**/*.rb'] + %w(cbor-elision.gemspec) + Dir['bin/**/*.rb']
11
+ s.executables = Dir['bin/**/*.rb'].map {|x| File.basename(x)}
12
+ s.required_ruby_version = '>= 2.3'
13
+
14
+ s.require_paths = ["lib"]
15
+
16
+ s.add_development_dependency 'bundler', '~>1'
17
+ end
@@ -0,0 +1,16 @@
1
+ class CBOR_DIAG::App_h
2
+ def self.xeh_string(s)
3
+ s.gsub(/\s/, "").chars.each_slice(2).map{ |x| Integer(x.join, 16).chr("BINARY") }.join
4
+ end
5
+
6
+ def self.decode(_, s)
7
+ content = s.split(/([.][.][.])/).map { |s|
8
+ if s == "..."
9
+ CBOR::Tagged.new(888, nil)
10
+ else
11
+ xeh_string(s)
12
+ end
13
+ }
14
+ CBOR::Tagged.new(888, content)
15
+ end
16
+ end
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cbor-elision
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Carsten Bormann
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-03-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1'
27
+ description: cbor-elision implements elision for CBOR diagnostic notation
28
+ email: cabo@tzi.org
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - cbor-elision.gemspec
34
+ - lib/cbor-diagnostic-app/h.rb
35
+ homepage: http://cbor.io/
36
+ licenses:
37
+ - MIT
38
+ metadata: {}
39
+ post_install_message:
40
+ rdoc_options: []
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '2.3'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ requirements: []
54
+ rubygems_version: 3.3.7
55
+ signing_key:
56
+ specification_version: 4
57
+ summary: CBOR (Concise Binary Object Representation) diagnostic notation
58
+ test_files: []