Commit Graph

357 Commits

Author SHA1 Message Date
Kevin Clark
d6b7182df5 THRIFT-246. rb: Generate #struct_fields rather than reflect.
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731806 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 01:34:28 +00:00
Kevin Clark
41baeaba96 THRIFT-157. rb: Quote strings and qualify class names properly
Author: Dave Engberg


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731763 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 23:10:17 +00:00
Kevin Clark
bcb4cf83e5 THRFIT-231. rb: Make Thrift::Structs hashable
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731760 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 23:00:22 +00:00
Kevin Clark
083c07a265 rb: Thrift.check_type should check struct classes [THRIFT-185]
Author: Piotr Kozikowski


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@726156 13f79535-47bb-0310-9956-ffa450edef68
2008-12-13 02:39:20 +00:00
David Reiss
8c28df2569 Fix "make distclean" when Ruby is not in use
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719379 13f79535-47bb-0310-9956-ffa450edef68
2008-11-20 21:24:18 +00:00
Kevin Clark
1d5a1f6500 rb: Remove extra validate in read [THRIFT-207]
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719126 13f79535-47bb-0310-9956-ffa450edef68
2008-11-19 23:24:12 +00:00
Kevin Clark
031baf7086 Merge branch 'THRIFT-143'
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@714070 13f79535-47bb-0310-9956-ffa450edef68
2008-11-14 17:11:39 +00:00
Kevin Clark
713623bee6 rb: Validate struct _after_ read. [THRIFT-206]
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@714069 13f79535-47bb-0310-9956-ffa450edef68
2008-11-14 17:09:52 +00:00
Kevin Clark
159383f789 rb: raise if an object is serialized without required fields [THRIFT-143]
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@712945 13f79535-47bb-0310-9956-ffa450edef68
2008-11-11 05:46:04 +00:00
Kevin Clark
762e9bd15f rb: Performance tweaks in Struct#initialize [THRIFT-188]
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@709313 13f79535-47bb-0310-9956-ffa450edef68
2008-10-31 00:39:20 +00:00
Kevin Clark
7dc7f75e7c rb: Create constants for field ids in generated structs [THRIFT-165]
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@705330 13f79535-47bb-0310-9956-ffa450edef68
2008-10-16 19:15:20 +00:00
Kevin Clark
6ca3881f51 rb: Update HTTPClientSpec for THRIFT-156
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@705329 13f79535-47bb-0310-9956-ffa450edef68
2008-10-16 19:14:47 +00:00
Kevin Clark
c248560897 rb: Support SSL and correct Content-Type in HTTPClient [THRIFT-156]
Author: Dave Engberg


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@704994 13f79535-47bb-0310-9956-ffa450edef68
2008-10-15 19:06:18 +00:00
Kevin Clark
5ad6d4a7e3 rb: Add pretty inspect, optional field hint for Thrift::Struct
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@689193 13f79535-47bb-0310-9956-ffa450edef68
2008-08-26 20:02:07 +00:00
Kevin Clark
969c04b912 rb: Add FramedTransport#borrow/consume! [THRIFT-117]
This addition makes FramedTransport BinaryProtocolAccelerated ready.

Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@688901 13f79535-47bb-0310-9956-ffa450edef68
2008-08-25 22:16:45 +00:00
Kevin Clark
38a2ce635d rb: Speed up Struct#initialize for optional fields [THRFIT-112]
Struct#initialize previously walked over every field and checked for
default values before assigning nil. The new approach assigns defaults
only to fields that have defaults, and lets Ruby handle nil ivars.

Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@688891 13f79535-47bb-0310-9956-ffa450edef68
2008-08-25 21:34:19 +00:00
Kevin Clark
14fe791ef3 Merge branch 'THRIFT-103'
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@682458 13f79535-47bb-0310-9956-ffa450edef68
2008-08-04 18:46:19 +00:00
Kevin Clark
a2693c135e rb: Check container elements when Thrift.type_checking = true [THRIFT-104]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@681863 13f79535-47bb-0310-9956-ffa450edef68
2008-08-01 22:04:09 +00:00
Kevin Clark
3af9287a74 rb: Support raise Xception, message for Structs that inherit from ::Exception [THRIFT-58]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@680542 13f79535-47bb-0310-9956-ffa450edef68
2008-07-28 22:20:36 +00:00
Kevin Clark
c8190174dc rb: Add ext/ to loadpath so BinaryProtocolAccelerated specs pass
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@680539 13f79535-47bb-0310-9956-ffa450edef68
2008-07-28 22:16:34 +00:00
Kevin Clark
5ebb23b3e1 rb: Ensure the transport is closed if an exception is raised serializing data in Client.send_message [THRIFT-75]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@680538 13f79535-47bb-0310-9956-ffa450edef68
2008-07-28 22:16:28 +00:00
David Reiss
0c7d38cf83 rb: Teach BinaryProtocolAccelerated to encode strings with NULs [THRIFT-97]
This patch adds a spec and fixes the behavior to properly treat strings as binary
blobs of data instead of as C strings when writing to the transport.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@679899 13f79535-47bb-0310-9956-ffa450edef68
2008-07-25 21:06:06 +00:00
David Reiss
72754e198f rb: Spec out Thrift::BinaryProtocolAccelerated [THRIFT-90]
Convert most of the BinaryProtocol spec into shared examples and
add specific specs for encode_binary/decode_binary.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@679898 13f79535-47bb-0310-9956-ffa450edef68
2008-07-25 21:06:03 +00:00
David Reiss
3899248d29 rb: BinaryProtocolAccelerated should use Thrift::ProtocolException [THRIFT-89]
BinaryProtocolAccelerated references the deprecated name TProtocolException,
when it should be using Thrift::ProtocolException.
It also uses rb_raise() instead of rb_exc_raise().


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@679897 13f79535-47bb-0310-9956-ffa450edef68
2008-07-25 21:05:59 +00:00
Kevin Clark
f4e700883b rb: Improve IOStreamTransport to behave more like a real transport [THRIFT-76]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@678065 13f79535-47bb-0310-9956-ffa450edef68
2008-07-18 22:27:03 +00:00
Kevin Clark
b586339453 rb: Display field name in type-checking error [THRIFT-78]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@678059 13f79535-47bb-0310-9956-ffa450edef68
2008-07-18 22:03:48 +00:00
Kevin Clark
8d1918be78 rb: Add TProtocolException to the backwards_compatibility_spec [THRIFT-88]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@678055 13f79535-47bb-0310-9956-ffa450edef68
2008-07-18 21:57:07 +00:00
Kevin Clark
5ae0bab247 rb: Add optional timeout argument to Thrift::Socket [THRIFT-74]
Socket.new and UNIXSocket.new both now have a new optional argument: timeout.
There's also a timeout field accessor. This timeout is used when reading or
writing.

Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@678053 13f79535-47bb-0310-9956-ffa450edef68
2008-07-18 21:49:50 +00:00
Kevin Clark
615da24995 rb: Check Thrift.type_checking earlier for a performance boost [THRIFT-55]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@675053 13f79535-47bb-0310-9956-ffa450edef68
2008-07-08 23:30:13 +00:00
Kevin Clark
bf2ff249b9 rb: Buffer the slice!s in MemoryBuffer for a significant performance increase [THRIFT-63]
Author: Kevin Ballard <kevin@rapleaf.com>

Currently it buffers up to 4kB before throwing away the data.
Tests with 1MB shows the exact same performance characteristics.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@675049 13f79535-47bb-0310-9956-ffa450edef68
2008-07-08 23:20:15 +00:00
Kevin Clark
4bd8916b12 Merge branch 'fastbinary'
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@674688 13f79535-47bb-0310-9956-ffa450edef68
2008-07-08 00:47:49 +00:00
Kevin Clark
28744ab833 rb: Ensure the specs that expect deprecation warnings actually get them [THRIFT-56]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671985 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 18:45:29 +00:00
Kevin Clark
f2e4d107af rb: The deprecation stuff should skip thrift library code when showing caller [THRIFT-56]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671984 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 18:45:19 +00:00
Kevin Clark
5da153b36a rb: Add some additional error handling to Thrift::Socket [THRIFT-53]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671979 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 18:35:15 +00:00
Kevin Clark
3387115fa3 rb: Add stubs for rake install/package when Echoe not present [THRIFT-52]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671971 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 18:14:25 +00:00
Kevin Clark
091fa95233 rb: BufferedTransport should flush on close [THRIFT-49]
This also adds code and spec so nothing will be written to the transport
if there's nothing in the write buffer.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671967 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 18:10:56 +00:00
Kevin Clark
2bd3a30b91 rb: Use File.dirname(__FILE__) in generated requires [THRIFT-57]
This means you no longer have to put the gen-rb folder in $:

Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671963 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 17:49:49 +00:00
Kevin Clark
1ce8b3d7d5 rb: When passing unknown keys to Thrift::Struct.new, report those keys in the exception [THRIFT-51]
Author: kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670989 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:32:03 +00:00
Kevin Clark
eaf8d034e7 rb: Delete setup.rb [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670985 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:06:10 +00:00
Kevin Clark
1b8fec10db rb: rewrite the README [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670984 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:06:08 +00:00
Kevin Clark
c5336ff691 rb: Change the license from Thrift Software License to Apache Software License [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670983 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:06:06 +00:00
Kevin Clark
3a9ffbda08 rb: Use Echoe to manage the gem [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670982 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:06:00 +00:00
Kevin Clark
c06b015e22 rb: Reorganize the Rakefile a bit [THRIFT-38]
From kevin@rapleaf.com

Also add a guard to ensure `rake test` is only run if we're in a full thrift checkout


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670981 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:05:57 +00:00
Kevin Clark
cd72befc86 rb: Use defined? JRUBY_VERSION to detect JRuby [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670980 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:05:55 +00:00
Kevin Clark
3836f9ba35 rb: require 'thrift' first in generated service definitions [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670979 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:05:51 +00:00
Kevin Clark
a058d02eda rb: Bugfix for deprecation code [kevin@rapleaf.com][THRIFT-50]
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670976 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 00:33:00 +00:00
Kevin Clark
f731b49b69 rb: Switch NonblockingServer spec from Queue to sleep
Using sleep instead of Queue#pop means the thread is killable under JRuby


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669043 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:25 +00:00
Kevin Clark
f8ecb02ef4 rb: NonblockingServer: Use a select() loop in the acceptor thread
Using a select() loop with a timeout allows the acceptor thread to be shut down
cleanly under JRuby.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669042 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:22 +00:00
Kevin Clark
77b39b3fd8 rb: Set default host for benchmark to 127.0.0.1
MRI resolves localhost to ::1 (on OS X) whereas JRuby resolves it to 127.0.0.1. This means using
MRI for server and JRuby for client doesn't work.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669041 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:16 +00:00
Kevin Clark
f0940220c8 rb: Fix the timeout used for joining threads when calling shutdown(timeout) on NonblockingServer
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669040 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:13 +00:00
Kevin Clark
d8d0d60309 rb: Add hooks for THRIFT_HOST and THRIFT_PORT in the benchmark
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669039 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:10 +00:00
Kevin Clark
4b429ad86e rb: Add control for the number of client processes in the benchmark
You control this with THRIFT_NUM_PROCESSES, the default is 40


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669038 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:06 +00:00
Kevin Clark
e4b780de36 rb: Add debug logger message for processing frames
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669037 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:02 +00:00
Kevin Clark
980e445347 rb: Make a few of the NonblockingServer specs pass under jruby
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669036 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:59 +00:00
Kevin Clark
8c3e0932f2 rb: Fix up the deprecation spec for JRuby
JRuby has different behavior regarding #method_added and #included, so the deprecation spec has to handle this


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669035 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:54 +00:00
Kevin Clark
830f46a382 rb: Fix the binaryprotocol spec to run under jruby
Stop testing for RangeErrors with bignums in i64, that was just an artifact of the MRI interpreter that has different behavior under jruby.
JRuby uses a different Float::MIN/MAX so stop hard-coding the binary representation


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669034 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:51 +00:00
Kevin Clark
fdc9c976f9 rb: Increase the benchmark startup time and add more hooks
You can now control the number of clients per proc and calls per client with THRIFT_NUM_CALLS and THRIFT_NUM_CLIENTS.
You can also instruct the clients to log exceptions with THRIFT_LOG_EXCEPTIONS=yes


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669033 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:46 +00:00
Kevin Clark
e4644f11fa rb: Drop the benchmark worker spawn delay to 0.01
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669032 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:41 +00:00
Kevin Clark
d271979bf2 rb: Catch TransportException errors during the benchmark and report them
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669031 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:37 +00:00
Kevin Clark
1e8f5208e6 rb: flush STDOUT after starting the benchmark server to properly kickstart the benchmark
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669030 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:33 +00:00
Kevin Clark
1a95a1d5ad rb: Give the benchmark server more time to start up
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669029 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:28 +00:00
Kevin Clark
b679131a16 rb: Turn off debug logging in benchmark/thin_server.rb
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669028 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:23 +00:00
Kevin Clark
66038a0afc rb: Fix some incorrect reporting by the benchmark.
Also make it use -J-server when jruby is the server interpreter


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669027 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:18 +00:00
Kevin Clark
75532eee4c rb: Enhance the output of the benchmark
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669026 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:14 +00:00
Kevin Clark
d3cee029c9 rb: split up benchmark into separate server/client files and distinct interpreters
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669025 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:09 +00:00
Kevin Clark
fb5c0eb2b3 rb: Switch from read_nonblock to readpartial to make jruby happy
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669024 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:04 +00:00
Kevin Clark
1aca9c4097 rb: Add spec to ensure UNIXServerSocket deletes the socket when closing
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669023 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:57 +00:00
Kevin Clark
bfb198dae6 rb: Enable logging debug info in benchmark/thin_server.rb
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669022 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:52 +00:00
Kevin Clark
2ddd9d7e2c rb: Tweak the benchmark to allow running the server in a separate process
Add a thin server library that can be run by hand


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669021 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:47 +00:00
Kevin Clark
e1d35fa555 rb: Wrap a semaphore around @serverTransport.close in NonblockingServer.shutdown
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669020 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:41 +00:00
Kevin Clark
2ddd8ed40f rb: Implement Thrift::UNIXSocket and Thrift::UNIXServerSocket
In benchmarking it turns out these don't give any noticeable performance boost,
but as I've already written them, somebody may want them for something.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669019 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:35 +00:00
Kevin Clark
138c0e126f rb: Implement Thrift::Serializer and Thrift::Deserializer
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669018 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:28 +00:00
Kevin Clark
c83d4451b7 rb: Add the path to gen-rb to $: in spec_helper instead of in multiple different specs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669017 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:21 +00:00
Kevin Clark
c3783f4cdb rb: Don't type-check when given a nil value.
Turn on type-checking for all specs


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669016 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:14 +00:00
Kevin Clark
23193757bc rb: Implement type-checking in Thrift::Struct.new and field accessors
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669015 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:07 +00:00
Kevin Clark
140b555bf4 rb: Fix struct_spec to use a proper description
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669014 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:17:57 +00:00
Kevin Clark
2818b09c87 rb: Add helpers for optional type-checking
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669013 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:17:51 +00:00
Kevin Clark
e45bf59417 rb: Completely rewrite Thrift::NonblockingServer
It now has a much better and cleaner architecture, a proper persistent thread pool,
a dedicated acceptor thread, and no concurrency issues


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669012 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:17:44 +00:00
Kevin Clark
3c59aff0b9 rb: Add a hack to prevent fastthread from being loaded when executing specs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669011 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:17:37 +00:00
Kevin Clark
1067425ef7 rb: Enhance non-blocking read in Socket
Also prevent errors when trying to close a @handle twice


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669010 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:17:30 +00:00
Kevin Clark
7fb207f2f9 rb: Remove an unnecessary return statement
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669009 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:17:22 +00:00
Kevin Clark
cb344a3b49 rb: Stop using fastthread, it seems to give no benefit and in fact has a bug
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669008 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:17:14 +00:00
Kevin Clark
ca8a1b3b99 rb: Add benchmarking code for Thrift::NonblockingServer
You can override the server to test with the THRIFT_SERVER env var


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669007 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:17:06 +00:00
Kevin Clark
e4489d3e69 Add synchronization around shared resources in NonblockingServer
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669006 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:58 +00:00
Kevin Clark
2e4f9d61dc rb: Enhance the backwards compatibility spec to ensure that the deprecated method names really do correspond to the new method names
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669005 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:50 +00:00
Kevin Clark
4eea89737a rb: Stop calling rspec_clear in specs (which really should have been rspec_reset), as rspec_verify already resets
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669004 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:42 +00:00
Kevin Clark
75a15d8868 rb: Add thrift/protocol/binaryprotocol to the root lib/thrift file to cut down on client-side requires
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669003 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:35 +00:00
Kevin Clark
1535078231 rb: Add spec for shutting down NonblockingServer in response to a client message
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669002 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:27 +00:00
Kevin Clark
6c4598bbc0 rb: Struct#new should properly initialize boolean values
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669001 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:20 +00:00
Kevin Clark
1d4b2d87f7 rb: Thrift::Socket should return false from #open? if an error occurred during a read/write (THRIFT-7)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669000 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:11 +00:00
Kevin Clark
e0fdddea44 Implement NonblockingServer and add specs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668999 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:02 +00:00
Kevin Clark
90a2cbe0a4 Squelch warning about parens and standardize require for generated code
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668998 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:15:53 +00:00
Kevin Clark
c67587006f Add optional host argument to ServerSocket
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668997 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:15:45 +00:00
Kevin Clark
c78eeef184 Teach Socket how to read_nonblock
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668996 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:15:36 +00:00
Kevin Clark
6c30dbbb92 Add a few accessors and specs to prepare for the upcoming NonblockingServer
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668995 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:15:25 +00:00
Kevin Clark
63eb9979d6 Remove dummy initialize method
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668994 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:15:15 +00:00
Kevin Clark
7019070c92 Rubify Socket and ServerSocket
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668993 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:15:06 +00:00
Kevin Clark
3c4367ae4b Finish rubifying MemoryBuffer and FramedTransport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668992 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:14:57 +00:00
Kevin Clark
5a2d0ad20a Make a lot of miscellaneous ruby-styling changes
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668991 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:14:48 +00:00
Kevin Clark
01a514494d Fix default values of non-primitive types being shared between struct instances (THRIFT-4)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668989 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:14:36 +00:00
Kevin Clark
ec9106f854 Mark failing tests as pending
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668988 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:14:26 +00:00
Kevin Clark
f98286a8e4 Add failing spec for Socket closing when it has an error (THRIFT-7)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668986 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:14:08 +00:00
Kevin Clark
1cfd693f3e Add new spec for properly initializing boolean values
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668985 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:13:58 +00:00
Kevin Clark
a7613dde90 Add new gen-rb task to rebuild the bundled thrift generated code for specs
Also rewrite the test task to properly abort Rake if it fails


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668984 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:13:48 +00:00
Kevin Clark
9479b1a593 Add failing spec for sharing of default values between struct instances (THRIFT-4)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668983 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:13:37 +00:00
Kevin Clark
0d6007c717 Add missing test for ServerSocket
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668982 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:13:27 +00:00
Kevin Clark
fa4a958589 Add two missing tests for FramedTransport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668981 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:13:18 +00:00
Kevin Clark
dfe22b3e2a Stop using Array#pack and test using the raw bytes instead
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668980 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:13:09 +00:00
Kevin Clark
090b69ee63 Add useless struct test for code coverage
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668979 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:12:58 +00:00
Kevin Clark
c13c33bfad Test BinaryProtocol#read_message_header with bad data
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668978 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:12:48 +00:00
Kevin Clark
7b0bc554fa Tweak the code to turn on Deprecation to make rcov happy
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668977 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:12:37 +00:00
Kevin Clark
3f48333ad8 Oops, call #skip instead of #read_type when testing skip
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668976 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:12:26 +00:00
Kevin Clark
eb0dd7fbe4 Add rcov_spec task
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668975 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:12:15 +00:00
Kevin Clark
3c87129dc0 Spec out Socket and ServerSocket
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668974 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:12:05 +00:00
Kevin Clark
da5d34602a Fix exception handling inside Socket#read
Also remove the useless shebang


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668973 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:11:52 +00:00
Kevin Clark
d389f54f0a Strip the rest of the empty () parens
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668972 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:11:41 +00:00
Kevin Clark
150af8b7c6 Stop using deprecated name TSocket and fix TCPserver->TCPServer
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668971 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:11:29 +00:00
Kevin Clark
dd330253ae Spec out HTTPClient
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668970 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:11:18 +00:00
Kevin Clark
f6aa86a506 Spec out MemoryBuffer and IOStreamTransport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668969 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:11:07 +00:00
Kevin Clark
02ef842aa2 Strip more empty parens
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668967 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:10:55 +00:00
Kevin Clark
54d0d91c7e Rip out MemoryBuffer#get_buffer
Nobody should be using that method and it's preventing MemoryBuffer from being optimized wrt. memory usage


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668966 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:10:43 +00:00
Kevin Clark
4c56c2c43f open? should return true, not 1
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668965 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:10:30 +00:00
Kevin Clark
531e020503 Spec out TransportException, Transport, ServerTransport, BufferedTransport, and FramedTransport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668964 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:10:17 +00:00
Kevin Clark
080dd878be Spec out SimpleMongrelHTTPServer
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668963 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:10:05 +00:00
Kevin Clark
1ca1950f9b Stop using deprecated classes in SimpleMongrelHTTPServer
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668962 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:09:53 +00:00
Kevin Clark
03d7a47946 Add specs for Struct.
Include the generated code so the thrift compiler is not required to run the specs.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668961 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:09:41 +00:00
Kevin Clark
41c0a0266b Improve compatibility with the old Hash-style set.
Fix the integration test for the Set change


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668960 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:09:28 +00:00
Kevin Clark
8d79e3f954 Convert fields of type Thrift::Types::SET to use the Set library.
Also teach Thrift::Struct how to compare itself with ==


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668959 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:09:15 +00:00
Kevin Clark
ccc86583a3 Spec out Server
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668958 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:09:00 +00:00
Kevin Clark
8206c1a3c5 Fix blanket exception rescue in ThreadPoolServer
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668957 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:08:47 +00:00
Kevin Clark
76c235bd48 Remove more empty () parens
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668956 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:08:35 +00:00
Kevin Clark
378191a645 Stop range-checking in BinaryProtocol#write_iNN, it turns out to break some code
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668955 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:08:19 +00:00
Kevin Clark
356f861420 Rename spec wrapper classes to prevent cross-pollination of specs. Require rspec 1.1.4 or later to fix the "describe Module do" bug
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668954 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:08:05 +00:00
Kevin Clark
e977a63293 Add spec for BinaryProtocolFactory
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668953 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:07:50 +00:00
Kevin Clark
5ae0384d8f Spec out the BinaryProtocol read methods
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668952 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:07:37 +00:00
Kevin Clark
37d1149f77 Raise a RangeError if Protocol.write_<numeric> is called with a value that doesn't fit in <numeric>
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668951 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:07:23 +00:00
Kevin Clark
f18b643e5e Spec out the BinaryProtocol write methods.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668950 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:07:10 +00:00
Kevin Clark
d6cb444375 Remove dummy initialize method and empty () parens
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668949 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:06:56 +00:00
Kevin Clark
9db1c2e5b5 Finish speccing out Protocol and ProtocolFactory
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668948 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:06:42 +00:00
Kevin Clark
962b8af59d Stop using for _ in _ in Thrift::Protocol
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668947 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:06:29 +00:00
Kevin Clark
dc39973565 Start speccing Protocol.
The Protocol specs exposed a bug in the implementation of skip(Types::STRUCT).
Previously it would call read_struct_end once per field instead of per struct.
This only worked because read_struct_end is a noop.

Also remove all empty parens () from method calls.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668946 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:06:15 +00:00
Kevin Clark
dfaada43ad Spec out ProtocolException
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668945 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:06:01 +00:00
Kevin Clark
4a2b841528 Spec out Thrift::Processor
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668944 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:05:47 +00:00
Kevin Clark
b397bbb6b6 Add pending spec for sequence-ids on Thrift::Client
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668943 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:05:32 +00:00
Kevin Clark
d47cd66f7d Add backwards-compatibility spec
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668942 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:05:17 +00:00
Kevin Clark
0ff9e8c55e Spec out Thrift::Client
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668941 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:05:03 +00:00
Kevin Clark
61387bf284 Fully spec out Thrift::Exception and Thrift::ApplicationException
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668940 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:04:48 +00:00
Kevin Clark
95833c5250 Start speccing exceptions and restore the (message) arg to super in Thrift::ApplicationException
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668939 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:04:34 +00:00
Kevin Clark
5d2e7a9bc6 Fix more deprecated name usages
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668933 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:03:03 +00:00
Kevin Clark
fe897d32f1 Use deprecate_module! where appropriate
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668931 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:02:31 +00:00
Kevin Clark
de7864e7d5 Solve the information leak problem between deprecations. Unfortunately this was caused by a nasty ruby bug.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668930 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:02:14 +00:00
Kevin Clark
fc31164486 Add (currently failing) spec for information leak between deprecations
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668929 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:01:57 +00:00
Kevin Clark
eff97fc042 Use the correct name in deprecation warnings
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668928 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:01:40 +00:00
Kevin Clark
03a5fb1dd7 Implement deprecate_module! and fully spec it
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668927 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:01:25 +00:00
Kevin Clark
2a8a731203 deprecate_class! now sets up a proxy class that logs a warning when used
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668926 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:01:07 +00:00
Kevin Clark
74df0bf429 Finish renaming/deprecating classes. Change a few more filenames, like thrift/transport/ttransport -> thrift/transport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668924 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:00:33 +00:00
Kevin Clark
f5754acff9 Add new spec for deprecate_class!
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668923 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:00:12 +00:00
Kevin Clark
0d45617ec2 Finish up the CamelCase -> ruby_style changes
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668921 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:59:37 +00:00
Kevin Clark
8943788f1f Convert more CamelCase names to ruby_style
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668920 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:59:17 +00:00
Kevin Clark
e12b0f8445 Add comment and convert super(args)->super
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668919 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:58:58 +00:00
Kevin Clark
244b0d9c92 Stop re-defining deprecated methods in subclasses
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668918 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:58:40 +00:00
Kevin Clark
b8a7ad727e Start renaming camelCase methods to ruby_style
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668917 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:58:23 +00:00
Kevin Clark
da40e8d27c Add another spec for deprecate!
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668916 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:58:04 +00:00
Kevin Clark
fc964eed7a Add caller info to the deprecation warning
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668915 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:57:46 +00:00
Kevin Clark
6fda4b76e2 Move thrift/protocol/tprotocol to thrift/protocol and thrift/protocol/tbinaryprotocol to thrift/protocol/binaryprotocol. Leave shim files behind for backwards compatibility
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668914 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:57:26 +00:00
Kevin Clark
c2a07b19ef Make rake run the ruby tests in test/rb as well as the new specs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668913 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:57:06 +00:00
Kevin Clark
f85e793494 Fix up thrift/thrift to only require the the files that define the classes it used to hold. This fixes the existing tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668912 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:56:48 +00:00
Kevin Clark
c42231b6fa Set up the class deprecations
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668911 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:56:30 +00:00
Kevin Clark
96cc516492 Actually turn off deprecation when Thrift::DEPRECATION is false
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668910 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:56:08 +00:00
Kevin Clark
6eaf814fcc Remove requires of 'thrift/thrift' from library files
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668909 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:55:50 +00:00
Kevin Clark
0d1849d882 Add in hook to only provide the deprecated API when the client doesn't require 'thrift' directly
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668908 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:55:29 +00:00
Kevin Clark
5a7103ae5d Add simple Rakefile for running specs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668907 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:55:11 +00:00
Kevin Clark
3eca078597 Re-define the semantics of deprecate! and add deprecate_class! Include full specs for deprecate!/deprecate_class!
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668906 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:54:53 +00:00
Kevin Clark
4c69d3eecf rb: TBinaryProtocol => Thrift::BinaryProtocol
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668905 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:54:33 +00:00
Kevin Clark
2960044415 rb: Add more classes/modules to the Thrift namespace. Provide backwards compatable mappings.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668904 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:54:13 +00:00
Kevin Clark
10cdf10a7b rb: Move client, processor, struct files for consistant naming.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668903 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:53:48 +00:00
Kevin Clark
97d2166a34 rb: Move exceptions, types, processor, client, struct under Thrift module. Add constants for backwards compatability
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668902 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:53:28 +00:00
Kevin Clark
9bf3362ea5 Split out thrift/thrift.rb, add top level thrift.rb in prep for gemmification
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668901 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:53:07 +00:00
Kevin Clark
5e44bce98f rb: Remove extra return statement
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668900 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:52:46 +00:00
Kevin Clark
c669efa48b rb: Add deprecate! method Rename TTransport#readAll/isOpen, and deprecate
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668899 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:52:26 +00:00
Kevin Clark
aaf6e38fce Style tweaks
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668895 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:51:06 +00:00
Kevin Clark
32a1114a64 add simple Ruby HTTP server and client classes
Using Mongrel for the server.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668894 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:50:44 +00:00
Kevin Clark
52f23fa2a8 Clean up Ruby TTransport defs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668893 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:50:24 +00:00
Kevin Clark
a37d90e6cb Add tests for Ruby TTransport. Only require .rb files in ruby tests.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668892 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:50:00 +00:00
Kevin Clark
104584ee7f add additional entrypoint to TThreadPoolServer with easy exception handling
An additional method #serve_rescuable is added, which relays any exceptions
that happen in worker threads to the caller, where they can be handled
directly. 'retry' works too, allowing code like:

  begin
    server.rescuable_serve
  rescue StandardError => e
    puts "got exception: #{e.inspect}"
    ## do something
    retry
  end

The semantics of TThreadPoolServer#serve remain the same.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668891 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:49:38 +00:00
David Reiss
68ccc699a3 Move Ruby fielded object creation from generated constructor to ThriftStruct
Rather than the generated code needing to handle simple fielded
creation of objects, the ThriftStruct module constructor is extended to
handle hash arguments. Statements such as

  o = ThriftObject.new :field1 => value1, :field2 => value2, ...

are supported as before, and the string form,

  o = ThriftObject.new "field1" => value1, "field2" => value2, ...

disabled by the previous patch now also works.

Placing this code in the module is also just a cleaner solution.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665502 13f79535-47bb-0310-9956-ffa450edef68
2008-02-26 06:40:22 +00:00
David Reiss
0c90f6f8af Thrift: Whitespace cleanup.
Summary:
- Expanded tabs to spaces where spaces were the norm.
- Deleted almost all trailing whitespace.
- Added newlines to the ends of a few files.
- Ran dos2unix on one file or two.

Reviewed By: mcslee

Test Plan: git diff -b

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665467 13f79535-47bb-0310-9956-ffa450edef68
2008-02-06 22:18:40 +00:00
David Reiss
e4667378c4 Thrift/Ruby: Bug fix.
Summary:
Some member variables were actually being treated as local variables.

Reviewed By: mcslee

Test Plan: None.

Revert Plan: ok

Other Notes:
Actually reviewed by Kevin Clark.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665462 13f79535-47bb-0310-9956-ffa450edef68
2008-02-06 18:22:39 +00:00
David Reiss
f09b8a01b1 Thrift/Ruby: TSimpleServer closes its listen socket on an uncaught exception.
Submitted by William Morgan.
Approved by Kevin Clark.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665444 13f79535-47bb-0310-9956-ffa450edef68
2008-01-28 20:46:53 +00:00
David Reiss
fe6d1488eb Thrift/Ruby: Remove a debugging message.
Submitted by William Morgan.
Approved by Kevin Clark.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665443 13f79535-47bb-0310-9956-ffa450edef68
2008-01-28 20:46:50 +00:00
David Reiss
41911a5166 Thrift: Better exception handling in Ruby.
Reviewed By: mcslee

Test Plan: None.

Revert Plan: ok

Other Notes:
Submitted by William Morgan.
Approved by Kevin Clark.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665442 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 20:12:26 +00:00
David Reiss
0e87ef7ae7 Thrift: Some sort of Ruby performance fix.
Reviewed By: mcslee

Test Plan: None.

Revert Plan: ok

Other Notes:
Submitted by Dave Simpson.
Approved by Kevin Clark.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665441 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 20:05:50 +00:00
Christopher Piro
a9a4d481e0 [thrift] Ruby TThreadedServer and TThreadPoolServer
Summary: They both use the same handler for all connections and thus assume the handler is thread-safe. The TThreadPoolServer preserves threads, so it wouldn't be too hard to make a variant that used a separate handler for each thread and thus didn't require thread safety.

Reviewed By: mcslee

Test Plan: loads without error

Revert Plan: ok

Other Notes: contributed by William Morgan (w@adap.tv)


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665438 13f79535-47bb-0310-9956-ffa450edef68
2008-01-18 21:35:34 +00:00
Mark Slee
89f5716421 Ruby default values patch
Summary: Submitted by Dan Sully, reviewed by Kevin Clark

Reviewed By: dreiss

Test Plan: New ruby generated code with default vals, and new test scripts


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665418 13f79535-47bb-0310-9956-ffa450edef68
2008-01-10 00:53:08 +00:00
Mark Slee
677ffc5044 Private methods called not via self.
Summary: Because self. puts you in public scope

Reviewed By: mcslee

Test Plan: Use Ruby framed transport

Other Notes: Submitted by Jake Luciani


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665397 13f79535-47bb-0310-9956-ffa450edef68
2007-12-18 02:06:44 +00:00
Mark Slee
3f14d3ebec Merge Ruby framed transport
Summary: Submitted by Jake Luciani

Reviewed By: mcslee

Test Plan: Test code included in this commit


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665385 13f79535-47bb-0310-9956-ffa450edef68
2007-12-05 23:13:11 +00:00
Mark Slee
3e098b1757 Fix handling of ruby write parameters due to nil vs false
Summary: Need to check for != nil, not just boolean expression

Reviewed By: mcslee

Test Plan: Send a boolean "false" value

Other Notes: Patch submitted by Patrick Collison


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665310 13f79535-47bb-0310-9956-ffa450edef68
2007-10-30 16:55:47 +00:00
Mark Slee
58dfb4fbe8 Lots of Ruby code generation improvements
Summary: Submitted by Kevin Clark, Ruby guru from Powerset

Reviewed By: mcslee

Test Plan: He updated the tests in trunk/test/rb/

Notes: The code is now officially "ruby-ish" and idiomatic


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665151 13f79535-47bb-0310-9956-ffa450edef68
2007-07-06 02:45:25 +00:00
Christopher Piro
7ef673345b [thrift] small typo in tserver.rb
Summary: s:procotol:protocol:g


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665149 13f79535-47bb-0310-9956-ffa450edef68
2007-07-02 06:35:10 +00:00
Mark Slee
0e1100c921 Ruby TBinaryProtocol fix
Summary: VERSION_1 | type, not &, wrong binary operator

Reviewed By: binary

Test Plan: TestClient.rb


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665141 13f79535-47bb-0310-9956-ffa450edef68
2007-06-23 00:08:13 +00:00