scon 0.2.0 → 0.2.1

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: 442e89803ca4cb396738c8c85eb6df9e5fe88e90
4
- data.tar.gz: 630d42f52459ea20390177eb70e0d5c40f62cdf4
3
+ metadata.gz: c9e3aae56313f6d62a4fa76a4fc1ff3545dbc8f8
4
+ data.tar.gz: 57ab89e1b823f91a663d8c89a2c0ab354c40f0fc
5
5
  SHA512:
6
- metadata.gz: 4bce748a277d73d7baf69714183320acf431d733481fa1be8f04ad4cad335dd50a31e86b7382eeaeeec5401c99aa9981101024d8ef4a5cf7278273bcc536804a
7
- data.tar.gz: 7274b3cca619869575a57113adb768c712eb3ab016f328c48a5564b70b6b5d7c0befb4dfd05786d6d939b2c69de522b7189dd47460efe709bf52fb9ebcd23d5d
6
+ metadata.gz: 74c2f6af2ff3b081114fde6295e0b5c2c34a0a219292bbbb137425ad35fb35b82af521140e81e4d9c34e436de01b8f23cce9bce09e230140b9a5a5dd184b05ff
7
+ data.tar.gz: 9de5c9581361148ebe37e83b49aef5b787399e0c2531490b141742afb3618dcbf15d19a403d6d88e9e8688aeddb2ee343081c00e72766a2220e5a6b5cf3d06e7
@@ -30,7 +30,9 @@ module SCON
30
30
  def self.string_bytes str
31
31
  bytes = str.encode("utf-8").bytes
32
32
  instr = 0xD0
33
- if bytes.length < 32
33
+ if bytes.length == 0
34
+ instr = Constants::DATA[:zero_string]
35
+ elsif bytes.length < 32
34
36
  instr += bytes.length
35
37
  else
36
38
  bytes << 0xFF
@@ -11,6 +11,7 @@ module SCON
11
11
  :nil => 0xC0,
12
12
  :true => 0xC1,
13
13
  :false => 0xC2,
14
+ :zero_string => 0xC3,
14
15
 
15
16
  :string => 0xD0,
16
17
 
@@ -36,6 +36,9 @@ private
36
36
  str << tmp
37
37
  end
38
38
  return str.pack("c*").force_encoding("utf-8")
39
+ elsif data[0] == Constants::DATA[:zero_string]
40
+ data.shift
41
+ return ""
39
42
  else
40
43
  return false
41
44
  end
@@ -1,3 +1,3 @@
1
1
  module SCON
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - JacisNonsense