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,173 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
$:.unshift File::dirname(__FILE__) + '/../../lib'
|
4
|
+
|
5
|
+
require 'test/unit'
|
6
|
+
require 'xmpp4r/rexmladdons'
|
7
|
+
require 'xmpp4r/roster/iq/roster'
|
8
|
+
require 'xmpp4r/jid'
|
9
|
+
require 'xmpp4r/iq'
|
10
|
+
include Jabber
|
11
|
+
|
12
|
+
class Roster::IqQueryRosterTest < Test::Unit::TestCase
|
13
|
+
def test_create
|
14
|
+
r = Roster::IqQueryRoster.new
|
15
|
+
assert_equal('jabber:iq:roster', r.namespace)
|
16
|
+
assert_equal(r.to_a.size, 0)
|
17
|
+
assert_equal(r.to_a, [])
|
18
|
+
assert_equal(r.to_s, "<query xmlns='jabber:iq:roster'/>")
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_import
|
22
|
+
iq = Iq.new
|
23
|
+
q = REXML::Element.new('query')
|
24
|
+
q.add_namespace('jabber:iq:roster')
|
25
|
+
iq.add(q)
|
26
|
+
iq2 = Iq.new.import(iq)
|
27
|
+
assert_equal(Roster::IqQueryRoster, iq2.query.class)
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_answer
|
31
|
+
iq = Iq.new_rosterget
|
32
|
+
assert_equal(:get, iq.type)
|
33
|
+
assert_nil(iq.to)
|
34
|
+
assert_equal('jabber:client', iq.namespace)
|
35
|
+
assert_equal('jabber:iq:roster', iq.queryns)
|
36
|
+
assert_equal(0, iq.query.children.size)
|
37
|
+
|
38
|
+
iq2 = iq.answer(true)
|
39
|
+
assert_equal(:get, iq2.type)
|
40
|
+
assert_nil(iq2.from)
|
41
|
+
assert_equal('jabber:client', iq2.namespace)
|
42
|
+
assert_equal('jabber:iq:roster', iq2.queryns)
|
43
|
+
assert_equal(0, iq2.query.children.size)
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_xmlns
|
47
|
+
ri = Roster::RosterItem.new
|
48
|
+
assert_equal('jabber:iq:roster', ri.namespace)
|
49
|
+
assert_equal('jabber:iq:roster', ri.attributes['xmlns'])
|
50
|
+
|
51
|
+
r = Roster::IqQueryRoster.new
|
52
|
+
assert_equal('jabber:iq:roster', r.namespace)
|
53
|
+
assert_equal('jabber:iq:roster', r.attributes['xmlns'])
|
54
|
+
|
55
|
+
r.add(ri)
|
56
|
+
|
57
|
+
assert_equal('jabber:iq:roster', ri.namespace)
|
58
|
+
assert_nil(ri.attributes['xmlns'])
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_items
|
62
|
+
r = Roster::IqQueryRoster.new
|
63
|
+
r.add(Roster::RosterItem.new)
|
64
|
+
r.add(Roster::RosterItem.new(JID.new('a@b/d'), 'ABC', :none, :subscribe)).groups = ['a']
|
65
|
+
itemstr = "<item jid='astro@spaceboyz.net' name='Astro' subscribtion='both'>" \
|
66
|
+
+ "<group>SpaceBoyZ</group><group>xmpp4r</group></item>"
|
67
|
+
r.typed_add(REXML::Document.new(itemstr).root)
|
68
|
+
|
69
|
+
r.each { |item|
|
70
|
+
assert_equal(item, r[item.jid])
|
71
|
+
}
|
72
|
+
|
73
|
+
r.to_a.each { |item|
|
74
|
+
assert_equal(item, r[item.jid])
|
75
|
+
}
|
76
|
+
|
77
|
+
assert_equal(JID.new, r.to_a[0].jid)
|
78
|
+
assert_equal(nil, r.to_a[0].iname)
|
79
|
+
assert_equal(nil, r.to_a[0].subscription)
|
80
|
+
assert_equal(nil, r.to_a[0].ask)
|
81
|
+
|
82
|
+
assert_equal(JID.new('a@b/d'), r.to_a[1].jid)
|
83
|
+
assert_equal('ABC', r.to_a[1].iname)
|
84
|
+
assert_equal(:none, r.to_a[1].subscription)
|
85
|
+
assert_equal(:subscribe, r.to_a[1].ask)
|
86
|
+
|
87
|
+
assert_equal(REXML::Document.new(itemstr).root.to_s, r.to_a[2].to_s)
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_dupitems
|
91
|
+
r = Roster::IqQueryRoster.new
|
92
|
+
jid = JID.new('a@b')
|
93
|
+
jid2 = JID.new('c@d')
|
94
|
+
ri = Roster::RosterItem.new(jid, 'ab')
|
95
|
+
r.add(ri)
|
96
|
+
assert_equal('ab', ri.iname)
|
97
|
+
assert_equal('ab', r[jid].iname)
|
98
|
+
ri.iname = 'cd'
|
99
|
+
assert_equal('cd', ri.iname)
|
100
|
+
# There are no shallow copies - everything is alright.
|
101
|
+
assert_equal('cd', r[jid].iname)
|
102
|
+
|
103
|
+
r.add(ri)
|
104
|
+
assert_equal('cd', r[jid].iname)
|
105
|
+
assert_equal(ri, r[jid])
|
106
|
+
|
107
|
+
ri.jid = jid2
|
108
|
+
assert_equal(nil, r[jid])
|
109
|
+
assert_equal(ri, r[jid2])
|
110
|
+
assert_equal(2, r.to_a.size)
|
111
|
+
|
112
|
+
r.each_element('item') { |item|
|
113
|
+
assert_equal(ri, item)
|
114
|
+
assert_equal(ri.jid, item.jid)
|
115
|
+
assert_equal(ri.iname, item.iname)
|
116
|
+
assert_equal(jid2, item.jid)
|
117
|
+
assert_equal('cd', item.iname)
|
118
|
+
}
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
class Roster::RosterItemTest < Test::Unit::TestCase
|
123
|
+
def test_create
|
124
|
+
ri = Roster::RosterItem.new
|
125
|
+
assert_equal(JID.new, ri.jid)
|
126
|
+
assert_equal(nil, ri.iname)
|
127
|
+
assert_equal(nil, ri.subscription)
|
128
|
+
assert_equal(nil, ri.ask)
|
129
|
+
|
130
|
+
ri = Roster::RosterItem.new(JID.new('a@b/c'), 'xyz', :both, nil)
|
131
|
+
assert_equal(JID.new('a@b/c'), ri.jid)
|
132
|
+
assert_equal('xyz', ri.iname)
|
133
|
+
assert_equal(:both, ri.subscription)
|
134
|
+
assert_equal(nil, ri.ask)
|
135
|
+
end
|
136
|
+
|
137
|
+
def test_modify
|
138
|
+
ri = Roster::RosterItem.new(JID.new('a@b/c'), 'xyz', :both, :subscribe)
|
139
|
+
|
140
|
+
assert_equal(JID.new('a@b/c'), ri.jid)
|
141
|
+
ri.jid = nil
|
142
|
+
assert_equal(JID.new, ri.jid)
|
143
|
+
|
144
|
+
assert_equal('xyz', ri.iname)
|
145
|
+
ri.iname = nil
|
146
|
+
assert_equal(nil, ri.iname)
|
147
|
+
|
148
|
+
assert_equal(:both, ri.subscription)
|
149
|
+
ri.subscription = nil
|
150
|
+
assert_equal(nil, ri.subscription)
|
151
|
+
|
152
|
+
assert_equal(:subscribe, ri.ask)
|
153
|
+
ri.ask = nil
|
154
|
+
assert_equal(nil, ri.ask)
|
155
|
+
end
|
156
|
+
|
157
|
+
def test_groupdeletion
|
158
|
+
ri = Roster::RosterItem.new
|
159
|
+
g1 = ['a', 'b', 'c']
|
160
|
+
ri.groups = g1
|
161
|
+
assert_equal(g1, ri.groups.sort)
|
162
|
+
g2 = ['c', 'd', 'e']
|
163
|
+
ri.groups = g2
|
164
|
+
assert_equal(g2, ri.groups.sort)
|
165
|
+
end
|
166
|
+
|
167
|
+
def test_dupgroups
|
168
|
+
ri = Roster::RosterItem.new
|
169
|
+
mygroups = ['a', 'a', 'b']
|
170
|
+
ri.groups = mygroups
|
171
|
+
assert_equal(mygroups.uniq, ri.groups)
|
172
|
+
end
|
173
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
$:.unshift File::dirname(__FILE__) + '/../../lib'
|
4
|
+
|
5
|
+
require 'test/unit'
|
6
|
+
require 'xmpp4r/rexmladdons'
|
7
|
+
require 'xmpp4r/roster/x/roster'
|
8
|
+
require 'xmpp4r/jid'
|
9
|
+
include Jabber
|
10
|
+
|
11
|
+
class Roster::XRosterTest < Test::Unit::TestCase
|
12
|
+
def test_create
|
13
|
+
r1 = Roster::XRoster.new
|
14
|
+
assert_equal('x', r1.name)
|
15
|
+
assert_equal('jabber:x:roster', r1.namespace)
|
16
|
+
r2 = Roster::RosterX.new
|
17
|
+
assert_equal('x', r2.name)
|
18
|
+
assert_equal('http://jabber.org/protocol/rosterx', r2.namespace)
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_import
|
22
|
+
x1 = X.new
|
23
|
+
x1.add_namespace('jabber:x:roster')
|
24
|
+
x2 = X::import(x1)
|
25
|
+
assert_equal(Roster::XRoster, x2.class)
|
26
|
+
assert_equal('jabber:x:roster', x2.namespace)
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_typed_add
|
30
|
+
x = REXML::Element.new('x')
|
31
|
+
x.add(REXML::Element.new('item'))
|
32
|
+
r = Roster::XRoster.new.import(x)
|
33
|
+
assert_kind_of(Roster::XRosterItem, r.first_element('item'))
|
34
|
+
assert_kind_of(Roster::XRosterItem, r.typed_add(REXML::Element.new('item')))
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_items
|
38
|
+
j1 = Roster::XRosterItem.new
|
39
|
+
assert_equal(JID.new(nil), j1.jid)
|
40
|
+
assert_equal(nil, j1.iname)
|
41
|
+
|
42
|
+
j2 = Roster::XRosterItem.new(JID.new('a@b/c'))
|
43
|
+
assert_equal(JID.new('a@b/c'), j2.jid)
|
44
|
+
assert_equal(nil, j2.iname)
|
45
|
+
j3 = Roster::XRosterItem.new(JID.new('a@b/c'), 'Mr. Abc')
|
46
|
+
assert_equal(JID.new('a@b/c'), j3.jid)
|
47
|
+
assert_equal('Mr. Abc', j3.iname)
|
48
|
+
assert_equal([], j3.groups)
|
49
|
+
|
50
|
+
j3.groups = ['X', 'Y', 'Z']
|
51
|
+
assert_equal(['X', 'Y', 'Z'], j3.groups)
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_actions
|
55
|
+
j = Roster::XRosterItem.new
|
56
|
+
assert_equal(:add, j.action)
|
57
|
+
|
58
|
+
j.action = :modify
|
59
|
+
assert_equal(:modify, j.action)
|
60
|
+
|
61
|
+
j.action = :delete
|
62
|
+
assert_equal(:delete, j.action)
|
63
|
+
|
64
|
+
j.action = :invalid
|
65
|
+
assert_equal(:add, j.action)
|
66
|
+
|
67
|
+
j.attributes['action'] = 'modify'
|
68
|
+
assert_equal(:modify, j.action)
|
69
|
+
|
70
|
+
j.attributes['action'] = 'invalid'
|
71
|
+
assert_equal(:add, j.action)
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
$:.unshift File::dirname(__FILE__) + '/../../lib'
|
4
|
+
|
5
|
+
require 'test/unit'
|
6
|
+
require File::dirname(__FILE__) + '/../lib/clienttester'
|
7
|
+
|
8
|
+
require 'xmpp4r'
|
9
|
+
require 'xmpp4r/rpc/helper/client'
|
10
|
+
require 'xmpp4r/rpc/helper/server'
|
11
|
+
include Jabber
|
12
|
+
|
13
|
+
class RPC::HelperTest < Test::Unit::TestCase
|
14
|
+
include ClientTester
|
15
|
+
|
16
|
+
def give_client_jid!
|
17
|
+
class << @client
|
18
|
+
remove_method(:jid) # avoids warning
|
19
|
+
def jid; Jabber::JID.new('client@test.com/clienttester'); end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_create
|
24
|
+
give_client_jid!
|
25
|
+
|
26
|
+
cl = RPC::Client.new(@client, 'a@b/c')
|
27
|
+
assert_kind_of(RPC::Client, cl)
|
28
|
+
sv = RPC::Server.new(@server)
|
29
|
+
assert_kind_of(RPC::Server, sv)
|
30
|
+
end
|
31
|
+
|
32
|
+
def echo(msg = nil)
|
33
|
+
msg
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_simple
|
37
|
+
give_client_jid!
|
38
|
+
|
39
|
+
sv = RPC::Server.new(@server)
|
40
|
+
sv.add_handler("echo", &method(:echo))
|
41
|
+
|
42
|
+
cl = RPC::Client.new(@client, 'a@b/c')
|
43
|
+
assert_nothing_raised do
|
44
|
+
assert_equal('Test string', cl.call("echo", 'Test string'))
|
45
|
+
end
|
46
|
+
|
47
|
+
# exception during serialisation bug identified on xmpp4r-devel
|
48
|
+
# https://mail.gna.org/public/xmpp4r-devel/2008-05/msg00010.html
|
49
|
+
assert_raise XMLRPC::FaultException do
|
50
|
+
cl.call("echo")
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_introspection
|
55
|
+
give_client_jid!
|
56
|
+
|
57
|
+
sv = RPC::Server.new(@server)
|
58
|
+
sv.add_introspection
|
59
|
+
|
60
|
+
cl = RPC::Client.new(@client, 'a@b/c')
|
61
|
+
cl_methods = cl.call("system.listMethods")
|
62
|
+
assert(cl_methods.size > 0)
|
63
|
+
cl_methods.each { |method|
|
64
|
+
assert_kind_of(String, method)
|
65
|
+
assert(method =~ /^system\./)
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_multicall
|
70
|
+
give_client_jid!
|
71
|
+
|
72
|
+
sv = RPC::Server.new(@server)
|
73
|
+
sv.add_multicall
|
74
|
+
sv.add_handler("reverse") do |s| s.reverse end
|
75
|
+
sv.add_handler("upcase") do |s| s.upcase end
|
76
|
+
|
77
|
+
cl = RPC::Client.new(@client, 'a@b/c')
|
78
|
+
assert_equal(['tseT', 'TEST'], cl.multicall(['reverse', 'Test'], ['upcase', 'Test']))
|
79
|
+
end
|
80
|
+
|
81
|
+
def test_100calls
|
82
|
+
give_client_jid!
|
83
|
+
|
84
|
+
sv = RPC::Server.new(@server)
|
85
|
+
sv.add_handler("add") do |a,b| a+b end
|
86
|
+
|
87
|
+
cl = RPC::Client.new(@client, 'a@b/c')
|
88
|
+
correct = true
|
89
|
+
100.times {
|
90
|
+
a, b = rand(1000), rand(1000)
|
91
|
+
correct &&= (cl.call('add', a, b) == a + b)
|
92
|
+
}
|
93
|
+
|
94
|
+
assert(correct)
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
$:.unshift '../lib'
|
4
|
+
|
5
|
+
require 'test/unit'
|
6
|
+
require 'xmpp4r/callbacks'
|
7
|
+
include Jabber
|
8
|
+
|
9
|
+
class CallbacksTest < Test::Unit::TestCase
|
10
|
+
def test_test1
|
11
|
+
called = 0
|
12
|
+
cb = Callback.new(5, "toto", Proc.new { called += 1 })
|
13
|
+
assert_equal(5, cb.priority)
|
14
|
+
assert_equal("toto", cb.ref)
|
15
|
+
cb.block.call
|
16
|
+
assert_equal(1, called)
|
17
|
+
cb.block.call
|
18
|
+
assert_equal(2, called)
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_callbacklist1
|
22
|
+
cbl = CallbackList.new
|
23
|
+
called1 = false
|
24
|
+
called2 = false
|
25
|
+
called3 = false
|
26
|
+
called4 = false
|
27
|
+
cbl.add(5, "ref1") { called1 = true ; true }
|
28
|
+
cbl.add(7, "ref1") { |e| called2 = true ; false}
|
29
|
+
cbl.add(9, "ref1") { called3 = true ;false }
|
30
|
+
cbl.add(11, "ref1") { called4 = true ; false }
|
31
|
+
o = "aaaa"
|
32
|
+
assert(cbl.process(o))
|
33
|
+
assert(called1)
|
34
|
+
assert(called2)
|
35
|
+
assert(called3)
|
36
|
+
assert(called4)
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_callbacklist2
|
40
|
+
cbl = CallbackList.new
|
41
|
+
assert(0, cbl.length)
|
42
|
+
cbl.add(5, "ref1") { called1 = true }
|
43
|
+
assert(1, cbl.length)
|
44
|
+
cbl.add(7, "ref2") { |e| called2 = true ; e.consume }
|
45
|
+
assert(2, cbl.length)
|
46
|
+
cbl.delete("ref2")
|
47
|
+
assert(1, cbl.length)
|
48
|
+
cbl.add(9, "ref3") { called3 = true }
|
49
|
+
assert(2, cbl.length)
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_callbacklist4
|
53
|
+
cbl = CallbackList.new
|
54
|
+
cbl.add(5, "ref1") { false }
|
55
|
+
cbl.add(7, "ref1") { false }
|
56
|
+
o = "o"
|
57
|
+
assert(!cbl.process(o))
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_callbacklist5
|
61
|
+
cbl = CallbackList.new
|
62
|
+
cbl.add(5, "ref1") { true }
|
63
|
+
cbl.add(7, "ref1") { false }
|
64
|
+
o = "o"
|
65
|
+
assert(cbl.process(o))
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_callbacklist6
|
69
|
+
cbl = CallbackList.new
|
70
|
+
ok = false
|
71
|
+
c = 'a'
|
72
|
+
d = 'b'
|
73
|
+
cbl.add(5, "ref1") { |a, b|
|
74
|
+
if a == 'a' and b == 'b'
|
75
|
+
ok = true
|
76
|
+
end
|
77
|
+
false
|
78
|
+
}
|
79
|
+
assert(!cbl.process(c, d))
|
80
|
+
assert(ok)
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_callbacklist7
|
84
|
+
cbl = CallbackList.new
|
85
|
+
called1 = false
|
86
|
+
called2 = false
|
87
|
+
called3 = false
|
88
|
+
called4 = false
|
89
|
+
cbl.add(3, "ref1") { called4 = true ; true }
|
90
|
+
cbl.add(5, "ref1") { called1 = true ; true }
|
91
|
+
cbl.add(7, "ref1") { called2 = true ; 'a'}
|
92
|
+
cbl.add(9, "ref1") { called3 = true ;1 }
|
93
|
+
o = "aaaa"
|
94
|
+
assert(cbl.process(o))
|
95
|
+
assert(called1)
|
96
|
+
assert(called2)
|
97
|
+
assert(called3)
|
98
|
+
assert(!called4)
|
99
|
+
end
|
100
|
+
|
101
|
+
def test_nested
|
102
|
+
cbl = CallbackList.new
|
103
|
+
called_outer = 0
|
104
|
+
called_inner = 0
|
105
|
+
|
106
|
+
cbl.add(100, nil) {
|
107
|
+
called_outer += 1
|
108
|
+
|
109
|
+
if called_outer == 1
|
110
|
+
cbl.add(200, nil) {
|
111
|
+
called_inner += 1
|
112
|
+
}
|
113
|
+
end
|
114
|
+
}
|
115
|
+
|
116
|
+
assert_equal(0, called_inner)
|
117
|
+
assert_equal(0, called_outer)
|
118
|
+
|
119
|
+
cbl.process
|
120
|
+
|
121
|
+
assert_equal(0, called_inner)
|
122
|
+
assert_equal(1, called_outer)
|
123
|
+
|
124
|
+
cbl.process
|
125
|
+
|
126
|
+
assert_equal(1, called_inner)
|
127
|
+
assert_equal(2, called_outer)
|
128
|
+
end
|
129
|
+
end
|