erlang_rb 1.3.3 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data.tar.gz.sig CHANGED
Binary file
@@ -1,6 +1,8 @@
1
1
  Erlang Binary Term Format for Ruby
2
2
  ==================================
3
3
 
4
+ [![Build Status](https://secure.travis-ci.org/okeuday/erlang_rb.png?branch=master)](http://travis-ci.org/okeuday/erlang_rb)
5
+
4
6
  Provides all encoding and decoding for the Erlang Binary Term Format
5
7
  (as defined at [http://erlang.org/doc/apps/erts/erl_ext_dist.html](http://erlang.org/doc/apps/erts/erl_ext_dist.html))
6
8
  in a single Ruby module.
@@ -332,7 +332,10 @@ module Erlang
332
332
  elsif tag == TAG_SMALL_INTEGER_EXT
333
333
  return [i + 1, data[i].ord]
334
334
  elsif tag == TAG_INTEGER_EXT
335
- value = data[i,4].unpack('i>')[0]
335
+ value = data[i,4].unpack('N')[0]
336
+ if 0 != (value & 0x80000000)
337
+ value = -2147483648 + (value & 0x7fffffff)
338
+ end
336
339
  return [i + 4, value]
337
340
  elsif tag == TAG_FLOAT_EXT
338
341
  value = data[i,31].partition(0.chr)[0].to_f
@@ -437,7 +440,7 @@ module Erlang
437
440
  i += 1
438
441
  arity = data[i].ord
439
442
  i += 1
440
- return [i, OtpErlangFunction.new(tag, data[old_i,i])]
443
+ return [i, OtpErlangFunction.new(tag, data[old_i,i - old_i])]
441
444
  elsif tag == TAG_NEW_REFERENCE_EXT
442
445
  j = data[i,2].unpack('n')[0] * 4
443
446
  i += 2
@@ -489,7 +492,7 @@ module Erlang
489
492
  i = result[0]; uniq = result[1]
490
493
  result = binary_to_term_sequence(i, numfree, data)
491
494
  i = result[0]; free = result[1]
492
- return [i, OtpErlangFunction.new(tag, data[old_i,i])]
495
+ return [i, OtpErlangFunction.new(tag, data[old_i,i - old_i])]
493
496
  elsif tag == TAG_ATOM_UTF8_EXT
494
497
  j = data[i,2].unpack('n')[0]
495
498
  i += 2
@@ -548,8 +551,8 @@ module Erlang
548
551
  return [i + 1, data[i].ord]
549
552
  elsif tag == TAG_INTEGER_EXT
550
553
  value = data[i,4].unpack('N')[0]
551
- if value & 0x80000000
552
- value = -1 * (value & 0x7fffffff)
554
+ if 0 != (value & 0x80000000)
555
+ value = -2147483648 + (value & 0x7fffffff)
553
556
  end
554
557
  return [i + 4, Fixnum.induced_from(value)]
555
558
  else
@@ -511,15 +511,15 @@ class EncodeTestCase < Test::Unit::TestCase
511
511
  Erlang::term_to_binary("testing multiple words")
512
512
  )
513
513
  assert_equal("\x83\x6B\x00\x01\x20",
514
- Erlang::term_to_binary(" "))
514
+ Erlang::term_to_binary(" "))
515
515
  assert_equal("\x83\x6B\x00\x02\x20\x20",
516
- Erlang::term_to_binary(" "))
516
+ Erlang::term_to_binary(" "))
517
517
  assert_equal("\x83\x6B\x00\x01\x31",
518
- Erlang::term_to_binary("1"))
518
+ Erlang::term_to_binary("1"))
519
519
  assert_equal("\x83\x6B\x00\x02\x33\x37",
520
- Erlang::term_to_binary("37"))
520
+ Erlang::term_to_binary("37"))
521
521
  assert_equal("\x83\x6B\x00\x07\x6F\x6E\x65\x20\x3D\x20\x31",
522
- Erlang::term_to_binary("one = 1"))
522
+ Erlang::term_to_binary("one = 1"))
523
523
  assert_equal(
524
524
  "\x83\x6B\x00\x20\x21\x40\x23\x24\x25\x5E\x26\x2A\x28\x29\x5F\x2B" \
525
525
  "\x2D\x3D\x5B\x5D\x7B\x7D\x5C\x7C\x3B\x27\x3A\x22\x2C\x2E\x2F\x3C" \
metadata CHANGED
@@ -1,91 +1,90 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: erlang_rb
3
- version: !ruby/object:Gem::Version
4
- version: 1.3.3
3
+ version: !ruby/object:Gem::Version
4
+ hash: 7
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 4
9
+ - 0
10
+ version: 1.4.0
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Michael Truog
9
14
  autorequire:
10
15
  bindir: bin
11
- cert_chain:
12
- - ! '-----BEGIN CERTIFICATE-----
13
-
16
+ cert_chain:
17
+ - |
18
+ -----BEGIN CERTIFICATE-----
14
19
  MIIDMDCCAhigAwIBAgIBADANBgkqhkiG9w0BAQUFADA+MRAwDgYDVQQDDAdtanRy
15
-
16
20
  dW9nMRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZFgNjb20w
17
-
18
21
  HhcNMTQwNjI0MjAzMDQ2WhcNMTUwNjI0MjAzMDQ2WjA+MRAwDgYDVQQDDAdtanRy
19
-
20
22
  dW9nMRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZFgNjb20w
21
-
22
23
  ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDBOoI/CUuwOhXjks02cT58
23
-
24
24
  jLxgsOQ412Xzu4eEKqzNsWMoj/3+qYdb5CR4+51EHtuJHZ8hndL5DTYIO8ylcG11
25
-
26
25
  EvyxqOzU+gqC53gCEBhJLivlyMXvGqL8qHPuSKGEMc1Vpzh0WicwNnaT7z3X6aQP
27
-
28
26
  UE6qWd1yE9jT7TX+GKcKayBJTufxcBMjtwvzMH4IiVaNjUBHBq2LbeNO1yDPYVzV
29
-
30
27
  HWnZCv75vIXdUruFrSZcJgNRYRwzMfHEbf+BcvqqGVV6p3PJgJMrjI8FZ7roIJNf
31
-
32
28
  D7ZO96x4ItjGazoTntAZe3EM9QB5Wjsd1cv2IEOISQ6jyvVX5E84Al+MEKhhhFuL
33
-
34
29
  AgMBAAGjOTA3MAkGA1UdEwQCMAAwHQYDVR0OBBYEFACw0UcBaNl2dQWwgg/Qzeyf
35
-
36
30
  cKG7MAsGA1UdDwQEAwIEsDANBgkqhkiG9w0BAQUFAAOCAQEAHjLn+8F8yeOFcKst
37
-
38
31
  mKA3m28OIoICMefZOiJfTC9UkVkW+554IXNBu3vVxLc0nlCqmuf/aQGaFBUm9MLA
39
-
40
32
  oD5CmlrU9OrEl2fPxqTHAwFgLNre8e2EWtm2OhBg73JTHRVVyBLpSK5GRUDzhJtZ
41
-
42
33
  7a2ocAE2AgFKpISNxIUe4Zz9O2thg3iryLh9prjETJTUfxDjBmHdx+YkNAblRa2w
43
-
44
34
  k9A+nCZzZECcR5ZZYSeaK6MCugGmXUhAkDbuWumCzu/RAghlVC9RFFQt7o1SwGQp
45
-
46
35
  LdvYOeJbviyiH1q1rC3NAJNC4P7Q41zx1OYa8S9M5qn+JpE0ZsomnZyGunWaya9Q
47
-
48
36
  bTD/aw==
49
-
50
37
  -----END CERTIFICATE-----
51
38
 
52
- '
53
- date: 2014-09-30 00:00:00.000000000 Z
39
+ date: 2014-12-20 00:00:00 Z
54
40
  dependencies: []
41
+
55
42
  description: Erlang Binary Term Format for Ruby
56
43
  email: mjtruog@gmail.com
57
44
  executables: []
45
+
58
46
  extensions: []
59
- extra_rdoc_files:
47
+
48
+ extra_rdoc_files:
60
49
  - README.markdown
61
- files:
50
+ files:
62
51
  - lib/erlang.rb
63
52
  - README.markdown
64
53
  - tests/erlang_tests.rb
65
54
  homepage: https://github.com/okeuday/erlang_rb
66
- licenses:
55
+ licenses:
67
56
  - BSD
68
57
  post_install_message:
69
58
  rdoc_options: []
70
- require_paths:
59
+
60
+ require_paths:
71
61
  - lib
72
- required_ruby_version: !ruby/object:Gem::Requirement
62
+ required_ruby_version: !ruby/object:Gem::Requirement
73
63
  none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ hash: 51
68
+ segments:
69
+ - 1
70
+ - 9
71
+ - 0
77
72
  version: 1.9.0
78
- required_rubygems_version: !ruby/object:Gem::Requirement
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
74
  none: false
80
- requirements:
81
- - - ! '>='
82
- - !ruby/object:Gem::Version
83
- version: '0'
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ hash: 3
79
+ segments:
80
+ - 0
81
+ version: "0"
84
82
  requirements: []
83
+
85
84
  rubyforge_project:
86
- rubygems_version: 1.8.11
85
+ rubygems_version: 1.8.15
87
86
  signing_key:
88
87
  specification_version: 3
89
88
  summary: Erlang
90
- test_files:
89
+ test_files:
91
90
  - tests/erlang_tests.rb
metadata.gz.sig CHANGED
Binary file