rbon 0.1.210123 → 0.2.221217

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
  SHA256:
3
- metadata.gz: f286a21f41a0db01032f1210bc425d643f7559b6300b7148b225623f8a5aa55f
4
- data.tar.gz: 8bc8628e5f53c0970b58a6eb72f264329229dda27fea523c3374103b525e683c
3
+ metadata.gz: 172bd5bea8fe706f8d1e8f08831a59c9620747be1dd463b549fd6c212cdb424f
4
+ data.tar.gz: 2a54382ce680e03ca697a8f36fbd8572178b1b4c3be33aa46c34974171be9ef7
5
5
  SHA512:
6
- metadata.gz: 52e3a437c7cae63decfc0d0ae5f0aa3e6db071521437b2072b7b6368e2f8a1523bfab893a40571ff8bdd2dc8a2077be71ede43fa4add89b2fc84affa6ef9740f
7
- data.tar.gz: 7c71efa7c40cf36eff21a1e8b5bd6a573b4b582b19519c5e0ebf800aad3beff085123bde50a6981d8d398dd62af3ef4c8108aa7dd1eed74c24e2b738e062f35a
6
+ metadata.gz: 03a0a04e88afb79d78d2c6b85f5ed6e3c84723afb3c6ccb1b011e711b91e3dd755fd6999abfbb050c0a8cf750d5d42a613b271d5233a30f7c235bbb179018737
7
+ data.tar.gz: 9892f139b231a8d9e79f10ecf7544b02da395df5b67905f17f21bd4c19caf8cff5d37b4be0ced99187e0d924920c5e8cd684ea215501dedce5f5039461f79bb5
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # RBON
2
2
 
3
- * [VERSION 0.1.210123](https://github.com/carlosjhr64/rbon/releases)
3
+ * [VERSION 0.2.221217](https://github.com/carlosjhr64/rbon/releases)
4
4
  * [github](https://www.github.com/carlosjhr64/rbon)
5
5
  * [rubygems](https://rubygems.org/gems/rbon)
6
6
 
@@ -68,7 +68,7 @@ ITEMS == RBON.load(dump) #=> true
68
68
 
69
69
  ## LICENSE:
70
70
 
71
- Copyright 2021 CarlosJHR64
71
+ Copyright 2022 CarlosJHR64
72
72
 
73
73
  Permission is hereby granted, free of charge,
74
74
  to any person obtaining a copy of this software and
data/lib/rbon/dump.rb CHANGED
@@ -26,14 +26,16 @@ class Dump
26
26
  when Symbol, String, Integer, Float, NilClass, TrueClass, FalseClass
27
27
  item(object, indent)
28
28
  else
29
- raise RBON::Dump::Error, "Unsupported class #{object.class}: #{object.inspect}"
29
+ raise RBON::Dump::Error,
30
+ "Unsupported class #{object.class}: #{object.inspect}"
30
31
  end
31
32
  end
32
33
 
33
34
  def item(item, indent)
34
35
  case item
35
36
  when String
36
- @io.print (item=='')? '""' : item.lines.map{_1.inspect}.join(" +\n"+indent)
37
+ @io.print (item=='')?
38
+ '""' : item.lines.map{_1.inspect}.join(" +\n"+indent)
37
39
  else
38
40
  @io.print item.inspect
39
41
  end
@@ -69,7 +71,9 @@ class Dump
69
71
  end
70
72
 
71
73
  def key_object(key, object, indent)
72
- raise RBON::Dump::Error, "Bad Key #{key.class}: #{key.inspect}" unless key.is_a?(Symbol) and key.match?('^\w+[?!]?$')
74
+ unless key.is_a?(Symbol) and key.match?('^\w+[?!]?$')
75
+ raise RBON::Dump::Error, "Bad Key #{key.class}: #{key.inspect}"
76
+ end
73
77
  @io.print "#{key}: "
74
78
  traverse(object, indent)
75
79
  end
data/lib/rbon/load.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  module RBON
2
2
  class Load
3
- class Bug < Exception
4
- end
5
3
  class Error < StandardError
6
4
  end
7
5
 
@@ -17,6 +15,7 @@ class Load
17
15
  XX = X+X
18
16
  XQ = X+'"'
19
17
  XN = X+'n'
18
+ XT = X+'t'
20
19
 
21
20
  NILS = /^nil,?$/
22
21
  FALSES = /^false,?$/
@@ -73,10 +72,10 @@ class Load
73
72
  when Hash
74
73
  items[item[0]]=item[1]
75
74
  else
76
- raise RBON::Load::Bug, "Unexpected Error"
75
+ raise RBON::Load::Error
77
76
  end
78
77
  end
79
- return items
78
+ # Loop never breaks out... must be rescued below
80
79
  rescue CloseArray
81
80
  raise RBON::Load::Error unless items.is_a? Array
82
81
  return items
@@ -89,7 +88,7 @@ class Load
89
88
  end
90
89
 
91
90
  def chomp(string)
92
- string.chomp(',')[1..-2].gsub(XX,X).gsub(XQ,'"').gsub(XN,"\n")
91
+ string.chomp(',')[1..-2].gsub(XX,X).gsub(XQ,'"').gsub(XT,"\t").gsub(XN,"\n")
93
92
  end
94
93
 
95
94
  def get_strings
data/lib/rbon.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'stringio'
2
2
  module RBON
3
- VERSION = '0.1.210123'
3
+ VERSION = '0.2.221217'
4
4
  require 'rbon/dump'
5
5
  require 'rbon/load'
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.210123
4
+ version: 0.2.221217
5
5
  platform: ruby
6
6
  authors:
7
- - carlosjhr64
8
- autorequire:
7
+ - CarlosJHR64
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-23 00:00:00.000000000 Z
11
+ date: 2022-12-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  RBON is not JSON!
@@ -33,7 +33,7 @@ homepage: https://github.com/carlosjhr64/rbon
33
33
  licenses:
34
34
  - MIT
35
35
  metadata: {}
36
- post_install_message:
36
+ post_install_message:
37
37
  rdoc_options: []
38
38
  require_paths:
39
39
  - lib
@@ -48,9 +48,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0'
50
50
  requirements:
51
- - 'ruby: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]'
52
- rubygems_version: 3.2.3
53
- signing_key:
51
+ - 'ruby: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [aarch64-linux]'
52
+ rubygems_version: 3.3.7
53
+ signing_key:
54
54
  specification_version: 4
55
55
  summary: RBON is not JSON!
56
56
  test_files: []