mrpin-rocketamf 2.0.0 → 2.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d63832510464963b845035c265bbc971b411ecb
4
- data.tar.gz: 658cafa2f6e9ec23b55d343178eeeeb1466410de
3
+ metadata.gz: fe5b7908c809ee6609beaa0bf3f2f3fe111cde9a
4
+ data.tar.gz: 65c3d1c0185a5317f8fd19eded23942227b0b51d
5
5
  SHA512:
6
- metadata.gz: 38481d7ea20ab45a9b3ebb9f7b339e7796a9756c93f75773f2a671fdc62d4c2109a3b92811b121a2a7cf4bd285f95f927feb0309002d77c841a7211bbe8741be
7
- data.tar.gz: 3bed4925ed2fb064f79bb1ed8716fc65bf40a9dd51187634fb7b646bf9bd776fcf55930ffbe83547fb811a0675b6c379a8a80bf2f2c92d710f4b94a2c5f884b1
6
+ metadata.gz: 4838eae569bc2e2d0b88cb2e62b2c903429d01d51e13809822cf87fa39c98843a936646165b2012d0c5be5d64f1590d7e1e2eccca8b8e23229bee0956a025847
7
+ data.tar.gz: 8ac67aa2406d3ddf3d0fdf9a72bdc5dd65cd5fe260ee687ce0d194c24d7d2a2ede7999c31045d648550e2b6141e0f11a28f77ccb652c14f28ccfa784cf0b2c11
@@ -0,0 +1,9 @@
1
+ pkg/*
2
+ .loadpath
3
+ .project
4
+ /rdoc/
5
+ *.bundle
6
+ *.so
7
+ *.dll
8
+ /tmp
9
+ *.swf
Binary file
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'mrpin-rocketamf'
5
- spec.version = '2.0.0'
5
+ spec.version = '2.0.1'
6
6
  spec.platform = Gem::Platform::RUBY
7
7
  spec.authors = ['Jacob Henry', 'Stephen Augenstein', "Joc O'Connor", 'Gregory Tkach']
8
8
  spec.email = %w(gregory.tkach@gmail.com)
@@ -11,16 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = 'Fast AMF3 serializer/deserializer'
12
12
  spec.description = 'Fast AMF3 serializer/deserializer with remoting request/response wrappers to simplify integration'
13
13
 
14
- files = []
15
- files << 'README.rdoc'
16
- files << 'benchmark.rb'
17
- files << 'mrpin-rocketamf.gemspec'
18
- files << 'Rakefile'
19
- files << 'lib/**/*.rb'
20
- files << 'spec/**/*.{rb,bin,opts}'
21
- files << 'ext/**/*.{c,h,rb}'
22
-
23
- spec.files = Dir[*files]
14
+ spec.files = `git ls-files`.split($/)
24
15
  spec.test_files = Dir[*['spec/**/*_spec.rb']]
25
16
  spec.extensions = Dir[*['ext/**/extconf.rb']]
26
17
  spec.require_paths = ['lib']
@@ -0,0 +1,9 @@
1
+ package {
2
+ public class ASClass {
3
+ public var baz:Object = null;
4
+ public var foo:String = "bar";
5
+ public function ASClass($foo:String) {
6
+ foo = $foo;
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,248 @@
1
+ package {
2
+ import flash.desktop.NativeApplication;
3
+ import flash.display.Sprite;
4
+ import flash.events.Event;
5
+ import flash.filesystem.*;
6
+ import flash.net.registerClassAlias;
7
+ import flash.utils.*;
8
+ import flash.xml.XMLDocument;
9
+ import mx.collections.ArrayCollection;
10
+
11
+ public class Encoder extends Sprite {
12
+ public function Encoder() {
13
+ var dir:File = File.userDirectory;
14
+ dir.browseForDirectory("Select Output Directory");
15
+ dir.addEventListener(Event.SELECT, writeSpecFixtures)
16
+ }
17
+
18
+ private function writeSpecFixtures(evt:Event):void {
19
+ registerClassAlias('org.amf.ASClass', ASClass);
20
+ registerClassAlias('ExternalizableTest', ExternalizableTest);
21
+ registerClassAlias('flex.messaging.io.ArrayCollection', mx.collections.ArrayCollection);
22
+ XML.prettyPrinting = false;
23
+
24
+ var tests:Object = {
25
+ 'amf0-number': 3.5,
26
+ 'amf0-boolean': true,
27
+ 'amf0-string': "this is a テスト",
28
+ 'amf0-null': null,
29
+ 'amf0-undefined': undefined,
30
+ 'amf0-hash': function():Array {
31
+ var a:Array = new Array();
32
+ a['a'] = 'b';
33
+ a['c'] = 'd';
34
+ return a;
35
+ },
36
+ 'amf0-empty-string-key-hash': function():Array {
37
+ var a:Array = new Array();
38
+ a['a'] = 'b';
39
+ a['c'] = 'd';
40
+ a[''] = 'last';
41
+ return a;
42
+ },
43
+ 'amf0-ecma-ordinal-array': ['a', 'b', 'c', 'd'],
44
+ //'amf0-strict-array': ['a', 'b', 'c', 'd'], // Not possible from AS3
45
+ 'amf0-time': function():Date {
46
+ var d:Date = new Date();
47
+ d.setTime(Date.UTC(2003, 1, 13, 5));
48
+ return d;
49
+ },
50
+ 'amf0-date': function():Date {
51
+ var d:Date = new Date();
52
+ d.setTime(Date.UTC(2020, 4, 30));
53
+ return d;
54
+ },
55
+ 'amf0-xml-doc': new XMLDocument('<parent><child prop="test"/></parent>'),
56
+ 'amf0-object': function():Object {
57
+ var o:Object = {};
58
+ o['bar'] = 3.14;
59
+ o['foo'] = 'baz';
60
+ return o;
61
+ },
62
+ 'amf0-untyped-object': function():Object {
63
+ var o:Object = {};
64
+ o['baz'] = null;
65
+ o['foo'] = 'bar';
66
+ return o;
67
+ },
68
+ 'amf0-typed-object': new ASClass('bar'),
69
+ 'amf0-ref-test': function():Object {
70
+ var o:Object = tests['amf0-object']();
71
+ var ret:Object = {};
72
+ ret['0'] = o;
73
+ ret['1'] = o;
74
+ return ret;
75
+ },
76
+ 'amf0-complex-encoded-string': function():Object {
77
+ var o:Object = {};
78
+ o['shift'] = "Shift テスト";
79
+ o['utf'] = "UTF テスト";
80
+ o['zed'] = 5;
81
+ return o;
82
+ },
83
+ 'amf3-null': null,
84
+ 'amf3-false': false,
85
+ 'amf3-true': true,
86
+ 'amf3-max': 268435455,
87
+ 'amf3-0': 0,
88
+ 'amf3-min': -268435456,
89
+ 'amf3-float': 3.5,
90
+ 'amf3-large-max': 268435456,
91
+ 'amf3-large-min': -268435457,
92
+ 'amf3-bignum': Math.pow(2, 1000),
93
+ 'amf3-string': "String . String",
94
+ 'amf3-symbol': "foo",
95
+ 'amf3-date': function():Date {
96
+ var d:Date = new Date();
97
+ d.setTime(0);
98
+ return d;
99
+ },
100
+ 'amf3-xml': new XML('<parent><child prop="test"/></parent>'),
101
+ 'amf3-xml-doc': new XMLDocument('<parent><child prop="test"/></parent>'),
102
+ 'amf3-dynamic-object': function():Object {
103
+ var o:Object = {};
104
+ o['another_public_property'] = 'a_public_value';
105
+ o['nil_property'] = null;
106
+ o['property_one'] = 'foo';
107
+ return o;
108
+ },
109
+ 'amf3-typed-object': new ASClass('bar'),
110
+ 'amf3-externalizable': [new ExternalizableTest(5, 7), new ExternalizableTest(13, 5)],
111
+ 'amf3-hash': function():Object {
112
+ var o:Object = {};
113
+ o['answer'] = 42;
114
+ o['foo'] = 'bar';
115
+ return o;
116
+ },
117
+ 'amf3-empty-array': [],
118
+ 'amf3-primitive-array': [1,2,3,4,5],
119
+ 'amf3-associative-array': function():Array {
120
+ var a:Array = [];
121
+ a["asdf"] = "fdsa";
122
+ a["foo"] = "bar";
123
+ a[42] = "bar";
124
+ a[0] = "bar1";
125
+ a[1] = "bar2";
126
+ a[2] = "bar3";
127
+ return a;
128
+ },
129
+ 'amf3-mixed-array': function():Array {
130
+ var h1:Object = {"foo_one": "bar_one"};
131
+ var h2:Object = {"foo_two": ""};
132
+ var so1:Object = {"foo_three": 42};
133
+ return [h1, h2, so1, {}, [h1, h2, so1], [], 42, "", [], "", {}, "bar_one", so1];
134
+ },
135
+ 'amf3-array-collection': new ArrayCollection(['foo', 'bar']),
136
+ 'amf3-complex-array-collection': function():Array {
137
+ var a:ArrayCollection = new ArrayCollection(['foo', 'bar']);
138
+ var b:ArrayCollection = new ArrayCollection([new ASClass('bar'), new ASClass('asdf')]);
139
+ return [a, b, b];
140
+ },
141
+ 'amf3-byte-array': function():ByteArray {
142
+ var b:ByteArray = new ByteArray();
143
+ b.writeByte(0);
144
+ b.writeByte(3);
145
+ b.writeUTFBytes("これtest");
146
+ b.writeByte(64);
147
+ return b;
148
+ },
149
+ 'amf3-empty-dictionary': new Dictionary(),
150
+ 'amf3-dictionary': function():Dictionary {
151
+ var d:Dictionary = new Dictionary();
152
+ d["bar"] = "asdf1";
153
+ d[new ASClass("baz")] = "asdf2";
154
+ return d;
155
+ },
156
+ 'amf3-string-ref': function():Array {
157
+ var foo:String = "foo";
158
+ var bar:String = "str";
159
+ return [foo, bar, foo, bar, foo, {"str": foo}];
160
+ },
161
+ 'amf3-empty-string-ref': function():Array {
162
+ var s:String = "";
163
+ return [s, s];
164
+ },
165
+ 'amf3-date-ref': function():Array {
166
+ var d:Date = new Date();
167
+ d.setTime(0);
168
+ return [d, d];
169
+ },
170
+ 'amf3-object-ref': function():Array {
171
+ var obj1:Object = {"foo": "bar"};
172
+ var obj2:Object = {"foo": obj1["foo"]};
173
+ return [[obj1, obj2], "bar", [obj1, obj2]];
174
+ },
175
+ 'amf3-trait-ref': [new ASClass("foo"), new ASClass("bar")],
176
+ 'amf3-array-ref': function():Array {
177
+ var a:Array = [1, 2, 3];
178
+ var b:Array = ['a', 'b', 'c'];
179
+ return [a, b, a, b];
180
+ },
181
+ 'amf3-empty-array-ref': function():Array {
182
+ var a:Array = []; var b:Array = [];
183
+ return [a, b, a, b];
184
+ },
185
+ 'amf3-xml-ref': function():Array {
186
+ var x:XML = new XML('<parent><child prop="test"/></parent>');
187
+ return [x, x];
188
+ },
189
+ 'amf3-byte-array-ref': function():Array {
190
+ var b:ByteArray = new ByteArray();
191
+ b.writeUTFBytes("ASDF");
192
+ return [b, b];
193
+ },
194
+ 'amf3-graph-member': function():Object {
195
+ var parentObj:Object = {};
196
+ var child1:Object = {"children": []};
197
+ child1['parent'] = parentObj;
198
+ var child2:Object = {"children": []};
199
+ child2['parent'] = parentObj;
200
+ parentObj['children'] = [child1, child2];
201
+ parentObj['parent'] = null;
202
+ return parentObj;
203
+ },
204
+ 'amf3-complex-encoded-string-array': [5, "Shift テスト", "UTF テスト", 5],
205
+ 'amf3-encoded-string-ref': ["this is a テスト", "this is a テスト"],
206
+ 'amf3-vector-int': function():Vector.<int> {
207
+ var v:Vector.<int> = new Vector.<int>();
208
+ v.push(4);
209
+ v.push(-20);
210
+ v.push(12);
211
+ return v;
212
+ },
213
+ 'amf3-vector-uint': function():Vector.<uint> {
214
+ var v:Vector.<uint> = new Vector.<uint>();
215
+ v.push(4);
216
+ v.push(20);
217
+ v.push(12);
218
+ return v;
219
+ },
220
+ 'amf3-vector-double': function():Vector.<Number> {
221
+ var v:Vector.<Number> = new Vector.<Number>();
222
+ v.push(4.3);
223
+ v.push(-20.6);
224
+ return v;
225
+ },
226
+ 'amf3-vector-object': function():Vector.<ASClass> {
227
+ var v:Vector.<ASClass> = new Vector.<ASClass>();
228
+ v.push(new ASClass('foo'));
229
+ v.push(new ASClass('bar'));
230
+ v.push(new ASClass('baz'));
231
+ return v;
232
+ }
233
+ };
234
+
235
+ var outputDir:File = evt.target as File;
236
+ for(var key:String in tests) {
237
+ trace(key);
238
+ var fs:FileStream = new FileStream();
239
+ fs.objectEncoding = (key.indexOf('amf0-') === 0) ? 0 : 3;
240
+ fs.open(outputDir.resolvePath(key+'.bin'), FileMode.WRITE);
241
+ fs.writeObject(tests[key] is Function ? tests[key]() : tests[key]);
242
+ fs.close();
243
+ }
244
+
245
+ NativeApplication.nativeApplication.exit();
246
+ }
247
+ }
248
+ }
@@ -0,0 +1,23 @@
1
+ package {
2
+ import flash.utils.*;
3
+
4
+ public class ExternalizableTest implements IExternalizable {
5
+ private var one:int;
6
+ private var two:int;
7
+
8
+ public function ExternalizableTest(one:int, two:int) {
9
+ this.one = one;
10
+ this.two = two;
11
+ }
12
+
13
+ public function writeExternal(output:IDataOutput):void {
14
+ output.writeDouble(one);
15
+ output.writeDouble(two);
16
+ }
17
+
18
+ public function readExternal(input:IDataInput):void {
19
+ one = input.readDouble();
20
+ two = input.readDouble();
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+ amxmlc Encoder.as -debug
3
+ adl encoder-app.xml
@@ -0,0 +1,13 @@
1
+ <?xml version ="1.0" encoding="utf-8" ?>
2
+ <application xmlns="http://ns.adobe.com/air/application/3.1">
3
+ <id>com.rubyamf.Encoder</id>
4
+ <filename>Encoder</filename>
5
+ <name>Encoder</name>
6
+ <versionNumber>1.0</versionNumber>
7
+ <initialWindow>
8
+ <content>Encoder.swf</content>
9
+ <systemChrome>standard</systemChrome>
10
+ <transparent>false</transparent>
11
+ <visible>true</visible>
12
+ </initialWindow>
13
+ </application>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mrpin-rocketamf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Henry
@@ -37,9 +37,11 @@ extensions:
37
37
  extra_rdoc_files:
38
38
  - README.rdoc
39
39
  files:
40
+ - .gitignore
40
41
  - README.rdoc
41
42
  - Rakefile
42
43
  - benchmark.rb
44
+ - doc/amf3-speification.pdf
43
45
  - ext/rocketamf_ext/class_mapping.c
44
46
  - ext/rocketamf_ext/constants.h
45
47
  - ext/rocketamf_ext/deserializer.c
@@ -127,6 +129,11 @@ files:
127
129
  - spec/fixtures/request/simple-request.bin
128
130
  - spec/fixtures/request/simple-response.bin
129
131
  - spec/fixtures/request/unsupportedCommandMessage.bin
132
+ - spec/flash/ASClass.as
133
+ - spec/flash/Encoder.as
134
+ - spec/flash/ExternalizableTest.as
135
+ - spec/flash/build
136
+ - spec/flash/encoder-app.xml
130
137
  - spec/helpers/class_mapping_test.rb
131
138
  - spec/helpers/class_mapping_test2.rb
132
139
  - spec/helpers/externalizable_test.rb