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,147 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'xmpp4r/framework/bot'
|
4
|
+
require 'xmpp4r/pubsub'
|
5
|
+
require 'xmpp4r/vcard'
|
6
|
+
require 'ramaze'
|
7
|
+
|
8
|
+
if ARGV.size < 3
|
9
|
+
puts "Usage: #{$0} <HTTP port> <JID> <Password> [Status message]"
|
10
|
+
exit
|
11
|
+
end
|
12
|
+
HTTP_PORT = ARGV.shift.to_i
|
13
|
+
JID = ARGV.shift
|
14
|
+
PASSWORD = ARGV.shift
|
15
|
+
STATUS_MESSAGE = ARGV.shift
|
16
|
+
|
17
|
+
def xml_namespaces(filename, excludes=[])
|
18
|
+
namespaces_recursive = nil
|
19
|
+
namespaces_recursive = lambda { |element|
|
20
|
+
namespaces = element.namespaces
|
21
|
+
element.each_element { |child|
|
22
|
+
namespaces.merge!(namespaces_recursive.call(child))
|
23
|
+
}
|
24
|
+
namespaces
|
25
|
+
}
|
26
|
+
|
27
|
+
root = REXML::Document.new(File.new(filename)).root
|
28
|
+
all = namespaces_recursive.call(root)
|
29
|
+
res = {}
|
30
|
+
all.each { |prefix,uri|
|
31
|
+
res[prefix] = uri unless excludes.include? prefix
|
32
|
+
}
|
33
|
+
res
|
34
|
+
end
|
35
|
+
|
36
|
+
Jabber::debug = true
|
37
|
+
|
38
|
+
class VcardCache < Jabber::Vcard::Helper
|
39
|
+
attr_reader :vcards
|
40
|
+
|
41
|
+
def initialize(stream)
|
42
|
+
super
|
43
|
+
@vcards = {}
|
44
|
+
end
|
45
|
+
|
46
|
+
def get(jid)
|
47
|
+
unless @vcards[jid]
|
48
|
+
begin
|
49
|
+
@vcards[jid] = super
|
50
|
+
rescue Jabber::ServerError
|
51
|
+
@vcards[jid] = :error
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
@vcards[jid]
|
56
|
+
end
|
57
|
+
|
58
|
+
def get_until(jid, timeout=10)
|
59
|
+
begin
|
60
|
+
Timeout::timeout(timeout) {
|
61
|
+
get(jid)
|
62
|
+
}
|
63
|
+
rescue Timeout::Error
|
64
|
+
@vcards[jid] = :timeout
|
65
|
+
end
|
66
|
+
|
67
|
+
@vcards[jid]
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
MAX_ITEMS = 50
|
72
|
+
$jid_items = []
|
73
|
+
|
74
|
+
$bot = Jabber::Framework::Bot.new(JID, PASSWORD)
|
75
|
+
class << $bot
|
76
|
+
def accept_subscription_from?(jid)
|
77
|
+
roster.add(jid, nil, true)
|
78
|
+
true
|
79
|
+
end
|
80
|
+
end
|
81
|
+
$vcards = VcardCache.new($bot.stream)
|
82
|
+
xml_namespaces('index.xsl', %w(xmlns xsl pa j p)).each { |prefix,node|
|
83
|
+
$bot.add_pep_notification(node) do |from,item|
|
84
|
+
from.strip!
|
85
|
+
item.add_namespace(Jabber::PubSub::NS_PUBSUB)
|
86
|
+
item.attributes['node'] = node
|
87
|
+
is_duplicate = false
|
88
|
+
$jid_items.each { |jid1,item1|
|
89
|
+
if jid1.to_s == from.to_s and node == item1.attributes['node']
|
90
|
+
is_duplicate = (item.to_s == item1.to_s)
|
91
|
+
break
|
92
|
+
end
|
93
|
+
}
|
94
|
+
unless is_duplicate
|
95
|
+
$jid_items.unshift([from, item])
|
96
|
+
$jid_items = $jid_items[0..(MAX_ITEMS-1)]
|
97
|
+
end
|
98
|
+
end
|
99
|
+
}
|
100
|
+
|
101
|
+
$bot.set_presence(nil, STATUS_MESSAGE || "Busy aggregating PEP events...")
|
102
|
+
|
103
|
+
class WebController < Ramaze::Controller
|
104
|
+
map '/'
|
105
|
+
template_root __DIR__
|
106
|
+
engine :XSLT
|
107
|
+
|
108
|
+
def index
|
109
|
+
"<?xml version='1.0' encoding='UTF-8'?>" +
|
110
|
+
"<items xmlns:jabber='jabber:client' jabber:to='#{Jabber::JID.new(JID).strip}'>" +
|
111
|
+
$jid_items.collect do |jid,item_orig|
|
112
|
+
item = item_orig.deep_clone
|
113
|
+
item.attributes['jabber:from'] = jid.to_s
|
114
|
+
vcard = $vcards.get_until(jid)
|
115
|
+
if vcard.kind_of? Jabber::Vcard::IqVcard
|
116
|
+
item.attributes['jabber:from-name'] = vcard['NICKNAME'] || vcard['FN'] || jid.node
|
117
|
+
item.attributes['jabber:has-avatar'] = (vcard['PHOTO/TYPE'] and
|
118
|
+
vcard['PHOTO/BINVAL']) ? 'true' : 'false'
|
119
|
+
else
|
120
|
+
item.attributes['jabber:from-name'] = jid.node
|
121
|
+
item.attributes['jabber:has-avatar'] = 'false'
|
122
|
+
end
|
123
|
+
item
|
124
|
+
end.join +
|
125
|
+
"</items>"
|
126
|
+
end
|
127
|
+
|
128
|
+
def avatar(jid)
|
129
|
+
trait :engine => :None
|
130
|
+
|
131
|
+
vcard = $vcards.get_until(jid)
|
132
|
+
if vcard.kind_of? Jabber::Vcard::IqVcard
|
133
|
+
if vcard['PHOTO/TYPE'] and vcard.photo_binval
|
134
|
+
response['Content-Type'] = vcard['PHOTO/TYPE']
|
135
|
+
response.body = vcard.photo_binval
|
136
|
+
else
|
137
|
+
response['Status'] = 404
|
138
|
+
end
|
139
|
+
else
|
140
|
+
response['Status'] = 404
|
141
|
+
end
|
142
|
+
|
143
|
+
throw :respond
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
Ramaze::start(:port => HTTP_PORT)
|
@@ -0,0 +1,84 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'xmpp4r'
|
4
|
+
require 'xmpp4r/helpers/filetransfer'
|
5
|
+
|
6
|
+
|
7
|
+
if ARGV.size != 3
|
8
|
+
puts "Usage: #{$0} <jid> <password> <incoming-directory>"
|
9
|
+
exit
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
#Jabber::debug = true
|
14
|
+
|
15
|
+
cl = Jabber::Client.new(Jabber::JID.new(ARGV[0]))
|
16
|
+
puts "Connecting Jabber client..."
|
17
|
+
cl.connect
|
18
|
+
puts "Authenticating..."
|
19
|
+
cl.auth ARGV[1]
|
20
|
+
|
21
|
+
ft = Jabber::Helpers::FileTransfer.new(cl)
|
22
|
+
ft.add_incoming_callback { |iq,file|
|
23
|
+
puts "Incoming file transfer from #{iq.from}: #{file.fname} (#{file.size / 1024} KB)"
|
24
|
+
|
25
|
+
filename = "#{ARGV[2]}/#{file.fname.split(/\//).last}"
|
26
|
+
offset = nil
|
27
|
+
if File::exist?(filename)
|
28
|
+
puts "#{filename} already exists"
|
29
|
+
if File::size(filename) < file.size and file.range
|
30
|
+
offset = File::size(filename)
|
31
|
+
puts "Peer supports <range/>, will retrieve #{file.fname} starting at #{offset}"
|
32
|
+
else
|
33
|
+
puts "#{file.fname} is already fully retrieved, declining file-transfer"
|
34
|
+
ft.decline(iq)
|
35
|
+
next
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
Thread.new {
|
40
|
+
begin
|
41
|
+
puts "Accepting #{file.fname}"
|
42
|
+
stream = ft.accept(iq, offset)
|
43
|
+
if stream.kind_of?(Jabber::Helpers::SOCKS5Bytestreams)
|
44
|
+
stream.connect_timeout = 5
|
45
|
+
stream.add_streamhost_callback { |streamhost,state,e|
|
46
|
+
case state
|
47
|
+
when :connecting
|
48
|
+
puts "Connecting to #{streamhost.jid} (#{streamhost.host}:#{streamhost.port})"
|
49
|
+
when :success
|
50
|
+
puts "Successfully using #{streamhost.jid} (#{streamhost.host}:#{streamhost.port})"
|
51
|
+
when :failure
|
52
|
+
puts "Error using #{streamhost.jid} (#{streamhost.host}:#{streamhost.port}): #{e}"
|
53
|
+
end
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
puts "Waiting for stream configuration"
|
58
|
+
if stream.accept
|
59
|
+
puts "Stream established"
|
60
|
+
outfile = File.new(filename, (offset ? 'a' : 'w'))
|
61
|
+
while buf = stream.read
|
62
|
+
outfile.write(buf)
|
63
|
+
print '.'
|
64
|
+
$stdout.flush
|
65
|
+
end
|
66
|
+
puts '!'
|
67
|
+
outfile.close
|
68
|
+
stream.close
|
69
|
+
else
|
70
|
+
puts "Stream failed"
|
71
|
+
end
|
72
|
+
rescue Exception => e
|
73
|
+
puts "#{e.class}: #{e}\n#{e.backtrace.join("\n")}"
|
74
|
+
end
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
cl.send(Jabber::Presence.new(:chat, 'Send me files!'))
|
79
|
+
|
80
|
+
puts "Waiting."
|
81
|
+
|
82
|
+
Thread.stop
|
83
|
+
|
84
|
+
cl.close
|
@@ -0,0 +1,129 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
#
|
3
|
+
# XMPP4R - XMPP Library for Ruby
|
4
|
+
# Copyright (C) 2005 Stephan Maka <stephan@spaceboyz.net>
|
5
|
+
# Released under Ruby's license (see the LICENSE file) or GPL, at your option
|
6
|
+
#
|
7
|
+
#
|
8
|
+
# Roster-Discovery example
|
9
|
+
#
|
10
|
+
# If you don't understand this code read JEP-0030 (Service Discovery) first:
|
11
|
+
# http://www.jabber.org/jeps/jep-0030.html
|
12
|
+
#
|
13
|
+
# This examples exposes your roster to Service Discovery and can be browsed
|
14
|
+
# by anyone. Please use with care if you want to keep your roster private!
|
15
|
+
#
|
16
|
+
# The Psi client has a very pretty Service Discovery dialog. But be sure
|
17
|
+
# to turn off "Auto-browse into objects" for big rosters.
|
18
|
+
#
|
19
|
+
|
20
|
+
$:.unshift '../../../../../lib'
|
21
|
+
|
22
|
+
require 'thread'
|
23
|
+
|
24
|
+
require 'xmpp4r'
|
25
|
+
require 'xmpp4r/helpers/roster'
|
26
|
+
require 'xmpp4r/iq/query/discoinfo'
|
27
|
+
require 'xmpp4r/iq/query/discoitems'
|
28
|
+
|
29
|
+
# Command line argument checking
|
30
|
+
|
31
|
+
if ARGV.size != 2
|
32
|
+
puts("Usage: ./rosterdiscovery.rb <jid> <password>")
|
33
|
+
exit
|
34
|
+
end
|
35
|
+
|
36
|
+
# Building up the connection
|
37
|
+
|
38
|
+
#Jabber::debug = true
|
39
|
+
|
40
|
+
jid = Jabber::JID.new(ARGV[0])
|
41
|
+
|
42
|
+
cl = Jabber::Client.new(jid)
|
43
|
+
cl.connect
|
44
|
+
cl.auth(ARGV[1])
|
45
|
+
|
46
|
+
|
47
|
+
# The roster instance
|
48
|
+
roster = Jabber::Helpers::Roster.new(cl)
|
49
|
+
|
50
|
+
|
51
|
+
cl.add_iq_callback { |iq|
|
52
|
+
if iq.query.kind_of?(Jabber::IqQueryDiscoInfo) || iq.query.kind_of?(Jabber::IqQueryDiscoItems)
|
53
|
+
|
54
|
+
# Prepare the <iq/> stanza for result
|
55
|
+
iq.from, iq.to = iq.to, iq.from
|
56
|
+
iq.type = :result
|
57
|
+
|
58
|
+
|
59
|
+
if iq.query.kind_of?(Jabber::IqQueryDiscoInfo)
|
60
|
+
# iq.to and iq.from are already switched here:
|
61
|
+
puts("#{iq.to} requests info of #{iq.from} node #{iq.query.node.inspect}")
|
62
|
+
|
63
|
+
if iq.query.node.nil?
|
64
|
+
iq.query.add(Jabber::DiscoIdentity.new('directory', 'Roster discovery', 'user'))
|
65
|
+
else
|
66
|
+
# Count contacts in group
|
67
|
+
in_group = 0
|
68
|
+
roster.items.each { |jid,item|
|
69
|
+
if item.groups.include?(iq.query.node)
|
70
|
+
in_group += 1
|
71
|
+
end
|
72
|
+
}
|
73
|
+
|
74
|
+
iq.query.add(Jabber::DiscoIdentity.new('directory', "#{iq.query.node} (#{in_group})", 'group'))
|
75
|
+
end
|
76
|
+
|
77
|
+
iq.query.add(Jabber::DiscoFeature.new(Jabber::IqQueryDiscoInfo.new.namespace))
|
78
|
+
iq.query.add(Jabber::DiscoFeature.new(Jabber::IqQueryDiscoItems.new.namespace))
|
79
|
+
|
80
|
+
elsif iq.query.kind_of?(Jabber::IqQueryDiscoItems)
|
81
|
+
# iq.to and iq.from are already switched here:
|
82
|
+
puts("#{iq.to} requests items of #{iq.from} node #{iq.query.node.inspect}")
|
83
|
+
|
84
|
+
if iq.query.node.nil?
|
85
|
+
# Make items from group names
|
86
|
+
groups = []
|
87
|
+
|
88
|
+
roster.items.each { |jid,item|
|
89
|
+
groups += item.groups
|
90
|
+
}
|
91
|
+
|
92
|
+
groups.uniq.each { |group|
|
93
|
+
iq.query.add(Jabber::DiscoItem.new(cl.jid, group, group))
|
94
|
+
}
|
95
|
+
|
96
|
+
# Collect all ungrouped roster items
|
97
|
+
roster.items.each { |jid,item|
|
98
|
+
if item.groups == []
|
99
|
+
iq.query.add(Jabber::DiscoItem.new(item.jid, item.iname.to_s == '' ? item.jid : item.iname))
|
100
|
+
end
|
101
|
+
}
|
102
|
+
else
|
103
|
+
# Add a discovery item for each roster item in that group
|
104
|
+
roster.items.each { |jid,item|
|
105
|
+
if item.groups.include?(iq.query.node)
|
106
|
+
iq.query.add(Jabber::DiscoItem.new(item.jid, item.iname.to_s == '' ? item.jid : item.iname))
|
107
|
+
end
|
108
|
+
}
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
cl.send(iq)
|
114
|
+
|
115
|
+
true
|
116
|
+
end
|
117
|
+
}
|
118
|
+
|
119
|
+
# Initial presence
|
120
|
+
cl.send(Jabber::Presence.new.set_status("Discover my roster at #{jid}"))
|
121
|
+
|
122
|
+
# Main loop:
|
123
|
+
|
124
|
+
loop do
|
125
|
+
cl.process
|
126
|
+
Thread.stop
|
127
|
+
end
|
128
|
+
|
129
|
+
cl.close
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'xmpp4r'
|
2
|
+
require 'xmpp4r/bytestreams'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
Jabber::debug = true
|
6
|
+
|
7
|
+
if ARGV.size != 3
|
8
|
+
puts "Usage: #{$0} <jid> <description> <file>"
|
9
|
+
exit
|
10
|
+
end
|
11
|
+
|
12
|
+
conf = YAML::load File.new('sendfile.conf')
|
13
|
+
|
14
|
+
cl = Jabber::Client.new(Jabber::JID.new(conf['jabber']['jid']))
|
15
|
+
puts "Connecting Jabber client..."
|
16
|
+
cl.connect
|
17
|
+
puts "Authenticating..."
|
18
|
+
cl.auth conf['jabber']['password']
|
19
|
+
|
20
|
+
puts "Starting local Bytestreams server"
|
21
|
+
bss = Jabber::Bytestreams::SOCKS5BytestreamsServer.new(conf['local']['port'])
|
22
|
+
conf['local']['addresses'].each { |address|
|
23
|
+
bss.add_address(address)
|
24
|
+
}
|
25
|
+
ft = Jabber::FileTransfer::Helper.new(cl)
|
26
|
+
#ft.allow_bytestreams = false
|
27
|
+
source = Jabber::FileTransfer::FileSource.new(ARGV[2])
|
28
|
+
puts "Offering #{source.filename} to #{ARGV[0]}"
|
29
|
+
stream = ft.offer(Jabber::JID.new(ARGV[0]), source, ARGV[1])
|
30
|
+
|
31
|
+
if stream
|
32
|
+
puts "Starting stream initialization (#{stream.class})"
|
33
|
+
|
34
|
+
if stream.kind_of? Jabber::Bytestreams::SOCKS5BytestreamsInitiator
|
35
|
+
stream.add_streamhost(bss)
|
36
|
+
(conf['proxies'] || []).each { |proxy|
|
37
|
+
puts "Querying proxy #{proxy}"
|
38
|
+
stream.add_streamhost proxy
|
39
|
+
}
|
40
|
+
puts "Offering streamhosts " + stream.streamhosts.collect { |sh| sh.jid }.join(' ')
|
41
|
+
|
42
|
+
stream.add_streamhost_callback { |streamhost,state,e|
|
43
|
+
case state
|
44
|
+
when :connecting
|
45
|
+
puts "Connecting to #{streamhost.jid} (#{streamhost.host}:#{streamhost.port})"
|
46
|
+
when :success
|
47
|
+
puts "Successfully using #{streamhost.jid} (#{streamhost.host}:#{streamhost.port})"
|
48
|
+
when :failure
|
49
|
+
puts "Error using #{streamhost.jid} (#{streamhost.host}:#{streamhost.port}): #{e}"
|
50
|
+
end
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
stream.open
|
55
|
+
if stream.kind_of? Jabber::Bytestreams::SOCKS5BytestreamsInitiator
|
56
|
+
puts "Using streamhost #{stream.streamhost_used.jid} (#{stream.streamhost_used.host}:#{stream.streamhost_used.port})"
|
57
|
+
end
|
58
|
+
|
59
|
+
while buf = source.read
|
60
|
+
print "."
|
61
|
+
$stdout.flush
|
62
|
+
stream.write buf
|
63
|
+
stream.flush
|
64
|
+
end
|
65
|
+
puts "!"
|
66
|
+
stream.close
|
67
|
+
|
68
|
+
else
|
69
|
+
puts "Peer declined"
|
70
|
+
end
|
71
|
+
|
72
|
+
cl.close
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'thread'
|
2
|
+
|
3
|
+
class Shell
|
4
|
+
|
5
|
+
PROMPT = "_-=READY=-_"
|
6
|
+
|
7
|
+
def initialize(shell = "/bin/bash", delay = 1, &block)
|
8
|
+
@cb = block
|
9
|
+
@shell = shell
|
10
|
+
@delay = delay
|
11
|
+
@parent_to_child_read, @parent_to_child_write = IO.pipe
|
12
|
+
@child_to_parent_read, @child_to_parent_write = IO.pipe
|
13
|
+
@child_pid = fork do
|
14
|
+
@parent_to_child_write.close
|
15
|
+
@child_to_parent_read.close
|
16
|
+
$stdin.reopen(@parent_to_child_read)
|
17
|
+
$stdout.reopen(@child_to_parent_write)
|
18
|
+
$stderr.reopen(@child_to_parent_write)
|
19
|
+
exec("/bin/bash")
|
20
|
+
end
|
21
|
+
buffer = ""
|
22
|
+
semaphore = Mutex.new
|
23
|
+
Thread.new do
|
24
|
+
while true
|
25
|
+
c = @child_to_parent_read.read(1)
|
26
|
+
semaphore.synchronize { buffer += c }
|
27
|
+
end
|
28
|
+
end
|
29
|
+
Thread.new do
|
30
|
+
ch = ""
|
31
|
+
while true do
|
32
|
+
sleep @delay
|
33
|
+
semaphore.synchronize {
|
34
|
+
if buffer == ch and ch != ""
|
35
|
+
@cb.call buffer
|
36
|
+
buffer = ""
|
37
|
+
end
|
38
|
+
ch = buffer
|
39
|
+
}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def puts(str)
|
45
|
+
@parent_to_child_write.puts(str)
|
46
|
+
end
|
47
|
+
|
48
|
+
def kill
|
49
|
+
@child_pid.kill
|
50
|
+
end
|
51
|
+
end
|