amq-protocol 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -6,3 +6,4 @@ tmp
6
6
  /vendor/amq-*
7
7
  /coverage
8
8
  Gemfile.lock
9
+ .rbx/*
data/.travis.yml CHANGED
@@ -3,10 +3,11 @@ bundler_args: --without development
3
3
  script: "bundle exec rspec spec"
4
4
  rvm:
5
5
  - 1.8.7
6
- - 1.9.2
7
- - jruby
8
6
  - rbx-2.0
9
7
  - ree
8
+ - jruby
9
+ - 1.9.2
10
+ - 1.9.3
10
11
  - ruby-head
11
12
  notifications:
12
13
  recipients:
data/lib/amq/hacks.rb CHANGED
@@ -18,11 +18,11 @@ module AMQ
18
18
  else
19
19
  def self.pack_64_big_endian(long_long)
20
20
  result = [long_long].pack(Q)
21
- result.chars.to_a.reverse.join
21
+ result.bytes.to_a.reverse.map(&:chr).join
22
22
  end
23
23
 
24
24
  def self.unpack_64_big_endian(data)
25
- data = data.chars.to_a.reverse.join
25
+ data = data.bytes.to_a.reverse.map(&:chr).join
26
26
  data.unpack(Q)
27
27
  end
28
28
  end
@@ -1,5 +1,5 @@
1
1
  module AMQ
2
2
  module Protocol
3
- VERSION = "0.8.0"
3
+ VERSION = "0.8.1"
4
4
  end # Protocol
5
5
  end # AMQ
@@ -19,21 +19,42 @@ module AMQ
19
19
  }
20
20
  }
21
21
 
22
- describe ".pack_64_big_endian" do
23
- it "packs integers into big-endian string" do
24
- examples.each do |key, value|
25
- described_class.pack_64_big_endian(key).should == value
26
- end
22
+ it "packs integers into big-endian string" do
23
+ examples.each do |key, value|
24
+ described_class.pack_64_big_endian(key).should == value
25
+ end
26
+ end
27
+
28
+ it "should unpack string representation into integer" do
29
+ examples.each do |key, value|
30
+ described_class.unpack_64_big_endian(value)[0].should == key
27
31
  end
28
32
  end
33
+
34
+ if RUBY_VERSION < '1.9'
35
+ describe "with utf encoding" do
36
+ before do
37
+ $KCODE = 'u'
38
+ end
39
+
40
+ after do
41
+ $KCODE = 'NONE'
42
+ end
43
+
44
+ it "packs integers into big-endian string" do
45
+ examples.each do |key, value|
46
+ described_class.pack_64_big_endian(key).should == value
47
+ end
48
+ end
29
49
 
30
- describe ".unpack_64_big_endian" do
31
- it "should unpack string representation into integer" do
32
- examples.each do |key, value|
33
- described_class.unpack_64_big_endian(value)[0].should == key
50
+ it "should unpack string representation into integer" do
51
+ examples.each do |key, value|
52
+ described_class.unpack_64_big_endian(value)[0].should == key
53
+ end
34
54
  end
35
55
  end
36
56
  end
57
+
37
58
  end
38
59
  end
39
60
  end
@@ -137,13 +137,13 @@ module AMQ
137
137
 
138
138
 
139
139
 
140
- xit "is capable of decoding empty array table values" do
140
+ it "is capable of decoding empty array table values" do
141
141
  input = { "arrayvalue" => Array.new }
142
142
  Table.decode(Table.encode(input)).should == input
143
143
  end
144
144
 
145
145
 
146
- xit "is capable of decoding single string value array table values" do
146
+ it "is capable of decoding single string value array table values" do
147
147
  input = { "arrayvalue" => ["amq-protocol"] }
148
148
  Table.decode(Table.encode(input)).should == input
149
149
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amq-protocol
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 0
10
- version: 0.8.0
9
+ - 1
10
+ version: 0.8.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jakub Stastny
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-07-21 00:00:00 +04:00
21
+ date: 2011-09-05 00:00:00 +04:00
22
22
  default_executable:
23
23
  dependencies: []
24
24