mack-notifier 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gems.rb +13 -0
- data/lib/gems/tmail-1.2.3.1/ext/Makefile +20 -0
- data/lib/gems/tmail-1.2.3.1/ext/tmailscanner/tmail/MANIFEST +4 -0
- data/lib/gems/tmail-1.2.3.1/ext/tmailscanner/tmail/depend +1 -0
- data/lib/gems/tmail-1.2.3.1/ext/tmailscanner/tmail/extconf.rb +33 -0
- data/lib/gems/tmail-1.2.3.1/ext/tmailscanner/tmail/tmailscanner.c +583 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail.rb +5 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/Makefile +18 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/address.rb +426 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/attachments.rb +46 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/base64.rb +46 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/compat.rb +41 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/config.rb +67 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/core_extensions.rb +63 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/encode.rb +581 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/header.rb +960 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/index.rb +9 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/interface.rb +1125 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/loader.rb +3 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/mail.rb +578 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/mailbox.rb +495 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/main.rb +6 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/mbox.rb +3 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/net.rb +248 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/obsolete.rb +132 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/parser.rb +1476 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/parser.y +381 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/port.rb +379 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/quoting.rb +118 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/require_arch.rb +58 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/scanner.rb +49 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/scanner_r.rb +261 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/stringio.rb +280 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/utils.rb +337 -0
- data/lib/gems/tmail-1.2.3.1/lib/tmail/version.rb +39 -0
- data/lib/gems/tmail-1.2.3.1/meta/MANIFEST +128 -0
- data/lib/gems/tmail-1.2.3.1/meta/VERSION +1 -0
- data/lib/gems/tmail-1.2.3.1/meta/project.yaml +30 -0
- data/lib/gems/tmail-1.2.3.1/meta/unixname +1 -0
- data/lib/gems/validatable-1.6.7/README +118 -0
- data/lib/gems/validatable-1.6.7/lib/child_validation.rb +15 -0
- data/lib/gems/validatable-1.6.7/lib/errors.rb +74 -0
- data/lib/gems/validatable-1.6.7/lib/included_validation.rb +9 -0
- data/lib/gems/validatable-1.6.7/lib/macros.rb +283 -0
- data/lib/gems/validatable-1.6.7/lib/object_extension.rb +21 -0
- data/lib/gems/validatable-1.6.7/lib/requireable.rb +26 -0
- data/lib/gems/validatable-1.6.7/lib/understandable.rb +31 -0
- data/lib/gems/validatable-1.6.7/lib/validatable.rb +19 -0
- data/lib/gems/validatable-1.6.7/lib/validatable_class_methods.rb +85 -0
- data/lib/gems/validatable-1.6.7/lib/validatable_instance_methods.rb +106 -0
- data/lib/gems/validatable-1.6.7/lib/validations/validates_acceptance_of.rb +11 -0
- data/lib/gems/validatable-1.6.7/lib/validations/validates_confirmation_of.rb +15 -0
- data/lib/gems/validatable-1.6.7/lib/validations/validates_each.rb +14 -0
- data/lib/gems/validatable-1.6.7/lib/validations/validates_format_of.rb +13 -0
- data/lib/gems/validatable-1.6.7/lib/validations/validates_length_of.rb +25 -0
- data/lib/gems/validatable-1.6.7/lib/validations/validates_numericality_of.rb +16 -0
- data/lib/gems/validatable-1.6.7/lib/validations/validates_presence_of.rb +13 -0
- data/lib/gems/validatable-1.6.7/lib/validations/validates_true_for.rb +13 -0
- data/lib/gems/validatable-1.6.7/lib/validations/validation_base.rb +88 -0
- data/lib/gems/validatable-1.6.7/rakefile.rb +50 -0
- data/lib/gems/validatable-1.6.7/test/all_tests.rb +1 -0
- data/lib/gems/validatable-1.6.7/test/functional/validatable_test.rb +437 -0
- data/lib/gems/validatable-1.6.7/test/functional/validates_acceptance_of_test.rb +16 -0
- data/lib/gems/validatable-1.6.7/test/functional/validates_confirmation_of_test.rb +56 -0
- data/lib/gems/validatable-1.6.7/test/functional/validates_each_test.rb +14 -0
- data/lib/gems/validatable-1.6.7/test/functional/validates_format_of_test.rb +34 -0
- data/lib/gems/validatable-1.6.7/test/functional/validates_length_of_test.rb +64 -0
- data/lib/gems/validatable-1.6.7/test/functional/validates_numericality_of_test.rb +57 -0
- data/lib/gems/validatable-1.6.7/test/functional/validates_presence_of_test.rb +16 -0
- data/lib/gems/validatable-1.6.7/test/functional/validates_true_for_test.rb +27 -0
- data/lib/gems/validatable-1.6.7/test/test_helper.rb +33 -0
- data/lib/gems/validatable-1.6.7/test/unit/errors_test.rb +64 -0
- data/lib/gems/validatable-1.6.7/test/unit/understandable_test.rb +19 -0
- data/lib/gems/validatable-1.6.7/test/unit/validatable_test.rb +38 -0
- data/lib/gems/validatable-1.6.7/test/unit/validates_acceptance_of_test.rb +21 -0
- data/lib/gems/validatable-1.6.7/test/unit/validates_confirmation_of_test.rb +64 -0
- data/lib/gems/validatable-1.6.7/test/unit/validates_format_of_test.rb +34 -0
- data/lib/gems/validatable-1.6.7/test/unit/validates_length_of_test.rb +75 -0
- data/lib/gems/validatable-1.6.7/test/unit/validates_numericality_of_test.rb +52 -0
- data/lib/gems/validatable-1.6.7/test/unit/validates_presence_of_test.rb +25 -0
- data/lib/gems/validatable-1.6.7/test/unit/validates_true_for_test.rb +29 -0
- data/lib/gems/validatable-1.6.7/test/unit/validation_base_test.rb +52 -0
- data/lib/gems/xmpp4r-0.4/CHANGELOG +83 -0
- data/lib/gems/xmpp4r-0.4/COPYING +340 -0
- data/lib/gems/xmpp4r-0.4/LICENSE +59 -0
- data/lib/gems/xmpp4r-0.4/README.rdoc +110 -0
- data/lib/gems/xmpp4r-0.4/README_ruby19.txt +43 -0
- data/lib/gems/xmpp4r-0.4/Rakefile +262 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/adventure/README +56 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/adventure/adventure.rb +23 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/adventure/adventuremuc.rb +136 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/adventure/cube.xml +15 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/adventure/tower.xml +69 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/adventure/world.rb +424 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/fileserve.conf +11 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/fileserve.rb +346 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/getonline.rb +56 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/gtkmucclient.rb +315 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/migrate.rb +88 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/minimuc.rb +266 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/pep-aggregator/index.xsl +235 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/pep-aggregator/pep-aggregator.rb +147 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/recvfile.rb +84 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/rosterdiscovery.rb +129 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/sendfile.conf +10 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/sendfile.rb +72 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/shellmgr/shellmgr.rb +51 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/shellmgr/shellmgr_jabber.rb +43 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/shellmgr/shellmgr_test.rb +10 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/versionpoll.rb +90 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/xmpping.rb +146 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/xmppingrc.sample +14 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/change_password.rb +41 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/client.rb +70 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/component.rb +11 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/echo.rb +37 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/jabbersend.rb +41 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/mass_sender.rb +68 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/muc_owner_config.rb +12 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/mucinfo.rb +41 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/mucsimplebot.rb +82 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/register.rb +42 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/remove_registration.rb +18 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/roster.rb +44 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/rosterprint.rb +50 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/rosterrename.rb +34 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/rosterwatch.rb +171 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/send_vcard.rb +67 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/tune_client.rb +56 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/tune_server.rb +58 -0
- data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/versionbot.rb +75 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r.rb +116 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/base64.rb +32 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams.rb +15 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/filetransfer.rb +319 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/ibb/base.rb +257 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/ibb/initiator.rb +31 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/ibb/target.rb +47 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/socks5bytestreams/base.rb +152 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/socks5bytestreams/initiator.rb +86 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/socks5bytestreams/server.rb +198 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/socks5bytestreams/socks5.rb +65 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/socks5bytestreams/target.rb +73 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/socks5bytestreams/target.rb.orig +62 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/iq/bytestreams.rb +170 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/iq/si.rb +206 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/callbacks.rb +124 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/caps.rb +1 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/caps/c.rb +53 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/caps/helper/generator.rb +160 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/caps/helper/helper.rb +87 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/client.rb +317 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/command/helper/responder.rb +53 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/command/iq/command.rb +154 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/component.rb +103 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/connection.rb +219 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/dataforms.rb +5 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/dataforms/x/data.rb +297 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/debuglog.rb +42 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/delay.rb +5 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/delay/x/delay.rb +99 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/discovery.rb +7 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/discovery/helper/responder.rb +165 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/discovery/iq/discoinfo.rb +211 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/discovery/iq/discoitems.rb +147 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/errors.rb +281 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/feature_negotiation.rb +5 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/feature_negotiation/iq/feature.rb +28 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/framework/base.rb +55 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/framework/bot.rb +148 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/httpbinding.rb +5 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/httpbinding/client.rb +285 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/idgenerator.rb +37 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/iq.rb +221 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/jid.rb +167 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/message.rb +148 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc.rb +14 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/helper/mucbrowser.rb +92 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/helper/mucclient.rb +462 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/helper/simplemucclient.rb +332 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/iq/mucadmin.rb +23 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/iq/mucadminitem.rb +20 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/iq/mucowner.rb +15 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/item.rb +143 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/x/muc.rb +70 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/x/mucuserinvite.rb +60 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/x/mucuseritem.rb +36 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/presence.rb +232 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub.rb +8 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/configuration.rb +86 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/event.rb +49 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/item.rb +35 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/items.rb +44 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/node_config.rb +48 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/publish.rb +24 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/subscription.rb +62 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/subscription_config.rb +67 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/unsubscribe.rb +48 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/helper/nodebrowser.rb +130 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/helper/nodehelper.rb +156 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/helper/servicehelper.rb +417 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/iq/pubsub.rb +19 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/query.rb +15 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/rexmladdons.rb +151 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/roster.rb +7 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/roster/helper/roster.rb +519 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/roster/iq/roster.rb +215 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/roster/x/roster.rb +138 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/rpc.rb +2 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/rpc/helper/client.rb +123 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/rpc/helper/server.rb +74 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/rpc/helper/xmlrpcaddons.rb +67 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/rpc/iq/rpc.rb +23 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/sasl.rb +237 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/semaphore.rb +38 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/stream.rb +497 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/streamparser.rb +77 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/tune.rb +2 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/tune/helper/helper.rb +58 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/tune/tune.rb +113 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/vcard.rb +6 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/vcard/helper/vcard.rb +84 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/vcard/iq/vcard.rb +109 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/version.rb +7 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/version/helper/responder.rb +72 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/version/helper/simpleresponder.rb +44 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/version/iq/version.rb +105 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/x.rb +37 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/xhtml.rb +1 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/xhtml/html.rb +115 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/xmpp4r.rb +18 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/xmppelement.rb +168 -0
- data/lib/gems/xmpp4r-0.4/lib/xmpp4r/xmppstanza.rb +162 -0
- data/lib/gems/xmpp4r-0.4/setup.rb +1586 -0
- data/lib/gems/xmpp4r-0.4/test/bytestreams/tc_ibb.rb +186 -0
- data/lib/gems/xmpp4r-0.4/test/bytestreams/tc_socks5bytestreams.rb +113 -0
- data/lib/gems/xmpp4r-0.4/test/caps/tc_helper.rb +156 -0
- data/lib/gems/xmpp4r-0.4/test/dataforms/tc_data.rb +81 -0
- data/lib/gems/xmpp4r-0.4/test/delay/tc_xdelay.rb +51 -0
- data/lib/gems/xmpp4r-0.4/test/discovery/tc_responder.rb +91 -0
- data/lib/gems/xmpp4r-0.4/test/lib/assert_equal_xml.rb +14 -0
- data/lib/gems/xmpp4r-0.4/test/lib/clienttester.rb +120 -0
- data/lib/gems/xmpp4r-0.4/test/muc/tc_muc_mucclient.rb +830 -0
- data/lib/gems/xmpp4r-0.4/test/muc/tc_muc_simplemucclient.rb +114 -0
- data/lib/gems/xmpp4r-0.4/test/muc/tc_mucowner.rb +50 -0
- data/lib/gems/xmpp4r-0.4/test/pubsub/tc_helper.rb +662 -0
- data/lib/gems/xmpp4r-0.4/test/pubsub/tc_nodeconfig.rb +54 -0
- data/lib/gems/xmpp4r-0.4/test/pubsub/tc_subscriptionconfig.rb +41 -0
- data/lib/gems/xmpp4r-0.4/test/roster/tc_helper.rb +514 -0
- data/lib/gems/xmpp4r-0.4/test/roster/tc_iqqueryroster.rb +173 -0
- data/lib/gems/xmpp4r-0.4/test/roster/tc_xroster.rb +73 -0
- data/lib/gems/xmpp4r-0.4/test/rpc/tc_helper.rb +96 -0
- data/lib/gems/xmpp4r-0.4/test/tc_callbacks.rb +129 -0
- data/lib/gems/xmpp4r-0.4/test/tc_class_names.rb +146 -0
- data/lib/gems/xmpp4r-0.4/test/tc_client.rb +30 -0
- data/lib/gems/xmpp4r-0.4/test/tc_errors.rb +146 -0
- data/lib/gems/xmpp4r-0.4/test/tc_idgenerator.rb +30 -0
- data/lib/gems/xmpp4r-0.4/test/tc_iq.rb +113 -0
- data/lib/gems/xmpp4r-0.4/test/tc_iqquery.rb +31 -0
- data/lib/gems/xmpp4r-0.4/test/tc_jid.rb +204 -0
- data/lib/gems/xmpp4r-0.4/test/tc_message.rb +116 -0
- data/lib/gems/xmpp4r-0.4/test/tc_presence.rb +150 -0
- data/lib/gems/xmpp4r-0.4/test/tc_rexml.rb +139 -0
- data/lib/gems/xmpp4r-0.4/test/tc_stream.rb +229 -0
- data/lib/gems/xmpp4r-0.4/test/tc_streamComponent.rb +95 -0
- data/lib/gems/xmpp4r-0.4/test/tc_streamError.rb +131 -0
- data/lib/gems/xmpp4r-0.4/test/tc_streamSend.rb +59 -0
- data/lib/gems/xmpp4r-0.4/test/tc_streamparser.rb +112 -0
- data/lib/gems/xmpp4r-0.4/test/tc_xmppstanza.rb +135 -0
- data/lib/gems/xmpp4r-0.4/test/ts_xmpp4r.rb +53 -0
- data/lib/gems/xmpp4r-0.4/test/tune/tc_helper_recv.rb +84 -0
- data/lib/gems/xmpp4r-0.4/test/tune/tc_helper_send.rb +74 -0
- data/lib/gems/xmpp4r-0.4/test/tune/tc_tune.rb +79 -0
- data/lib/gems/xmpp4r-0.4/test/vcard/tc_helper.rb +49 -0
- data/lib/gems/xmpp4r-0.4/test/vcard/tc_iqvcard.rb +62 -0
- data/lib/gems/xmpp4r-0.4/test/version/tc_helper.rb +60 -0
- data/lib/gems/xmpp4r-0.4/test/version/tc_iqqueryversion.rb +97 -0
- data/lib/gems/xmpp4r-0.4/test/xhtml/tc_html.rb +41 -0
- data/lib/gems/xmpp4r-0.4/tools/gen_requires.bash +31 -0
- data/lib/gems/xmpp4r-0.4/tools/xmpp4r-gemspec-test.rb +11 -0
- data/lib/gems/xmpp4r-0.4/xmpp4r.gemspec +291 -0
- data/lib/gems/xmpp4r-simple-0.8.8/CHANGELOG +73 -0
- data/lib/gems/xmpp4r-simple-0.8.8/COPYING +281 -0
- data/lib/gems/xmpp4r-simple-0.8.8/README +59 -0
- data/lib/gems/xmpp4r-simple-0.8.8/lib/xmpp4r-simple.rb +492 -0
- data/lib/gems/xmpp4r-simple-0.8.8/test/test_xmpp4r_simple.rb +242 -0
- data/lib/mack-notifier.rb +1 -3
- metadata +398 -46
@@ -0,0 +1,43 @@
|
|
1
|
+
Ruby 1.9 is a development release in anticipation of Ruby 2.0, which has
|
2
|
+
overall better performance, real threading, and character encoding support.
|
3
|
+
Note: Ruby 1.9 is a development release, meaning that everything is
|
4
|
+
subject to change without prior notice. Among other things, this means
|
5
|
+
that xmpp4r could stop working on Ruby 1.9 at any time.
|
6
|
+
|
7
|
+
This version of xmpp4r has made a number of internal changes (nothing visible
|
8
|
+
at the API) to remove depency on deprecated Ruby Kernel APIs, support the new
|
9
|
+
encoding APIs, etc.
|
10
|
+
|
11
|
+
At the present time, all tests pass except tc_helper.rb and tc_stream.rb.
|
12
|
+
These tests themselves make assumptions about timinings of events,
|
13
|
+
assumptions that are not guaranteed with true multi-tasking. Initial
|
14
|
+
analysis indicates that xmpp4r is operating correctly, it is the tests
|
15
|
+
themselves that need to be corrected, but this could turn out to be
|
16
|
+
incorrect.
|
17
|
+
|
18
|
+
The executing of these two tests are disabled by a check in ts_xmpp4r.rb,
|
19
|
+
which is marked as a TODO.
|
20
|
+
|
21
|
+
A specific example: test_bidi in test/tc_stream.rb defines two threads,
|
22
|
+
one pumps out requests, the other echoes them. The receiver then verifies
|
23
|
+
that it gets back what it sent. With Ruby 1.8, these threads tend to
|
24
|
+
alternate in lock step, and the test usually passes. What happens in Ruby 1.9
|
25
|
+
is that the first thread waits for a message, and the second one creates a
|
26
|
+
callback block, generates a message, and then proceeds on to create a second
|
27
|
+
callback block -- even before the first message has been responded to.
|
28
|
+
The way xmpp4r works is that callbacks are saved on a pushdown stack.
|
29
|
+
|
30
|
+
The net result is that the first response typically is processed first by
|
31
|
+
the second callback, which decides that the ids don't match, and the test fails.
|
32
|
+
|
33
|
+
The way it is supposed to work is that the reply callback is supposed to
|
34
|
+
only process requests destined for it (and return true) and ignore
|
35
|
+
everything else (returning false).
|
36
|
+
|
37
|
+
This is but one test. Many of the tests in these two files are of this
|
38
|
+
nature.
|
39
|
+
|
40
|
+
The current status of the tests that are expected to pass on Ruby 1.9
|
41
|
+
can generally be found here:
|
42
|
+
|
43
|
+
http://intertwingly.net/projects/ruby19/logs/xmpp4r.html
|
@@ -0,0 +1,262 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require "rake/clean"
|
3
|
+
require 'rake/testtask'
|
4
|
+
require 'rake/rdoctask'
|
5
|
+
|
6
|
+
$:.unshift 'lib'
|
7
|
+
require "xmpp4r"
|
8
|
+
|
9
|
+
##############################################################################
|
10
|
+
# OPTIONS
|
11
|
+
##############################################################################
|
12
|
+
|
13
|
+
PKG_NAME = 'xmpp4r'
|
14
|
+
PKG_VERSION = Jabber::XMPP4R_VERSION
|
15
|
+
AUTHORS = ['Lucas Nussbaum', 'Stephan Maka', 'Glenn Rempe']
|
16
|
+
EMAIL = "xmpp4r-devel@gna.org"
|
17
|
+
HOMEPAGE = "http://home.gna.org/xmpp4r/"
|
18
|
+
SUMMARY = "XMPP4R is an XMPP/Jabber library for Ruby."
|
19
|
+
|
20
|
+
# These are the common rdoc options that are shared between generation of
|
21
|
+
# rdoc files using BOTH 'rake rdoc' and the installation by users of a
|
22
|
+
# RubyGem version which builds rdoc's along with its installation. Any
|
23
|
+
# rdoc options that are ONLY for developers running 'rake rdoc' should be
|
24
|
+
# added in the 'Rake::RDocTask' block below.
|
25
|
+
RDOC_OPTIONS = [
|
26
|
+
"--quiet",
|
27
|
+
"--title", SUMMARY,
|
28
|
+
"--opname", "index.html",
|
29
|
+
"--main", "lib/xmpp4r.rb",
|
30
|
+
"--line-numbers",
|
31
|
+
"--inline-source"
|
32
|
+
]
|
33
|
+
|
34
|
+
# Extra files outside of the lib dir that should be included with the rdocs.
|
35
|
+
RDOC_FILES = %w( README.rdoc README_ruby19.txt CHANGELOG LICENSE COPYING )
|
36
|
+
|
37
|
+
# The full file list used for rdocs, tarballs, gems, and for generating the xmpp4r.gemspec.
|
38
|
+
PKG_FILES = %w( Rakefile setup.rb xmpp4r.gemspec ) + RDOC_FILES + Dir["{lib,test,data,tools}/**/*"]
|
39
|
+
|
40
|
+
##############################################################################
|
41
|
+
# DEFAULT TASK
|
42
|
+
##############################################################################
|
43
|
+
|
44
|
+
# The task that will run when a simple 'rake' command is issued.
|
45
|
+
# Default to running the test suite as that's a nice safe command
|
46
|
+
# we should run frequently.
|
47
|
+
task :default => [:test]
|
48
|
+
|
49
|
+
##############################################################################
|
50
|
+
# TESTING TASKS
|
51
|
+
##############################################################################
|
52
|
+
|
53
|
+
Rake::TestTask.new do |t|
|
54
|
+
t.libs << "test"
|
55
|
+
t.test_files = ['test/ts_xmpp4r.rb']
|
56
|
+
end
|
57
|
+
|
58
|
+
##############################################################################
|
59
|
+
# DOCUMENTATION TASKS
|
60
|
+
##############################################################################
|
61
|
+
|
62
|
+
# RDOC
|
63
|
+
#######
|
64
|
+
Rake::RDocTask.new do |rd|
|
65
|
+
|
66
|
+
# which dir should rdoc files be installed in?
|
67
|
+
rd.rdoc_dir = 'rdoc'
|
68
|
+
|
69
|
+
# the full list of files to be included
|
70
|
+
rd.rdoc_files.include(RDOC_FILES, "lib/**/*.rb")
|
71
|
+
|
72
|
+
# the full list of options that are common between gem build
|
73
|
+
# and 'rake rdoc' build of docs.
|
74
|
+
rd.options = RDOC_OPTIONS
|
75
|
+
|
76
|
+
# Devs Only : Uncomment to also document private methods in the rdocs
|
77
|
+
# Please don't check this change in to the source repo.
|
78
|
+
#rd.options << '--all'
|
79
|
+
|
80
|
+
# Devs Only : Uncomment to generate dot (graphviz) diagrams along with rdocs.
|
81
|
+
# This requires that graphiz (dot) be installed as a local binary and on your path.
|
82
|
+
# See : http://www.graphviz.org/
|
83
|
+
# Please don't check this change in to the source repo as it introduces a binary dependency.
|
84
|
+
#rd.options << '--diagram'
|
85
|
+
#rd.options << '--fileboxes'
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
# RCOV
|
91
|
+
#######
|
92
|
+
|
93
|
+
# Conditional require rcov/rcovtask if present
|
94
|
+
begin
|
95
|
+
require 'rcov/rcovtask'
|
96
|
+
|
97
|
+
Rcov::RcovTask.new do |t|
|
98
|
+
t.test_files = ['test/ts_xmpp4r.rb']
|
99
|
+
t.output_dir = "coverage"
|
100
|
+
end
|
101
|
+
rescue Object
|
102
|
+
end
|
103
|
+
|
104
|
+
# DOT GRAPH
|
105
|
+
############
|
106
|
+
desc "Generate requires graph"
|
107
|
+
task :gen_requires_graph do
|
108
|
+
sh %{cd tools; ./gen_requires.bash}
|
109
|
+
end
|
110
|
+
|
111
|
+
# UPDATE WEBSITE (for Lucas only)
|
112
|
+
#################################
|
113
|
+
desc "Update website (for Lucas only)"
|
114
|
+
task :update_website do
|
115
|
+
sh %{cp website/* ~/dev/xmpp4r/website/ && cd ~/dev/xmpp4r/website/ && svn commit -m "website update"}
|
116
|
+
end
|
117
|
+
|
118
|
+
|
119
|
+
##############################################################################
|
120
|
+
# SYNTAX CHECKING
|
121
|
+
##############################################################################
|
122
|
+
|
123
|
+
desc "Check syntax of all Ruby files."
|
124
|
+
task :check_syntax do
|
125
|
+
`find . -name "*.rb" |xargs -n1 ruby -c |grep -v "Syntax OK"`
|
126
|
+
puts "* Done"
|
127
|
+
end
|
128
|
+
|
129
|
+
##############################################################################
|
130
|
+
# PACKAGING & INSTALLATION
|
131
|
+
##############################################################################
|
132
|
+
|
133
|
+
# What files/dirs should 'rake clean' remove?
|
134
|
+
CLEAN.include ["*.gem", "pkg", "rdoc", "coverage", "tools/*.png"]
|
135
|
+
|
136
|
+
# Flag for RubyGems installation used to add rake package tasks conditionally.
|
137
|
+
# Full gem + tarball on systems with RubyGems. More limited on systems without.
|
138
|
+
@rubygems = nil
|
139
|
+
|
140
|
+
begin
|
141
|
+
require 'rake/gempackagetask'
|
142
|
+
|
143
|
+
# RubyGems is installed, known since require 'rake/gempackagetask' succeeded.
|
144
|
+
@rubygems = true
|
145
|
+
|
146
|
+
spec = Gem::Specification.new do |s|
|
147
|
+
s.name = PKG_NAME
|
148
|
+
s.version = PKG_VERSION
|
149
|
+
s.authors = AUTHORS
|
150
|
+
s.email = EMAIL
|
151
|
+
s.homepage = HOMEPAGE
|
152
|
+
s.rubyforge_project = PKG_NAME
|
153
|
+
s.summary = SUMMARY
|
154
|
+
s.description = s.summary
|
155
|
+
s.platform = Gem::Platform::RUBY
|
156
|
+
s.require_path = 'lib'
|
157
|
+
s.executables = []
|
158
|
+
s.files = PKG_FILES
|
159
|
+
s.test_files = []
|
160
|
+
s.has_rdoc = true
|
161
|
+
s.extra_rdoc_files = RDOC_FILES
|
162
|
+
s.rdoc_options = RDOC_OPTIONS
|
163
|
+
s.required_ruby_version = ">= 1.8.4"
|
164
|
+
end
|
165
|
+
|
166
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
167
|
+
pkg.gem_spec = spec
|
168
|
+
pkg.need_tar = true
|
169
|
+
end
|
170
|
+
|
171
|
+
namespace :gem do
|
172
|
+
|
173
|
+
desc "Run :package and install the .gem locally"
|
174
|
+
task :install => [:update_gemspec, :package] do
|
175
|
+
sh %{sudo gem install --local pkg/#{PKG_NAME}-#{PKG_VERSION}.gem}
|
176
|
+
end
|
177
|
+
|
178
|
+
desc "Like gem:install but without ri or rdocs"
|
179
|
+
task :install_fast => [:update_gemspec, :package] do
|
180
|
+
sh %{sudo gem install --local pkg/#{PKG_NAME}-#{PKG_VERSION}.gem --no-rdoc --no-ri}
|
181
|
+
end
|
182
|
+
|
183
|
+
desc "Run :clean and uninstall the .gem"
|
184
|
+
task :uninstall => :clean do
|
185
|
+
sh %{sudo gem uninstall #{PKG_NAME}}
|
186
|
+
end
|
187
|
+
|
188
|
+
# Thanks to the Merb project for this code.
|
189
|
+
desc "Update Github Gemspec"
|
190
|
+
task :update_gemspec do
|
191
|
+
skip_fields = %w(new_platform original_platform date)
|
192
|
+
integer_fields = %w(specification_version)
|
193
|
+
|
194
|
+
result = "# WARNING : RAKE AUTO-GENERATED FILE. DO NOT MANUALLY EDIT!\n"
|
195
|
+
result << "# RUN : 'rake gem:update_gemspec'\n\n"
|
196
|
+
result << "Gem::Specification.new do |s|\n"
|
197
|
+
spec.instance_variables.each do |ivar|
|
198
|
+
value = spec.instance_variable_get(ivar)
|
199
|
+
name = ivar.split("@").last
|
200
|
+
next if skip_fields.include?(name) || value.nil? || value == "" || (value.respond_to?(:empty?) && value.empty?)
|
201
|
+
if name == "dependencies"
|
202
|
+
value.each do |d|
|
203
|
+
dep, *ver = d.to_s.split(" ")
|
204
|
+
result << " s.add_dependency #{dep.inspect}, #{ver.join(" ").inspect.gsub(/[()]/, "")}\n"
|
205
|
+
end
|
206
|
+
else
|
207
|
+
case value
|
208
|
+
when Array
|
209
|
+
value = name != "files" ? value.inspect : value.sort.uniq.inspect.split(",").join(",\n")
|
210
|
+
when String
|
211
|
+
value = value.to_i if integer_fields.include?(name)
|
212
|
+
value = value.inspect
|
213
|
+
else
|
214
|
+
value = value.to_s.inspect
|
215
|
+
end
|
216
|
+
result << " s.#{name} = #{value}\n"
|
217
|
+
end
|
218
|
+
end
|
219
|
+
result << "end"
|
220
|
+
File.open(File.join(File.dirname(__FILE__), "#{spec.name}.gemspec"), "w"){|f| f << result}
|
221
|
+
end
|
222
|
+
|
223
|
+
end # namespace :gem
|
224
|
+
|
225
|
+
# also keep the gemspec up to date each time we package a tarball or gem
|
226
|
+
task :package => ['gem:update_gemspec']
|
227
|
+
task :gem => ['gem:update_gemspec']
|
228
|
+
|
229
|
+
rescue LoadError
|
230
|
+
@rubygems = false
|
231
|
+
warning = <<EOF
|
232
|
+
###
|
233
|
+
Packaging Warning : RubyGems is apparently not installed on this
|
234
|
+
system and any file add/remove/rename will not
|
235
|
+
be auto-updated in the 'xmpp4r.gemspec' when you run any
|
236
|
+
package tasks. All such file changes are recommended
|
237
|
+
to be packaged on a system with RubyGems installed
|
238
|
+
if you intend to push commits to the Git repo so the
|
239
|
+
gemspec will also stay in sync for others.
|
240
|
+
###
|
241
|
+
EOF
|
242
|
+
puts warning
|
243
|
+
end
|
244
|
+
|
245
|
+
# we are apparently on a system that does not have RubyGems installed.
|
246
|
+
# Lets try to provide only the basic tarball package tasks as a fallback.
|
247
|
+
if @rubygems == false
|
248
|
+
begin
|
249
|
+
require 'rake/packagetask'
|
250
|
+
Rake::PackageTask.new(PKG_NAME, PKG_VERSION) do |p|
|
251
|
+
p.package_files = PKG_FILES
|
252
|
+
p.need_tar = true
|
253
|
+
end
|
254
|
+
rescue LoadError
|
255
|
+
warning = <<EOF
|
256
|
+
###
|
257
|
+
Warning : Unable to require the 'rake/packagetask'. Is Rake installed?
|
258
|
+
###
|
259
|
+
EOF
|
260
|
+
puts warning
|
261
|
+
end
|
262
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
What is this?
|
2
|
+
|
3
|
+
This is an example of what you can do with XMPP4R. It is a conferencing
|
4
|
+
component in which you can walk around, travel to various places, look
|
5
|
+
at things and talk to other visitors on the same places. If you like
|
6
|
+
Multi-User Dungeons (MUDs) this is for you!
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
How does it work?
|
11
|
+
|
12
|
+
The component loads a few worlds from a few XML files. Each world is a
|
13
|
+
component. Once joined the chat will tell you what you can do. Remember
|
14
|
+
that you can get a command listing anytime by saying '?'.
|
15
|
+
|
16
|
+
Reading 'You can go north, west' you may say 'go north' to go in the
|
17
|
+
northern direction and 'go west' to go in the western direction. You'll
|
18
|
+
then find yourself at some other place but still in the same MUC
|
19
|
+
conference. Your groupchat roster will change as you'll notice different
|
20
|
+
people and things that are just in the same place, not other places.
|
21
|
+
|
22
|
+
Before starting to hack the scripts you may want to take a look at
|
23
|
+
tower.xml. Note that users are <thing/>s, too and the whole world could
|
24
|
+
be serialized back to XML by just issuing "world.to_s".
|
25
|
+
|
26
|
+
Please note that the code, especially the error handling, is of extreme
|
27
|
+
poor quality and was mostly written in one afternoon. If I'm going to
|
28
|
+
develop this further everything should be rewritten...
|
29
|
+
|
30
|
+
---
|
31
|
+
|
32
|
+
How to try?
|
33
|
+
|
34
|
+
Because this is a component you are going to need your own Jabber
|
35
|
+
Daemon - which you'll need anyways if you're going to experiment with
|
36
|
+
XMPP4R. ;-)
|
37
|
+
|
38
|
+
Syntax:
|
39
|
+
./adventure.rb <JID> <Password> <Host>
|
40
|
+
|
41
|
+
Example:
|
42
|
+
./adventure.rb mud.example.com geheimnis localhost
|
43
|
+
|
44
|
+
---
|
45
|
+
|
46
|
+
Messages seem to have random order?
|
47
|
+
|
48
|
+
I don't know any solution for this. One may add short delays between
|
49
|
+
messages, but that would only be a very dirty hack.
|
50
|
+
|
51
|
+
RFC3920:
|
52
|
+
|
53
|
+
"10. Server Rules for Handling XML Stanzas
|
54
|
+
|
55
|
+
Compliant server implementations MUST ensure in-order processing of
|
56
|
+
XML stanzas between any two entities."
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
$:.unshift '../../lib'
|
4
|
+
|
5
|
+
require 'xmpp4r'
|
6
|
+
require 'xmpp4r/discovery'
|
7
|
+
require 'xmpp4r/muc/x/muc'
|
8
|
+
|
9
|
+
require 'adventuremuc'
|
10
|
+
|
11
|
+
|
12
|
+
#Jabber::debug = true
|
13
|
+
|
14
|
+
if ARGV.size != 3
|
15
|
+
puts "Syntax: ./adventure.rb <JID> <Password> <Host>"
|
16
|
+
puts "See README for further help"
|
17
|
+
exit
|
18
|
+
end
|
19
|
+
|
20
|
+
muc = AdventureMUC.new(Jabber::JID.new(ARGV[0]), ARGV[1], ARGV[2])
|
21
|
+
muc.add_world('tower.xml')
|
22
|
+
muc.add_world('cube.xml')
|
23
|
+
Thread.stop
|
@@ -0,0 +1,136 @@
|
|
1
|
+
require 'world'
|
2
|
+
|
3
|
+
class AdventureMUC
|
4
|
+
def initialize(jid, secret, addr, port=5347)
|
5
|
+
@worlds = {}
|
6
|
+
|
7
|
+
@component = Jabber::Component.new(jid)
|
8
|
+
@component.connect(addr, port)
|
9
|
+
@component.auth(secret)
|
10
|
+
@component.on_exception { |e,|
|
11
|
+
puts "#{e.class}: #{e}\n#{e.backtrace.join("\n")}"
|
12
|
+
}
|
13
|
+
|
14
|
+
@component.add_iq_callback { |iq|
|
15
|
+
handle_iq(iq)
|
16
|
+
}
|
17
|
+
@component.add_presence_callback { |pres|
|
18
|
+
handle_presence(pres)
|
19
|
+
}
|
20
|
+
@component.add_message_callback { |msg|
|
21
|
+
handle_message(msg)
|
22
|
+
}
|
23
|
+
|
24
|
+
puts "Adventure component up and running"
|
25
|
+
end
|
26
|
+
|
27
|
+
def add_world(file)
|
28
|
+
print "Adding world from #{file}..."
|
29
|
+
begin
|
30
|
+
world = World.new_from_file(self, file)
|
31
|
+
rescue Exception => e
|
32
|
+
puts " #{e.to_s}"
|
33
|
+
exit
|
34
|
+
end
|
35
|
+
@worlds[world.node] = world
|
36
|
+
puts " #{world.iname}"
|
37
|
+
end
|
38
|
+
|
39
|
+
def send(worldnode, worldresource, stanza)
|
40
|
+
stanza.from = Jabber::JID.new(worldnode, @component.jid.domain, worldresource)
|
41
|
+
@component.send(stanza)
|
42
|
+
end
|
43
|
+
|
44
|
+
def handle_iq(iq)
|
45
|
+
puts "iq: from #{iq.from} type #{iq.type} to #{iq.to}: #{iq.queryns}"
|
46
|
+
|
47
|
+
if iq.query.kind_of?(Jabber::Discovery::IqQueryDiscoInfo)
|
48
|
+
handle_disco_info(iq)
|
49
|
+
true
|
50
|
+
elsif iq.query.kind_of?(Jabber::Discovery::IqQueryDiscoItems)
|
51
|
+
handle_disco_items(iq)
|
52
|
+
true
|
53
|
+
else
|
54
|
+
false
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def handle_disco_info(iq)
|
59
|
+
if iq.type != :get
|
60
|
+
answer = iq.answer
|
61
|
+
answer.type = :error
|
62
|
+
answer.add(Jabber::ErrorResponse.new('bad-request'))
|
63
|
+
@component.send(answer) if iq.type != :error
|
64
|
+
return
|
65
|
+
end
|
66
|
+
answer = iq.answer
|
67
|
+
answer.type = :result
|
68
|
+
if iq.to.node == nil
|
69
|
+
answer.query.add(Jabber::Discovery::Identity.new('conference', 'Adventure component', 'text'))
|
70
|
+
answer.query.add(Jabber::Discovery::Feature.new(Jabber::Discovery::IqQueryDiscoInfo.new.namespace))
|
71
|
+
answer.query.add(Jabber::Discovery::Feature.new(Jabber::Discovery::IqQueryDiscoItems.new.namespace))
|
72
|
+
else
|
73
|
+
world = @worlds[iq.to.node]
|
74
|
+
if world.nil?
|
75
|
+
answer.type = :error
|
76
|
+
answer.query.add(Jabber::ErrorResponse.new('item-not-found', 'The world you are trying to reach is currently unavailable.'))
|
77
|
+
else
|
78
|
+
answer.query.add(Jabber::Discovery::Identity.new('conference', world.iname, 'text'))
|
79
|
+
answer.query.add(Jabber::Discovery::Feature.new(Jabber::Discovery::IqQueryDiscoInfo.new.namespace))
|
80
|
+
answer.query.add(Jabber::Discovery::Feature.new(Jabber::Discovery::IqQueryDiscoItems.new.namespace))
|
81
|
+
answer.query.add(Jabber::Discovery::Feature.new(Jabber::MUC::XMUC.new.namespace))
|
82
|
+
answer.query.add(Jabber::Discovery::Feature.new(Jabber::MUC::XMUCUser.new.namespace))
|
83
|
+
end
|
84
|
+
end
|
85
|
+
@component.send(answer)
|
86
|
+
end
|
87
|
+
|
88
|
+
def handle_disco_items(iq)
|
89
|
+
if iq.type != :get
|
90
|
+
answer = iq.answer
|
91
|
+
answer.add(Jabber::ErrorResponse.new('bad-request'))
|
92
|
+
@component.send(answer)
|
93
|
+
return
|
94
|
+
end
|
95
|
+
answer = iq.answer
|
96
|
+
answer.type = :result
|
97
|
+
if iq.to.node == nil
|
98
|
+
@worlds.each { |node,world|
|
99
|
+
answer.query.add(Jabber::Discovery::Item.new(Jabber::JID.new(node, @component.jid.domain), world.iname))
|
100
|
+
}
|
101
|
+
end
|
102
|
+
@component.send(answer)
|
103
|
+
end
|
104
|
+
|
105
|
+
def handle_presence(pres)
|
106
|
+
puts "presence: from #{pres.from} type #{pres.type} to #{pres.to}"
|
107
|
+
|
108
|
+
world = @worlds[pres.to.node]
|
109
|
+
if world.nil?
|
110
|
+
answer = pres.answer
|
111
|
+
answer.type = :error
|
112
|
+
answer.add(Jabber::ErrorResponse.new('item-not-found', 'The world you are trying to reach is currently unavailable.'))
|
113
|
+
@component.send(answer)
|
114
|
+
else
|
115
|
+
world.handle_presence(pres)
|
116
|
+
end
|
117
|
+
|
118
|
+
true
|
119
|
+
end
|
120
|
+
|
121
|
+
def handle_message(msg)
|
122
|
+
puts "message: from #{msg.from} type #{msg.type} to #{msg.to}: #{msg.body.inspect}"
|
123
|
+
|
124
|
+
world = @worlds[msg.to.node]
|
125
|
+
if world.nil?
|
126
|
+
answer = msg.answer
|
127
|
+
answer.type = :error
|
128
|
+
answer.add(Jabber::ErrorResponse.new('item-not-found', 'The world you are trying to reach is currently unavailable.'))
|
129
|
+
@component.send(answer)
|
130
|
+
else
|
131
|
+
world.handle_message(msg)
|
132
|
+
end
|
133
|
+
|
134
|
+
true
|
135
|
+
end
|
136
|
+
end
|