rack-amf 0.0.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +18 -9
- data/Rakefile +23 -38
- data/lib/rack/amf/environment.rb +5 -8
- data/lib/rack/amf/middleware/pass_through.rb +5 -4
- data/lib/rack/amf/middleware/service_manager.rb +11 -3
- data/lib/rack/amf/middleware.rb +2 -1
- data/lib/rack/amf/request.rb +3 -16
- data/lib/rack/amf/response.rb +8 -67
- data/lib/rack/amf.rb +41 -1
- data/spec/{rack/service_manager_spec.rb → service_manager_spec.rb} +1 -2
- data/spec/spec.opts +2 -1
- data/spec/spec_helper.rb +1 -24
- metadata +19 -84
- data/lib/amf/class_mapping.rb +0 -211
- data/lib/amf/common.rb +0 -28
- data/lib/amf/constants.rb +0 -47
- data/lib/amf/pure/deserializer.rb +0 -361
- data/lib/amf/pure/io_helpers.rb +0 -94
- data/lib/amf/pure/remoting.rb +0 -120
- data/lib/amf/pure/serializer.rb +0 -327
- data/lib/amf/pure.rb +0 -14
- data/lib/amf/values/array_collection.rb +0 -9
- data/lib/amf/values/messages.rb +0 -133
- data/lib/amf/values/typed_hash.rb +0 -13
- data/lib/amf/version.rb +0 -9
- data/lib/amf.rb +0 -17
- data/spec/amf/class_mapping_set_spec.rb +0 -34
- data/spec/amf/class_mapping_spec.rb +0 -120
- data/spec/amf/deserializer_spec.rb +0 -311
- data/spec/amf/remoting_spec.rb +0 -51
- data/spec/amf/serializer_spec.rb +0 -328
- data/spec/amf/values/array_collection_spec.rb +0 -6
- data/spec/amf/values/messages_spec.rb +0 -31
- data/spec/fixtures/objects/amf0-boolean.bin +0 -1
- data/spec/fixtures/objects/amf0-date.bin +0 -0
- data/spec/fixtures/objects/amf0-ecma-ordinal-array.bin +0 -0
- data/spec/fixtures/objects/amf0-hash.bin +0 -0
- data/spec/fixtures/objects/amf0-null.bin +0 -1
- data/spec/fixtures/objects/amf0-number.bin +0 -0
- data/spec/fixtures/objects/amf0-object.bin +0 -0
- data/spec/fixtures/objects/amf0-ref-test.bin +0 -0
- data/spec/fixtures/objects/amf0-strict-array.bin +0 -0
- data/spec/fixtures/objects/amf0-string.bin +0 -0
- data/spec/fixtures/objects/amf0-typed-object.bin +0 -0
- data/spec/fixtures/objects/amf0-undefined.bin +0 -1
- data/spec/fixtures/objects/amf0-untyped-object.bin +0 -0
- data/spec/fixtures/objects/amf3-0.bin +0 -0
- data/spec/fixtures/objects/amf3-arrayRef.bin +0 -1
- data/spec/fixtures/objects/amf3-bigNum.bin +0 -0
- data/spec/fixtures/objects/amf3-date.bin +0 -0
- data/spec/fixtures/objects/amf3-datesRef.bin +0 -0
- data/spec/fixtures/objects/amf3-dynObject.bin +0 -2
- data/spec/fixtures/objects/amf3-emptyArray.bin +0 -1
- data/spec/fixtures/objects/amf3-emptyArrayRef.bin +0 -1
- data/spec/fixtures/objects/amf3-emptyStringRef.bin +0 -1
- data/spec/fixtures/objects/amf3-false.bin +0 -1
- data/spec/fixtures/objects/amf3-graphMember.bin +0 -0
- data/spec/fixtures/objects/amf3-hash.bin +0 -2
- data/spec/fixtures/objects/amf3-largeMax.bin +0 -0
- data/spec/fixtures/objects/amf3-largeMin.bin +0 -0
- data/spec/fixtures/objects/amf3-max.bin +0 -1
- data/spec/fixtures/objects/amf3-min.bin +0 -0
- data/spec/fixtures/objects/amf3-mixedArray.bin +0 -11
- data/spec/fixtures/objects/amf3-null.bin +0 -1
- data/spec/fixtures/objects/amf3-objRef.bin +0 -0
- data/spec/fixtures/objects/amf3-primArray.bin +0 -1
- data/spec/fixtures/objects/amf3-string.bin +0 -1
- data/spec/fixtures/objects/amf3-stringRef.bin +0 -0
- data/spec/fixtures/objects/amf3-symbol.bin +0 -1
- data/spec/fixtures/objects/amf3-true.bin +0 -1
- data/spec/fixtures/objects/amf3-typedObject.bin +0 -2
- data/spec/fixtures/request/acknowledge-response.bin +0 -0
- data/spec/fixtures/request/amf0-error-response.bin +0 -0
- data/spec/fixtures/request/commandMessage.bin +0 -0
- data/spec/fixtures/request/remotingMessage.bin +0 -0
- data/spec/fixtures/request/simple-response.bin +0 -0
- data/spec/rack/request_spec.rb +0 -6
- data/spec/rack/response_spec.rb +0 -47
data/README.rdoc
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
== DESCRIPTION:
|
2
2
|
|
3
|
-
A full featured AMF gateway implemented as a Rack middleware. Includes
|
3
|
+
A full featured AMF gateway implemented as a Rack middleware. Includes a service
|
4
|
+
handler mode that simplifies service mappings, as well as a mode that simply
|
5
|
+
processes requests and lets you handle the response how you want.
|
4
6
|
|
5
7
|
== INSTALL:
|
6
8
|
|
@@ -12,28 +14,35 @@ config.ru:
|
|
12
14
|
|
13
15
|
require 'rack/amf'
|
14
16
|
use Rack::AMF
|
15
|
-
|
17
|
+
|
18
|
+
class User
|
19
|
+
attr_accessor :username
|
20
|
+
end
|
21
|
+
|
16
22
|
class TestService
|
17
23
|
def sayHello
|
18
24
|
'Hello'
|
19
25
|
end
|
26
|
+
|
27
|
+
def getUser
|
28
|
+
u = User.new
|
29
|
+
u.username = "user"
|
30
|
+
u
|
31
|
+
end
|
20
32
|
end
|
21
33
|
|
22
34
|
Rack::AMF::Environment.register_service 'TestService', TestService.new
|
35
|
+
RocketAMF::ClassMapper.define do |m|
|
36
|
+
m.map :as => 'User', :ruby => 'User'
|
37
|
+
end
|
23
38
|
|
24
39
|
run lambda {|env| [200, { 'Content-Type' => 'text/plain', 'Content-Length' => '16' }, ["Rack AMF gateway"] ] }
|
25
40
|
|
26
|
-
== TODO:
|
27
|
-
|
28
|
-
* Write some Rails helpers so that using Rack AMF as a Rails Metal is easy.
|
29
|
-
* Support ActiveRecord serialization/deserialization
|
30
|
-
* Auto-map to Rails controllers
|
31
|
-
|
32
41
|
== LICENSE:
|
33
42
|
|
34
43
|
(The MIT License)
|
35
44
|
|
36
|
-
Copyright (c)
|
45
|
+
Copyright (c) 2010 Stephen Augenstein
|
37
46
|
|
38
47
|
Permission is hereby granted, free of charge, to any person obtaining
|
39
48
|
a copy of this software and associated documentation files (the
|
data/Rakefile
CHANGED
@@ -2,53 +2,38 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'rake/rdoctask'
|
4
4
|
require 'rake/gempackagetask'
|
5
|
-
|
6
5
|
require 'spec/rake/spectask'
|
7
6
|
|
8
|
-
desc 'Default: run the specs.'
|
9
|
-
task :default => :spec
|
10
|
-
|
11
|
-
Spec::Rake::SpecTask.new do |t|
|
12
|
-
t.spec_opts = ['--options', 'spec/spec.opts']
|
13
|
-
end
|
14
|
-
|
15
|
-
desc 'Generate documentation for the rubyamf plugin.'
|
16
|
-
Rake::RDocTask.new(:rdoc) do |rdoc|
|
17
|
-
rdoc.rdoc_dir = 'rdoc'
|
18
|
-
rdoc.title = 'Rack AMF'
|
19
|
-
rdoc.options << '--line-numbers' << '--main' << 'README.rdoc'
|
20
|
-
rdoc.rdoc_files.include('README.rdoc')
|
21
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
22
|
-
end
|
23
|
-
|
24
7
|
spec = Gem::Specification.new do |s|
|
25
|
-
s.name
|
26
|
-
s.version
|
27
|
-
s.summary
|
8
|
+
s.name = 'rack-amf'
|
9
|
+
s.version = '1.0.0'
|
10
|
+
s.summary = 'AMF gateway packaged as a rack middleware'
|
11
|
+
s.authors = ['Stephen Augenstein']
|
12
|
+
s.email = 'perl.programmer@gmail.com'
|
13
|
+
s.homepage = 'http://github.com/warhammerkid/rack-amf'
|
28
14
|
|
29
|
-
s.
|
30
|
-
s.
|
15
|
+
s.platform = Gem::Platform::RUBY
|
16
|
+
s.rdoc_options << '--line-numbers' << '--main' << 'README.rdoc'
|
17
|
+
s.rdoc_options += FileList['README.rdoc']
|
18
|
+
s.files = FileList['README.rdoc', 'Rakefile', 'lib/**/*.rb', 'spec/**/*.{rb,opts}']
|
31
19
|
s.test_files = Dir[*['spec/**/*_spec.rb']]
|
32
20
|
|
33
|
-
s.
|
34
|
-
|
35
|
-
s.rdoc_options = ['--line-numbers', '--main', 'README.rdoc']
|
21
|
+
s.add_dependency('RocketAMF')
|
22
|
+
end
|
36
23
|
|
37
|
-
|
38
|
-
|
39
|
-
s.homepage = 'http://github.com/warhammerkid/rack-amf'
|
24
|
+
desc 'Default: Run the specs'
|
25
|
+
task :default => :spec
|
40
26
|
|
41
|
-
|
42
|
-
end
|
27
|
+
Rake::GemPackageTask.new(spec).define
|
43
28
|
|
44
|
-
|
45
|
-
|
46
|
-
|
29
|
+
desc "Generate documentation"
|
30
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
31
|
+
rdoc.rdoc_dir = 'rdoc'
|
32
|
+
rdoc.title = 'rack-amf'
|
33
|
+
rdoc.options = spec.rdoc_options
|
34
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
47
35
|
end
|
48
36
|
|
49
|
-
|
50
|
-
|
51
|
-
File.open("#{spec.name}.gemspec", 'w') do |f|
|
52
|
-
f.write spec.to_ruby
|
53
|
-
end
|
37
|
+
Spec::Rake::SpecTask.new do |t|
|
38
|
+
t.spec_opts = ['--options', 'spec/spec.opts']
|
54
39
|
end
|
data/lib/rack/amf/environment.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
module Rack::AMF
|
2
|
+
# Manages services if using the ServiceManager middleware, as well as the url
|
3
|
+
# to restrict AMF requests to, and the mode. The URL and mode are automatically
|
4
|
+
# set when you call <code>use Rack::AMF, options</code> in your rack
|
5
|
+
# application.
|
2
6
|
module Environment
|
3
7
|
class << self
|
4
|
-
attr_accessor :url, :mode, :
|
5
|
-
debug = false # Set to off by default
|
8
|
+
attr_accessor :url, :mode, :services
|
6
9
|
|
7
10
|
# Used to register a service for use with the ServiceManager middleware.
|
8
11
|
# To register a service, simply pass in the root path for the service and
|
@@ -21,14 +24,8 @@ module Rack::AMF
|
|
21
24
|
# in through rack
|
22
25
|
def populate options={} #:nodoc:
|
23
26
|
url = options[:url] if options.key?(:url)
|
24
|
-
debug = options[:debug] if options.key?(:debug)
|
25
27
|
mode = options[:mode] if options.key?(:mode)
|
26
28
|
end
|
27
|
-
|
28
|
-
def log data #:nodoc:
|
29
|
-
return if !debug
|
30
|
-
puts data
|
31
|
-
end
|
32
29
|
end
|
33
30
|
end
|
34
31
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
require 'rack/amf/middleware'
|
2
2
|
|
3
3
|
module Rack::AMF::Middleware #:nodoc:
|
4
|
-
# Middleware which simply passes AMF requests through.
|
5
|
-
# to
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Middleware which simply passes AMF requests through. If the request is a
|
5
|
+
# valid AMF request to be handled, sets <tt>env ['rack-amf.request']</tt> to
|
6
|
+
# an initialized RocketAMF::Request object and <tt>env ['rack-amf.response']</tt>
|
7
|
+
# to a RocketAMF::Response object. Simply modify the response as necessary
|
8
|
+
# and it will be automatically serialized and sent.
|
8
9
|
class PassThrough
|
9
10
|
include Rack::AMF::Middleware
|
10
11
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'rack/amf/middleware'
|
2
|
+
require 'logger'
|
2
3
|
|
3
4
|
module Rack::AMF::Middleware #:nodoc:
|
4
5
|
# Internal AMF handler, it uses the ServiceManager to handle request service
|
@@ -12,13 +13,17 @@ module Rack::AMF::Middleware #:nodoc:
|
|
12
13
|
end
|
13
14
|
|
14
15
|
def handle env
|
15
|
-
env['rack-amf.
|
16
|
-
|
16
|
+
req = env['rack-amf.request']
|
17
|
+
res = env['rack-amf.response']
|
18
|
+
|
19
|
+
logger = ::Logger.new(env['rack.errors'])
|
20
|
+
res.each_method_call req do |method, args|
|
21
|
+
handle_method method, args, logger
|
17
22
|
end
|
18
23
|
end
|
19
24
|
|
20
25
|
private
|
21
|
-
def handle_method method, args
|
26
|
+
def handle_method method, args, logger = nil
|
22
27
|
path = method.split('.')
|
23
28
|
method_name = path.pop
|
24
29
|
path = path.join('.')
|
@@ -26,11 +31,14 @@ module Rack::AMF::Middleware #:nodoc:
|
|
26
31
|
s = Rack::AMF::Environment.services
|
27
32
|
if s[path]
|
28
33
|
if s[path].respond_to?(method_name)
|
34
|
+
logger.info("Handling call to #{path}##{method_name}") if logger
|
29
35
|
s[path].send(method_name, *args)
|
30
36
|
else
|
37
|
+
logger.error("Service #{path} does not respond to #{method_name}") if logger
|
31
38
|
raise "Service #{path} does not respond to #{method_name}"
|
32
39
|
end
|
33
40
|
else
|
41
|
+
logger.error("Service #{path} does not respond to #{method_name}") if logger
|
34
42
|
raise "Service #{path} does not exist"
|
35
43
|
end
|
36
44
|
end
|
data/lib/rack/amf/middleware.rb
CHANGED
@@ -14,7 +14,8 @@ module Rack::AMF
|
|
14
14
|
return @app.call(env) unless should_handle?(env)
|
15
15
|
|
16
16
|
# Wrap request and response
|
17
|
-
env['rack
|
17
|
+
env['rack.input'].rewind
|
18
|
+
env['rack-amf.request'] = Request.new.populate_from_stream(env['rack.input'].read)
|
18
19
|
env['rack-amf.response'] = Response.new(env['rack-amf.request'])
|
19
20
|
|
20
21
|
# Call handle on "inheriting" class
|
data/lib/rack/amf/request.rb
CHANGED
@@ -1,21 +1,8 @@
|
|
1
1
|
module Rack::AMF
|
2
|
-
|
3
|
-
class Request
|
4
|
-
attr_reader :raw_request
|
5
|
-
|
6
|
-
def initialize env
|
7
|
-
env['rack.input'].rewind
|
8
|
-
@raw_request = ::AMF::Request.new.populate_from_stream(env['rack.input'].read)
|
9
|
-
end
|
10
|
-
|
11
|
-
# Returns the request AMF version
|
2
|
+
class Request < RocketAMF::Request #:nodoc:
|
12
3
|
def version
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
# Returns all messages in the request
|
17
|
-
def messages
|
18
|
-
@raw_request.messages
|
4
|
+
$stderr.puts("DEPRECATION WARNING: use amf_version instead of version")
|
5
|
+
amf_version
|
19
6
|
end
|
20
7
|
end
|
21
8
|
end
|
data/lib/rack/amf/response.rb
CHANGED
@@ -1,77 +1,18 @@
|
|
1
1
|
module Rack::AMF
|
2
|
-
|
3
|
-
class Response
|
4
|
-
attr_reader :raw_response
|
5
|
-
|
6
|
-
V = ::AMF::Values
|
7
|
-
|
2
|
+
class Response < RocketAMF::Response #:nodoc:
|
8
3
|
def initialize request
|
9
4
|
@request = request
|
10
|
-
|
11
|
-
@raw_response.amf_version = @request.version == 3 ? 3 : 0 # Can't just copy version because FMS sends version as 1
|
5
|
+
super()
|
12
6
|
end
|
13
7
|
|
14
8
|
# Builds response, iterating over each method call and using the return value
|
15
9
|
# as the method call's return value
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
def each_method_call &block
|
23
|
-
raise 'Response already constructed' if @constructed
|
24
|
-
|
25
|
-
@request.messages.each do |m|
|
26
|
-
# What's the request body?
|
27
|
-
case m.data
|
28
|
-
when V::CommandMessage
|
29
|
-
# Pings should be responded to with an AcknowledgeMessage built using the ping
|
30
|
-
# Everything else is unsupported
|
31
|
-
command_msg = m.data
|
32
|
-
if command_msg.operation == V::CommandMessage::CLIENT_PING_OPERATION
|
33
|
-
response_value = V::AcknowledgeMessage.new(command_msg)
|
34
|
-
else
|
35
|
-
response_value = V::ErrorMessage.new(Exception.new("CommandMessage #{command_msg.operation} not implemented"), command_msg)
|
36
|
-
end
|
37
|
-
when V::RemotingMessage
|
38
|
-
# Using RemoteObject style message calls
|
39
|
-
remoting_msg = m.data
|
40
|
-
acknowledge_msg = V::AcknowledgeMessage.new(remoting_msg)
|
41
|
-
body = dispatch_call :method => remoting_msg.source+'.'+remoting_msg.operation, :args => remoting_msg.body, :source => remoting_msg, :block => block
|
42
|
-
|
43
|
-
# Response should be the bare ErrorMessage if there was an error
|
44
|
-
if body.is_a?(V::ErrorMessage)
|
45
|
-
response_value = body
|
46
|
-
else
|
47
|
-
acknowledge_msg.body = body
|
48
|
-
response_value = acknowledge_msg
|
49
|
-
end
|
50
|
-
else
|
51
|
-
# Standard response message
|
52
|
-
response_value = dispatch_call :method => m.target_uri, :args => m.data, :source => m, :block => block
|
53
|
-
end
|
54
|
-
|
55
|
-
target_uri = m.response_uri
|
56
|
-
target_uri += response_value.is_a?(V::ErrorMessage) ? '/onStatus' : '/onResult'
|
57
|
-
@raw_response.messages << ::AMF::Message.new(target_uri, '', response_value)
|
58
|
-
end
|
59
|
-
|
60
|
-
@constructed = true
|
61
|
-
end
|
62
|
-
|
63
|
-
# Return the serialized response as a string
|
64
|
-
def to_s
|
65
|
-
raw_response.serialize
|
66
|
-
end
|
67
|
-
|
68
|
-
private
|
69
|
-
def dispatch_call p
|
70
|
-
begin
|
71
|
-
p[:block].call(p[:method], p[:args])
|
72
|
-
rescue Exception => e
|
73
|
-
# Create ErrorMessage object using the source message as the base
|
74
|
-
V::ErrorMessage.new(p[:source], e)
|
10
|
+
def each_method_call *args, &block
|
11
|
+
if args.length == 0
|
12
|
+
$stderr.puts("DEPRECATION WARNING: Use each_method_call request, &block instead of each_method_call &block")
|
13
|
+
super(@request, &block)
|
14
|
+
else
|
15
|
+
super(*args, &block)
|
75
16
|
end
|
76
17
|
end
|
77
18
|
end
|
data/lib/rack/amf.rb
CHANGED
@@ -1,7 +1,35 @@
|
|
1
|
+
require 'rubygems'
|
1
2
|
require 'rack'
|
2
|
-
require '
|
3
|
+
require 'rocketamf'
|
4
|
+
|
3
5
|
require 'rack/amf/environment'
|
4
6
|
|
7
|
+
module Rack #:nodoc:
|
8
|
+
end
|
9
|
+
|
10
|
+
# Simple rack middleware that processes amf requests as a standard AMF gateway.
|
11
|
+
# To use, simply run <tt>use Rack::AMF</tt> in your rackup script. rack-amf
|
12
|
+
# support two options: <tt>:url</tt> and <tt>:mode</tt>. Setting the url makes
|
13
|
+
# rack-amf only handle AMF requests that match the given url. The mode can
|
14
|
+
# either by <tt>:service_manager</tt> or <tt>:pass_through</tt>, defaulting to
|
15
|
+
# <tt>:service_manager</tt>.
|
16
|
+
#
|
17
|
+
# In pass-through mode, rack-amf will set <tt>env ["rack-amf.request"]</tt> and
|
18
|
+
# <tt>env ["rack-amf.response"]</tt>. See <tt>Rack::AMF::Middleware::PassThrough</tt>
|
19
|
+
# for more information.
|
20
|
+
#
|
21
|
+
# In service-manager mode, you can register a given object to handle all method
|
22
|
+
# calls for a given path. AMF calls to "TestService.sayHello" will call the
|
23
|
+
# object's <tt>sayHello</tt> method and return "Hello".
|
24
|
+
#
|
25
|
+
# Example:
|
26
|
+
# use Rack::AMF :url => "/amf"
|
27
|
+
# class TestService
|
28
|
+
# def sayHello
|
29
|
+
# 'Hello'
|
30
|
+
# end
|
31
|
+
# end
|
32
|
+
# Rack::AMF::Environment.register_service 'TestService', TestService.new
|
5
33
|
module Rack::AMF
|
6
34
|
def self.new app, options={} #:nodoc:
|
7
35
|
# Set default mode
|
@@ -18,4 +46,16 @@ module Rack::AMF
|
|
18
46
|
raise "Invalide mode: #{options[:mode]}"
|
19
47
|
end
|
20
48
|
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# For compatibility
|
52
|
+
module AMF #:nodoc:
|
53
|
+
def self.const_missing const
|
54
|
+
if const == :ClassMapper
|
55
|
+
$stderr.puts("DEPRECATION WARNING: Please use RocketAMF::ClassMapper instead of AMF::ClassMapper")
|
56
|
+
AMF.const_set(:ClassMapper, RocketAMF::ClassMapper)
|
57
|
+
else
|
58
|
+
super(const)
|
59
|
+
end
|
60
|
+
end
|
21
61
|
end
|
data/spec/spec.opts
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
--colour
|
1
|
+
--colour
|
2
|
+
-f nested
|
data/spec/spec_helper.rb
CHANGED
@@ -8,27 +8,4 @@ end
|
|
8
8
|
require 'spec/autorun'
|
9
9
|
|
10
10
|
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
11
|
-
require 'amf'
|
12
|
-
|
13
|
-
def request_fixture(binary_path)
|
14
|
-
File.open(File.dirname(__FILE__) + '/fixtures/request/' + binary_path).read
|
15
|
-
end
|
16
|
-
|
17
|
-
def object_fixture(binary_path)
|
18
|
-
File.open(File.dirname(__FILE__) + '/fixtures/objects/' + binary_path).read
|
19
|
-
end
|
20
|
-
|
21
|
-
def create_rack_request(binary_path)
|
22
|
-
require 'rack/amf/request'
|
23
|
-
env = {'rack.input' => StringIO.new(request_fixture(binary_path))}
|
24
|
-
Rack::AMF::Request.new(env)
|
25
|
-
end
|
26
|
-
|
27
|
-
# Add reset support to ClassMapping
|
28
|
-
module AMF
|
29
|
-
class ClassMapping
|
30
|
-
def reset
|
31
|
-
@mappings = nil
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
11
|
+
require 'rack/amf'
|
metadata
CHANGED
@@ -1,43 +1,38 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-amf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Tony Hillerson
|
8
7
|
- Stephen Augenstein
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
11
|
|
13
|
-
date:
|
12
|
+
date: 2010-03-20 00:00:00 -04:00
|
14
13
|
default_executable:
|
15
|
-
dependencies:
|
16
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: RocketAMF
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
17
25
|
description:
|
18
26
|
email: perl.programmer@gmail.com
|
19
27
|
executables: []
|
20
28
|
|
21
29
|
extensions: []
|
22
30
|
|
23
|
-
extra_rdoc_files:
|
24
|
-
|
31
|
+
extra_rdoc_files: []
|
32
|
+
|
25
33
|
files:
|
26
34
|
- README.rdoc
|
27
35
|
- Rakefile
|
28
|
-
- lib/amf/class_mapping.rb
|
29
|
-
- lib/amf/common.rb
|
30
|
-
- lib/amf/constants.rb
|
31
|
-
- lib/amf/pure/deserializer.rb
|
32
|
-
- lib/amf/pure/io_helpers.rb
|
33
|
-
- lib/amf/pure/remoting.rb
|
34
|
-
- lib/amf/pure/serializer.rb
|
35
|
-
- lib/amf/pure.rb
|
36
|
-
- lib/amf/values/array_collection.rb
|
37
|
-
- lib/amf/values/messages.rb
|
38
|
-
- lib/amf/values/typed_hash.rb
|
39
|
-
- lib/amf/version.rb
|
40
|
-
- lib/amf.rb
|
41
36
|
- lib/rack/amf/environment.rb
|
42
37
|
- lib/rack/amf/middleware/pass_through.rb
|
43
38
|
- lib/rack/amf/middleware/service_manager.rb
|
@@ -45,60 +40,8 @@ files:
|
|
45
40
|
- lib/rack/amf/request.rb
|
46
41
|
- lib/rack/amf/response.rb
|
47
42
|
- lib/rack/amf.rb
|
48
|
-
- spec/
|
49
|
-
- spec/amf/class_mapping_spec.rb
|
50
|
-
- spec/amf/deserializer_spec.rb
|
51
|
-
- spec/amf/remoting_spec.rb
|
52
|
-
- spec/amf/serializer_spec.rb
|
53
|
-
- spec/amf/values/array_collection_spec.rb
|
54
|
-
- spec/amf/values/messages_spec.rb
|
55
|
-
- spec/rack/request_spec.rb
|
56
|
-
- spec/rack/response_spec.rb
|
57
|
-
- spec/rack/service_manager_spec.rb
|
43
|
+
- spec/service_manager_spec.rb
|
58
44
|
- spec/spec_helper.rb
|
59
|
-
- spec/fixtures/objects/amf0-boolean.bin
|
60
|
-
- spec/fixtures/objects/amf0-date.bin
|
61
|
-
- spec/fixtures/objects/amf0-ecma-ordinal-array.bin
|
62
|
-
- spec/fixtures/objects/amf0-hash.bin
|
63
|
-
- spec/fixtures/objects/amf0-null.bin
|
64
|
-
- spec/fixtures/objects/amf0-number.bin
|
65
|
-
- spec/fixtures/objects/amf0-object.bin
|
66
|
-
- spec/fixtures/objects/amf0-ref-test.bin
|
67
|
-
- spec/fixtures/objects/amf0-strict-array.bin
|
68
|
-
- spec/fixtures/objects/amf0-string.bin
|
69
|
-
- spec/fixtures/objects/amf0-typed-object.bin
|
70
|
-
- spec/fixtures/objects/amf0-undefined.bin
|
71
|
-
- spec/fixtures/objects/amf0-untyped-object.bin
|
72
|
-
- spec/fixtures/objects/amf3-0.bin
|
73
|
-
- spec/fixtures/objects/amf3-arrayRef.bin
|
74
|
-
- spec/fixtures/objects/amf3-bigNum.bin
|
75
|
-
- spec/fixtures/objects/amf3-date.bin
|
76
|
-
- spec/fixtures/objects/amf3-datesRef.bin
|
77
|
-
- spec/fixtures/objects/amf3-dynObject.bin
|
78
|
-
- spec/fixtures/objects/amf3-emptyArray.bin
|
79
|
-
- spec/fixtures/objects/amf3-emptyArrayRef.bin
|
80
|
-
- spec/fixtures/objects/amf3-emptyStringRef.bin
|
81
|
-
- spec/fixtures/objects/amf3-false.bin
|
82
|
-
- spec/fixtures/objects/amf3-graphMember.bin
|
83
|
-
- spec/fixtures/objects/amf3-hash.bin
|
84
|
-
- spec/fixtures/objects/amf3-largeMax.bin
|
85
|
-
- spec/fixtures/objects/amf3-largeMin.bin
|
86
|
-
- spec/fixtures/objects/amf3-max.bin
|
87
|
-
- spec/fixtures/objects/amf3-min.bin
|
88
|
-
- spec/fixtures/objects/amf3-mixedArray.bin
|
89
|
-
- spec/fixtures/objects/amf3-null.bin
|
90
|
-
- spec/fixtures/objects/amf3-objRef.bin
|
91
|
-
- spec/fixtures/objects/amf3-primArray.bin
|
92
|
-
- spec/fixtures/objects/amf3-string.bin
|
93
|
-
- spec/fixtures/objects/amf3-stringRef.bin
|
94
|
-
- spec/fixtures/objects/amf3-symbol.bin
|
95
|
-
- spec/fixtures/objects/amf3-true.bin
|
96
|
-
- spec/fixtures/objects/amf3-typedObject.bin
|
97
|
-
- spec/fixtures/request/acknowledge-response.bin
|
98
|
-
- spec/fixtures/request/amf0-error-response.bin
|
99
|
-
- spec/fixtures/request/commandMessage.bin
|
100
|
-
- spec/fixtures/request/remotingMessage.bin
|
101
|
-
- spec/fixtures/request/simple-response.bin
|
102
45
|
- spec/spec.opts
|
103
46
|
has_rdoc: true
|
104
47
|
homepage: http://github.com/warhammerkid/rack-amf
|
@@ -109,6 +52,7 @@ rdoc_options:
|
|
109
52
|
- --line-numbers
|
110
53
|
- --main
|
111
54
|
- README.rdoc
|
55
|
+
- README.rdoc
|
112
56
|
require_paths:
|
113
57
|
- lib
|
114
58
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -129,15 +73,6 @@ rubyforge_project:
|
|
129
73
|
rubygems_version: 1.3.5
|
130
74
|
signing_key:
|
131
75
|
specification_version: 3
|
132
|
-
summary: AMF
|
76
|
+
summary: AMF gateway packaged as a rack middleware
|
133
77
|
test_files:
|
134
|
-
- spec/
|
135
|
-
- spec/amf/class_mapping_spec.rb
|
136
|
-
- spec/amf/deserializer_spec.rb
|
137
|
-
- spec/amf/remoting_spec.rb
|
138
|
-
- spec/amf/serializer_spec.rb
|
139
|
-
- spec/amf/values/array_collection_spec.rb
|
140
|
-
- spec/amf/values/messages_spec.rb
|
141
|
-
- spec/rack/request_spec.rb
|
142
|
-
- spec/rack/response_spec.rb
|
143
|
-
- spec/rack/service_manager_spec.rb
|
78
|
+
- spec/service_manager_spec.rb
|