metry 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +5 -0
- data/Manifest.txt +376 -0
- data/README.txt +62 -0
- data/Rakefile +23 -0
- data/TODO +10 -0
- data/example/example.rb +22 -0
- data/features/app_tracking.feature +11 -0
- data/features/basic_tracking.feature +88 -0
- data/features/sample_application.feature +12 -0
- data/features/step_definitions/tracking.rb +35 -0
- data/features/step_definitions/web.rb +31 -0
- data/features/support/env.rb +22 -0
- data/lib/metry.rb +19 -0
- data/lib/metry/experiment.rb +25 -0
- data/lib/metry/memory.rb +27 -0
- data/lib/metry/rack/tracking.rb +51 -0
- data/lib/metry/tokyo.rb +153 -0
- data/radiant/example/CHANGELOG +611 -0
- data/radiant/example/CONTRIBUTORS +168 -0
- data/radiant/example/INSTALL +38 -0
- data/radiant/example/LICENSE +21 -0
- data/radiant/example/README +60 -0
- data/radiant/example/Rakefile +21 -0
- data/radiant/example/config/boot.rb +161 -0
- data/radiant/example/config/database.yml +20 -0
- data/radiant/example/config/environment.rb +83 -0
- data/radiant/example/config/environments/cucumber.rb +18 -0
- data/radiant/example/config/environments/development.rb +17 -0
- data/radiant/example/config/environments/production.rb +19 -0
- data/radiant/example/config/environments/test.rb +36 -0
- data/radiant/example/config/routes.rb +1 -0
- data/radiant/example/db/schema.rb +112 -0
- data/radiant/example/features/metry.feature +139 -0
- data/radiant/example/features/step_definitions/experiments.rb +12 -0
- data/radiant/example/features/step_definitions/radiant.rb +14 -0
- data/radiant/example/features/step_definitions/tracking.rb +35 -0
- data/radiant/example/features/step_definitions/web.rb +22 -0
- data/radiant/example/features/support/env.rb +52 -0
- data/radiant/example/public/.htaccess +40 -0
- data/radiant/example/public/404.html +8 -0
- data/radiant/example/public/500.html +8 -0
- data/radiant/example/public/dispatch.cgi +10 -0
- data/radiant/example/public/dispatch.fcgi +24 -0
- data/radiant/example/public/dispatch.rb +10 -0
- data/radiant/example/public/favicon.ico +0 -0
- data/radiant/example/public/images/admin/add-child.png +0 -0
- data/radiant/example/public/images/admin/brown-bottom-line.gif +0 -0
- data/radiant/example/public/images/admin/clear-page-cache.png +0 -0
- data/radiant/example/public/images/admin/collapse.png +0 -0
- data/radiant/example/public/images/admin/expand.png +0 -0
- data/radiant/example/public/images/admin/layout.png +0 -0
- data/radiant/example/public/images/admin/minus.png +0 -0
- data/radiant/example/public/images/admin/new-homepage.png +0 -0
- data/radiant/example/public/images/admin/new-layout.png +0 -0
- data/radiant/example/public/images/admin/new-snippet.png +0 -0
- data/radiant/example/public/images/admin/new-user.png +0 -0
- data/radiant/example/public/images/admin/page.png +0 -0
- data/radiant/example/public/images/admin/plus.png +0 -0
- data/radiant/example/public/images/admin/remove-disabled.png +0 -0
- data/radiant/example/public/images/admin/remove.png +0 -0
- data/radiant/example/public/images/admin/snippet.png +0 -0
- data/radiant/example/public/images/admin/spinner.gif +0 -0
- data/radiant/example/public/images/admin/view-site.gif +0 -0
- data/radiant/example/public/images/admin/virtual-page.png +0 -0
- data/radiant/example/public/javascripts/admin/admin.js +149 -0
- data/radiant/example/public/javascripts/admin/ruledtable.js +13 -0
- data/radiant/example/public/javascripts/admin/sitemap.js +132 -0
- data/radiant/example/public/javascripts/admin/tabcontrol.js +133 -0
- data/radiant/example/public/javascripts/application.js +2 -0
- data/radiant/example/public/javascripts/controls.js +963 -0
- data/radiant/example/public/javascripts/dragdrop.js +973 -0
- data/radiant/example/public/javascripts/effects.js +1128 -0
- data/radiant/example/public/javascripts/pngfix.js +39 -0
- data/radiant/example/public/javascripts/prototype.js +4320 -0
- data/radiant/example/public/javascripts/string.js +17 -0
- data/radiant/example/public/robots.txt +1 -0
- data/radiant/example/public/stylesheets/admin/main.css +640 -0
- data/radiant/example/script/about +3 -0
- data/radiant/example/script/autospec +5 -0
- data/radiant/example/script/breakpointer +3 -0
- data/radiant/example/script/console +3 -0
- data/radiant/example/script/cucumber +8 -0
- data/radiant/example/script/dbconsole +3 -0
- data/radiant/example/script/extension +5 -0
- data/radiant/example/script/generate +18 -0
- data/radiant/example/script/performance/benchmarker +3 -0
- data/radiant/example/script/performance/profiler +3 -0
- data/radiant/example/script/performance/request +3 -0
- data/radiant/example/script/process/inspector +3 -0
- data/radiant/example/script/process/reaper +3 -0
- data/radiant/example/script/process/spawner +3 -0
- data/radiant/example/script/process/spinner +3 -0
- data/radiant/example/script/runner +3 -0
- data/radiant/example/script/server +3 -0
- data/radiant/example/script/spec +5 -0
- data/radiant/example/script/spec_server +116 -0
- data/radiant/example/script/version +5 -0
- data/radiant/extension/README +3 -0
- data/radiant/extension/Rakefile +120 -0
- data/radiant/extension/lib/metry_tags.rb +25 -0
- data/radiant/extension/lib/tasks/metry_extension_tasks.rake +28 -0
- data/radiant/extension/metry_extension.rb +24 -0
- data/test/shared.rb +6 -0
- data/test/test_tokyo.rb +14 -0
- data/vendor/rufus-tokyo/CHANGELOG.txt +112 -0
- data/vendor/rufus-tokyo/CREDITS.txt +27 -0
- data/vendor/rufus-tokyo/LICENSE.txt +21 -0
- data/vendor/rufus-tokyo/README.txt +310 -0
- data/vendor/rufus-tokyo/Rakefile +118 -0
- data/vendor/rufus-tokyo/TODO.txt +25 -0
- data/vendor/rufus-tokyo/doc/decision_table.numbers +0 -0
- data/vendor/rufus-tokyo/doc/rdoc-style.css +320 -0
- data/vendor/rufus-tokyo/lib/rufus-edo.rb +3 -0
- data/vendor/rufus-tokyo/lib/rufus-tokyo.rb +3 -0
- data/vendor/rufus-tokyo/lib/rufus/edo.rb +39 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/README.txt +106 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/cabcore.rb +333 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/cabinet/abstract.rb +219 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/cabinet/table.rb +159 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/error.rb +36 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/ntyrant.rb +4 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/ntyrant/abstract.rb +137 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/ntyrant/table.rb +141 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/tabcore.rb +567 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo.rb +58 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/cabinet/abstract.rb +568 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/cabinet/lib.rb +230 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/cabinet/table.rb +753 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/cabinet/util.rb +425 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/config.rb +161 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/dystopia.rb +43 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/dystopia/lib.rb +65 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/dystopia/words.rb +71 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/hmethods.rb +111 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/query.rb +102 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/transactions.rb +74 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/ttcommons.rb +59 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/tyrant.rb +35 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/tyrant/abstract.rb +146 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/tyrant/lib.rb +153 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/tyrant/table.rb +162 -0
- data/vendor/rufus-tokyo/rufus-tokyo.gemspec +25 -0
- data/vendor/rufus-tokyo/spec/cabinet_spec.rb +472 -0
- data/vendor/rufus-tokyo/spec/cabinetconfig_spec.rb +82 -0
- data/vendor/rufus-tokyo/spec/edo_cabinet_spec.rb +447 -0
- data/vendor/rufus-tokyo/spec/edo_ntyrant_spec.rb +299 -0
- data/vendor/rufus-tokyo/spec/edo_ntyrant_table_spec.rb +462 -0
- data/vendor/rufus-tokyo/spec/edo_table_spec.rb +560 -0
- data/vendor/rufus-tokyo/spec/hmethods_spec.rb +44 -0
- data/vendor/rufus-tokyo/spec/incr.lua +20 -0
- data/vendor/rufus-tokyo/spec/spec.rb +9 -0
- data/vendor/rufus-tokyo/spec/spec_base.rb +23 -0
- data/vendor/rufus-tokyo/spec/start_tyrants.sh +26 -0
- data/vendor/rufus-tokyo/spec/stop_tyrants.sh +9 -0
- data/vendor/rufus-tokyo/spec/table_spec.rb +567 -0
- data/vendor/rufus-tokyo/spec/tyrant_spec.rb +309 -0
- data/vendor/rufus-tokyo/spec/tyrant_table_spec.rb +479 -0
- data/vendor/rufus-tokyo/spec/util_list_spec.rb +200 -0
- data/vendor/rufus-tokyo/spec/util_map_spec.rb +132 -0
- data/vendor/rufus-tokyo/tasks/dev.rb +70 -0
- data/vendor/rufus-tokyo/test/bm0.rb +353 -0
- data/vendor/rufus-tokyo/test/bm1_compression.rb +54 -0
- data/vendor/rufus-tokyo/test/con0.rb +30 -0
- data/vendor/rufus-tokyo/test/mem.rb +49 -0
- data/vendor/rufus-tokyo/test/mem1.rb +44 -0
- data/vendor/rufus-tokyo/test/readme0.rb +17 -0
- data/vendor/rufus-tokyo/test/readme1.rb +21 -0
- data/vendor/rufus-tokyo/test/readme2.rb +15 -0
- data/vendor/rufus-tokyo/test/readme3.rb +24 -0
- data/vendor/rufus-tokyo/test/readmes_test.sh +17 -0
- data/vendor/webrat/.document +4 -0
- data/vendor/webrat/History.txt +358 -0
- data/vendor/webrat/MIT-LICENSE.txt +19 -0
- data/vendor/webrat/README.rdoc +85 -0
- data/vendor/webrat/Rakefile +200 -0
- data/vendor/webrat/install.rb +1 -0
- data/vendor/webrat/lib/webrat.rb +31 -0
- data/vendor/webrat/lib/webrat/core.rb +14 -0
- data/vendor/webrat/lib/webrat/core/configuration.rb +102 -0
- data/vendor/webrat/lib/webrat/core/elements/area.rb +31 -0
- data/vendor/webrat/lib/webrat/core/elements/element.rb +33 -0
- data/vendor/webrat/lib/webrat/core/elements/field.rb +411 -0
- data/vendor/webrat/lib/webrat/core/elements/form.rb +103 -0
- data/vendor/webrat/lib/webrat/core/elements/label.rb +31 -0
- data/vendor/webrat/lib/webrat/core/elements/link.rb +93 -0
- data/vendor/webrat/lib/webrat/core/elements/select_option.rb +35 -0
- data/vendor/webrat/lib/webrat/core/locators.rb +20 -0
- data/vendor/webrat/lib/webrat/core/locators/area_locator.rb +38 -0
- data/vendor/webrat/lib/webrat/core/locators/button_locator.rb +54 -0
- data/vendor/webrat/lib/webrat/core/locators/field_by_id_locator.rb +37 -0
- data/vendor/webrat/lib/webrat/core/locators/field_labeled_locator.rb +56 -0
- data/vendor/webrat/lib/webrat/core/locators/field_locator.rb +25 -0
- data/vendor/webrat/lib/webrat/core/locators/field_named_locator.rb +41 -0
- data/vendor/webrat/lib/webrat/core/locators/form_locator.rb +19 -0
- data/vendor/webrat/lib/webrat/core/locators/label_locator.rb +34 -0
- data/vendor/webrat/lib/webrat/core/locators/link_locator.rb +74 -0
- data/vendor/webrat/lib/webrat/core/locators/locator.rb +20 -0
- data/vendor/webrat/lib/webrat/core/locators/select_option_locator.rb +59 -0
- data/vendor/webrat/lib/webrat/core/logging.rb +24 -0
- data/vendor/webrat/lib/webrat/core/matchers.rb +4 -0
- data/vendor/webrat/lib/webrat/core/matchers/have_content.rb +73 -0
- data/vendor/webrat/lib/webrat/core/matchers/have_selector.rb +74 -0
- data/vendor/webrat/lib/webrat/core/matchers/have_tag.rb +21 -0
- data/vendor/webrat/lib/webrat/core/matchers/have_xpath.rb +147 -0
- data/vendor/webrat/lib/webrat/core/methods.rb +63 -0
- data/vendor/webrat/lib/webrat/core/mime.rb +29 -0
- data/vendor/webrat/lib/webrat/core/save_and_open_page.rb +48 -0
- data/vendor/webrat/lib/webrat/core/scope.rb +350 -0
- data/vendor/webrat/lib/webrat/core/session.rb +290 -0
- data/vendor/webrat/lib/webrat/core/xml.rb +115 -0
- data/vendor/webrat/lib/webrat/core/xml/hpricot.rb +19 -0
- data/vendor/webrat/lib/webrat/core/xml/nokogiri.rb +76 -0
- data/vendor/webrat/lib/webrat/core/xml/rexml.rb +24 -0
- data/vendor/webrat/lib/webrat/core_extensions/blank.rb +58 -0
- data/vendor/webrat/lib/webrat/core_extensions/deprecate.rb +8 -0
- data/vendor/webrat/lib/webrat/core_extensions/detect_mapped.rb +12 -0
- data/vendor/webrat/lib/webrat/core_extensions/meta_class.rb +6 -0
- data/vendor/webrat/lib/webrat/core_extensions/nil_to_param.rb +5 -0
- data/vendor/webrat/lib/webrat/core_extensions/tcp_socket.rb +27 -0
- data/vendor/webrat/lib/webrat/mechanize.rb +74 -0
- data/vendor/webrat/lib/webrat/merb.rb +9 -0
- data/vendor/webrat/lib/webrat/merb_multipart_support.rb +27 -0
- data/vendor/webrat/lib/webrat/merb_session.rb +80 -0
- data/vendor/webrat/lib/webrat/rack.rb +24 -0
- data/vendor/webrat/lib/webrat/rack_test.rb +32 -0
- data/vendor/webrat/lib/webrat/rails.rb +105 -0
- data/vendor/webrat/lib/webrat/rspec-rails.rb +10 -0
- data/vendor/webrat/lib/webrat/selenium.rb +81 -0
- data/vendor/webrat/lib/webrat/selenium/application_server_factory.rb +40 -0
- data/vendor/webrat/lib/webrat/selenium/application_servers.rb +5 -0
- data/vendor/webrat/lib/webrat/selenium/application_servers/base.rb +46 -0
- data/vendor/webrat/lib/webrat/selenium/application_servers/external.rb +26 -0
- data/vendor/webrat/lib/webrat/selenium/application_servers/merb.rb +50 -0
- data/vendor/webrat/lib/webrat/selenium/application_servers/rails.rb +44 -0
- data/vendor/webrat/lib/webrat/selenium/application_servers/sinatra.rb +37 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/button.js +19 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/label.js +16 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webrat.js +5 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratlink.js +12 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratlinkwithin.js +15 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratselectwithoption.js +5 -0
- data/vendor/webrat/lib/webrat/selenium/matchers.rb +4 -0
- data/vendor/webrat/lib/webrat/selenium/matchers/have_content.rb +66 -0
- data/vendor/webrat/lib/webrat/selenium/matchers/have_selector.rb +49 -0
- data/vendor/webrat/lib/webrat/selenium/matchers/have_tag.rb +72 -0
- data/vendor/webrat/lib/webrat/selenium/matchers/have_xpath.rb +45 -0
- data/vendor/webrat/lib/webrat/selenium/selenium_extensions.js +6 -0
- data/vendor/webrat/lib/webrat/selenium/selenium_rc_server.rb +84 -0
- data/vendor/webrat/lib/webrat/selenium/selenium_session.rb +248 -0
- data/vendor/webrat/lib/webrat/selenium/silence_stream.rb +18 -0
- data/vendor/webrat/lib/webrat/sinatra.rb +44 -0
- data/vendor/webrat/spec/fakes/test_session.rb +34 -0
- data/vendor/webrat/spec/integration/merb/Rakefile +35 -0
- data/vendor/webrat/spec/integration/merb/app/controllers/application.rb +2 -0
- data/vendor/webrat/spec/integration/merb/app/controllers/exceptions.rb +13 -0
- data/vendor/webrat/spec/integration/merb/app/controllers/testing.rb +27 -0
- data/vendor/webrat/spec/integration/merb/app/views/exceptions/not_acceptable.html.erb +63 -0
- data/vendor/webrat/spec/integration/merb/app/views/exceptions/not_found.html.erb +47 -0
- data/vendor/webrat/spec/integration/merb/app/views/layout/application.html.erb +12 -0
- data/vendor/webrat/spec/integration/merb/app/views/testing/show_form.html.erb +27 -0
- data/vendor/webrat/spec/integration/merb/app/views/testing/upload.html.erb +9 -0
- data/vendor/webrat/spec/integration/merb/config/environments/development.rb +15 -0
- data/vendor/webrat/spec/integration/merb/config/environments/rake.rb +11 -0
- data/vendor/webrat/spec/integration/merb/config/environments/test.rb +14 -0
- data/vendor/webrat/spec/integration/merb/config/init.rb +25 -0
- data/vendor/webrat/spec/integration/merb/config/rack.rb +11 -0
- data/vendor/webrat/spec/integration/merb/config/router.rb +34 -0
- data/vendor/webrat/spec/integration/merb/spec/spec.opts +1 -0
- data/vendor/webrat/spec/integration/merb/spec/spec_helper.rb +24 -0
- data/vendor/webrat/spec/integration/merb/spec/webrat_spec.rb +39 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/app_script.rb +31 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/common.rb +64 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/gem_ext.rb +124 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/main.thor +150 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/ops.rb +93 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/utils.rb +40 -0
- data/vendor/webrat/spec/integration/rack/Rakefile +5 -0
- data/vendor/webrat/spec/integration/rack/rack_app.rb +16 -0
- data/vendor/webrat/spec/integration/rack/test/test_helper.rb +20 -0
- data/vendor/webrat/spec/integration/rack/test/webrat_rack_test.rb +67 -0
- data/vendor/webrat/spec/integration/rails/Rakefile +30 -0
- data/vendor/webrat/spec/integration/rails/app/controllers/application.rb +15 -0
- data/vendor/webrat/spec/integration/rails/app/controllers/buttons_controller.rb +7 -0
- data/vendor/webrat/spec/integration/rails/app/controllers/fields_controller.rb +4 -0
- data/vendor/webrat/spec/integration/rails/app/controllers/links_controller.rb +7 -0
- data/vendor/webrat/spec/integration/rails/app/controllers/webrat_controller.rb +43 -0
- data/vendor/webrat/spec/integration/rails/app/helpers/buttons_helper.rb +2 -0
- data/vendor/webrat/spec/integration/rails/app/helpers/fields_helper.rb +2 -0
- data/vendor/webrat/spec/integration/rails/app/helpers/links_helper.rb +2 -0
- data/vendor/webrat/spec/integration/rails/app/views/buttons/show.html.erb +11 -0
- data/vendor/webrat/spec/integration/rails/app/views/fields/show.html.erb +9 -0
- data/vendor/webrat/spec/integration/rails/app/views/links/show.html.erb +5 -0
- data/vendor/webrat/spec/integration/rails/app/views/webrat/before_redirect_form.html.erb +4 -0
- data/vendor/webrat/spec/integration/rails/app/views/webrat/buttons.html.erb +11 -0
- data/vendor/webrat/spec/integration/rails/app/views/webrat/form.html.erb +28 -0
- data/vendor/webrat/spec/integration/rails/config/boot.rb +109 -0
- data/vendor/webrat/spec/integration/rails/config/environment.rb +12 -0
- data/vendor/webrat/spec/integration/rails/config/environments/development.rb +17 -0
- data/vendor/webrat/spec/integration/rails/config/environments/selenium.rb +22 -0
- data/vendor/webrat/spec/integration/rails/config/environments/test.rb +22 -0
- data/vendor/webrat/spec/integration/rails/config/initializers/inflections.rb +10 -0
- data/vendor/webrat/spec/integration/rails/config/initializers/mime_types.rb +5 -0
- data/vendor/webrat/spec/integration/rails/config/initializers/new_rails_defaults.rb +17 -0
- data/vendor/webrat/spec/integration/rails/config/locales/en.yml +5 -0
- data/vendor/webrat/spec/integration/rails/config/routes.rb +18 -0
- data/vendor/webrat/spec/integration/rails/public/404.html +30 -0
- data/vendor/webrat/spec/integration/rails/public/422.html +30 -0
- data/vendor/webrat/spec/integration/rails/public/500.html +33 -0
- data/vendor/webrat/spec/integration/rails/script/about +4 -0
- data/vendor/webrat/spec/integration/rails/script/console +3 -0
- data/vendor/webrat/spec/integration/rails/script/dbconsole +3 -0
- data/vendor/webrat/spec/integration/rails/script/destroy +3 -0
- data/vendor/webrat/spec/integration/rails/script/generate +3 -0
- data/vendor/webrat/spec/integration/rails/script/performance/benchmarker +3 -0
- data/vendor/webrat/spec/integration/rails/script/performance/profiler +3 -0
- data/vendor/webrat/spec/integration/rails/script/performance/request +3 -0
- data/vendor/webrat/spec/integration/rails/script/plugin +3 -0
- data/vendor/webrat/spec/integration/rails/script/process/inspector +3 -0
- data/vendor/webrat/spec/integration/rails/script/process/reaper +3 -0
- data/vendor/webrat/spec/integration/rails/script/process/spawner +3 -0
- data/vendor/webrat/spec/integration/rails/script/runner +3 -0
- data/vendor/webrat/spec/integration/rails/script/server +3 -0
- data/vendor/webrat/spec/integration/rails/test/integration/button_click_test.rb +80 -0
- data/vendor/webrat/spec/integration/rails/test/integration/fill_in_test.rb +24 -0
- data/vendor/webrat/spec/integration/rails/test/integration/link_click_test.rb +27 -0
- data/vendor/webrat/spec/integration/rails/test/integration/webrat_test.rb +97 -0
- data/vendor/webrat/spec/integration/rails/test/test_helper.rb +25 -0
- data/vendor/webrat/spec/integration/sinatra/Rakefile +5 -0
- data/vendor/webrat/spec/integration/sinatra/classic_app.rb +64 -0
- data/vendor/webrat/spec/integration/sinatra/modular_app.rb +16 -0
- data/vendor/webrat/spec/integration/sinatra/test/classic_app_test.rb +37 -0
- data/vendor/webrat/spec/integration/sinatra/test/modular_app_test.rb +18 -0
- data/vendor/webrat/spec/integration/sinatra/test/test_helper.rb +16 -0
- data/vendor/webrat/spec/private/core/configuration_spec.rb +116 -0
- data/vendor/webrat/spec/private/core/field_spec.rb +85 -0
- data/vendor/webrat/spec/private/core/link_spec.rb +24 -0
- data/vendor/webrat/spec/private/core/logging_spec.rb +10 -0
- data/vendor/webrat/spec/private/core/session_spec.rb +195 -0
- data/vendor/webrat/spec/private/mechanize/mechanize_session_spec.rb +81 -0
- data/vendor/webrat/spec/private/merb/attaches_file_spec.rb +93 -0
- data/vendor/webrat/spec/private/merb/merb_session_spec.rb +61 -0
- data/vendor/webrat/spec/private/nokogiri_spec.rb +77 -0
- data/vendor/webrat/spec/private/rails/attaches_file_spec.rb +81 -0
- data/vendor/webrat/spec/private/rails/rails_session_spec.rb +110 -0
- data/vendor/webrat/spec/private/selenium/application_servers/rails_spec.rb +26 -0
- data/vendor/webrat/spec/public/basic_auth_spec.rb +24 -0
- data/vendor/webrat/spec/public/check_spec.rb +191 -0
- data/vendor/webrat/spec/public/choose_spec.rb +118 -0
- data/vendor/webrat/spec/public/click_area_spec.rb +106 -0
- data/vendor/webrat/spec/public/click_button_spec.rb +496 -0
- data/vendor/webrat/spec/public/click_link_spec.rb +511 -0
- data/vendor/webrat/spec/public/fill_in_spec.rb +209 -0
- data/vendor/webrat/spec/public/locators/field_by_xpath_spec.rb +19 -0
- data/vendor/webrat/spec/public/locators/field_labeled_spec.rb +172 -0
- data/vendor/webrat/spec/public/locators/field_with_id_spec.rb +16 -0
- data/vendor/webrat/spec/public/matchers/contain_spec.rb +114 -0
- data/vendor/webrat/spec/public/matchers/have_selector_spec.rb +142 -0
- data/vendor/webrat/spec/public/matchers/have_tag_spec.rb +39 -0
- data/vendor/webrat/spec/public/matchers/have_xpath_spec.rb +136 -0
- data/vendor/webrat/spec/public/reload_spec.rb +10 -0
- data/vendor/webrat/spec/public/save_and_open_spec.rb +70 -0
- data/vendor/webrat/spec/public/select_date_spec.rb +112 -0
- data/vendor/webrat/spec/public/select_datetime_spec.rb +137 -0
- data/vendor/webrat/spec/public/select_spec.rb +249 -0
- data/vendor/webrat/spec/public/select_time_spec.rb +100 -0
- data/vendor/webrat/spec/public/selenium/application_server_factory_spec.rb +49 -0
- data/vendor/webrat/spec/public/selenium/application_servers/external_spec.rb +12 -0
- data/vendor/webrat/spec/public/selenium/selenium_session_spec.rb +37 -0
- data/vendor/webrat/spec/public/set_hidden_field_spec.rb +5 -0
- data/vendor/webrat/spec/public/submit_form_spec.rb +5 -0
- data/vendor/webrat/spec/public/visit_spec.rb +58 -0
- data/vendor/webrat/spec/public/within_spec.rb +177 -0
- data/vendor/webrat/spec/rcov.opts +1 -0
- data/vendor/webrat/spec/spec.opts +2 -0
- data/vendor/webrat/spec/spec_helper.rb +50 -0
- data/vendor/webrat/vendor/selenium-server.jar +0 -0
- metadata +442 -0
data/test/shared.rb
ADDED
data/test/test_tokyo.rb
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/shared'
|
|
2
|
+
|
|
3
|
+
class TestTokyo < Test::Unit::TestCase
|
|
4
|
+
context "An empty database" do
|
|
5
|
+
setup do
|
|
6
|
+
@tokyo = Metry::Tokyo.new('test')
|
|
7
|
+
@tokyo.clear
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
should "be empty" do
|
|
11
|
+
assert_equal 0, @tokyo.event_count
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
|
|
2
|
+
= rufus-tokyo CHANGELOG.txt
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
== rufus-tokyo - 0.1.14 not yet released
|
|
6
|
+
|
|
7
|
+
- issue #2 : query#add with no_index=false by default
|
|
8
|
+
- issue #1 : added query#delete and table#query_delete
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
== rufus-tokyo - 0.1.13 released 2009/06/02
|
|
12
|
+
|
|
13
|
+
- todo : putkeep implementation (by Kamal)
|
|
14
|
+
- todo : support for binary data (map, list, cabinet, table, tokyo/edo)
|
|
15
|
+
- todo : added #defrag to Rufus::Tokyo::Cabinet
|
|
16
|
+
- todo : added :dfunit to databases that support it
|
|
17
|
+
- todo : added #addint and #adddouble (#incr)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
== rufus-tokyo - 0.1.12 released 2009/04/07
|
|
21
|
+
|
|
22
|
+
- todo : added ext method for calling embedded Lua function (Tyrant)
|
|
23
|
+
- todo : added transaction support for Rufus::Tokyo::Cabinet
|
|
24
|
+
- todo : mimicking query.count in rufus/edo
|
|
25
|
+
- todo : implemented query.count (TC 1.4.12 and TT 1.1.20 only) rufus/tokyo
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
== rufus-tokyo - 0.1.11 released 2009/03/25
|
|
29
|
+
|
|
30
|
+
- todo : autodetecting /usr/lib/libtokyocabinet.so and
|
|
31
|
+
/usr/lib/libtokyotyrant.so (thanks mebaran)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
== rufus-tokyo - 0.1.10 released 2009/03/19
|
|
35
|
+
|
|
36
|
+
- bug : had to adapt to TC 1.4.10 and TT 1.1.17 new "setlimit"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
== rufus-tokyo - 0.1.9 released 2009/02/27
|
|
40
|
+
|
|
41
|
+
- bug : sudo gem install rufus-tokyo was failing because of
|
|
42
|
+
lib/tokyotyrant.rb. Fixed.
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
== rufus-tokyo - 0.1.8 released 2009/02/27
|
|
46
|
+
|
|
47
|
+
- added : support for Hirabayashi-san 'native' Ruby classes via Rufus::Edo
|
|
48
|
+
- todo : implemented #delete_keys_with_prefix (naive impl for tables)
|
|
49
|
+
- added : lget/ldelete and merge! to Rufus::Tokyo::Cabinet and ::Tyrant
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
== rufus-tokyo - 0.1.7 released 2009/02/19
|
|
53
|
+
|
|
54
|
+
- todo : Rufus::Tokyo::Cabinet.new('filename', :type => :hash) now OK (Zev)
|
|
55
|
+
- todo : more documentation for Rufus::Tokyo::Cabinet#new
|
|
56
|
+
- added : Rufus::Tokyo::Cabinet has a open method that takes a block like
|
|
57
|
+
File.open (Zev)
|
|
58
|
+
- todo : aligned Rufus::Tokyo::Table#new on ::Cabinet#new
|
|
59
|
+
- todo : added opts (:prefix, :limit, :native) to Rufus::Tokyo::Cabinet#keys,
|
|
60
|
+
Rufus::Tokyo::Table#keys and the corresponding Tyrant classes
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
== rufus-tokyo - 0.1.6 released 2009/02/16
|
|
64
|
+
|
|
65
|
+
- todo : Tyrant and TyrantTable now complain when used in lieu of each other
|
|
66
|
+
- todo : implemented Tyrant and TyrantTable #stat
|
|
67
|
+
- todo : made tran begin/abort/commit directly available (framework builders)
|
|
68
|
+
- todo : implemented Rufus::Tokyo::Table#transaction
|
|
69
|
+
- bug : JRuby support back in
|
|
70
|
+
- todo : implemented Rufus::Tokyo::Map#[] (class method)
|
|
71
|
+
- todo : simplified Table and TyrantTable #[]=
|
|
72
|
+
- bug : preventing table#[]= from segfaulting on bad input (Justin)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
== rufus-tokyo - 0.1.5 released 2009/02/13
|
|
76
|
+
|
|
77
|
+
- todo : implemented set_index (cabinet / tyrant tables)
|
|
78
|
+
- todo : namespace simplification (Justin)
|
|
79
|
+
- todo : implemented Rufus::Tokyo::TyrantTable
|
|
80
|
+
- todo : implemented Rufus::Tokyo::Tyrant
|
|
81
|
+
- todo : moved tests to bacon (spec/)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
== rufus-tokyo - 0.1.4 released 2009/02/02
|
|
85
|
+
|
|
86
|
+
- todo #23780 : hmethods for Rufus::Tokyo::Table
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
== rufus-tokyo - 0.1.3 released 2009/01/29
|
|
90
|
+
|
|
91
|
+
- todo : implemented Rufus::Tokyo::Table (and query)
|
|
92
|
+
- todo : implemented Rufus::Tokyo::List
|
|
93
|
+
- todo : implemented Rufus::Tokyo::Map
|
|
94
|
+
- todo : implemented Cabinet#compact_copy
|
|
95
|
+
- todo : implemented Cabinet#copy
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
== rufus-tokyo - 0.1.2 released 2009/01/23
|
|
99
|
+
|
|
100
|
+
- todo : implemented Cabinet#keys and #values
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
== rufus-tokyo - 0.1.1 released 2009/01/23
|
|
104
|
+
|
|
105
|
+
- bug : fixed dependency, it's ffi not ruby-ffi
|
|
106
|
+
- todo : implemented Cabinet#clear
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
== rufus-tokyo - 0.1.0 released 2009/01/23
|
|
110
|
+
|
|
111
|
+
- initial release
|
|
112
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
= CREDITS.txt rufus-tokyo gem
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
== authors
|
|
6
|
+
|
|
7
|
+
John Mettraux http://jmettraux.wordpress.com
|
|
8
|
+
Zev Blut http://www.iknow.co.jp/users/zev
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
== contributors
|
|
12
|
+
|
|
13
|
+
Matthew King http://github.com/automatthew
|
|
14
|
+
Kamal Fariz Mahyuddin http://github.com/kamal
|
|
15
|
+
Justin Reagor http://blog.kineticweb.com/
|
|
16
|
+
Benjami Yu http://github.com/byu
|
|
17
|
+
Mark 'mebaran' http://github.com/mebaran
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
== finally
|
|
21
|
+
|
|
22
|
+
many thanks to the author of Tokyo Cabinet (Mikio Hirabayashi) and
|
|
23
|
+
the authors of ruby-ffi
|
|
24
|
+
|
|
25
|
+
http://tokyocabinet.sourceforge.net
|
|
26
|
+
http://kenai.com/projects/ruby-ffi
|
|
27
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
Copyright (c) 2009, John Mettraux, jmettraux@gmail.com
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in
|
|
12
|
+
all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
20
|
+
THE SOFTWARE.
|
|
21
|
+
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
|
|
2
|
+
= rufus-tokyo
|
|
3
|
+
|
|
4
|
+
ruby-ffi based interface to Tokyo Cabinet and Tokyo Tyrant.
|
|
5
|
+
|
|
6
|
+
The 'abstract' and the 'table' API are covered for now.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
== installation
|
|
10
|
+
|
|
11
|
+
sudo gem install rufus-tokyo
|
|
12
|
+
|
|
13
|
+
(see after 'usage' for how to install Tokyo Cabinet (and Tyrant) if required)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
== Rufus::Edo
|
|
17
|
+
|
|
18
|
+
Note : Rufus::Tokyo focuses on leveraging Hirabayashi-san's C libraries via ruby-ffi, but the gem rufus-tokyo also contains Rufus::Edo which wraps the Tokyo Cabinet/Tyrant author's [native] C bindings :
|
|
19
|
+
|
|
20
|
+
http://github.com/jmettraux/rufus-tokyo/tree/master/lib/rufus/edo
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
== usage
|
|
24
|
+
|
|
25
|
+
hereafter TC references Tokyo Cabinet, while TT references Tokyo Tyrant.
|
|
26
|
+
|
|
27
|
+
the rdoc is at http://rufus.rubyforge.org/rufus-tokyo/
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
== version [mis]match
|
|
31
|
+
|
|
32
|
+
this version of rufus-tokyo works with
|
|
33
|
+
|
|
34
|
+
ffi 0.3.1, 0.3.5
|
|
35
|
+
|
|
36
|
+
ruby 1.8.6
|
|
37
|
+
ruby 1.9.1p0
|
|
38
|
+
jruby 1.1.6
|
|
39
|
+
jruby 1.2.0
|
|
40
|
+
|
|
41
|
+
TC 1.4.9 and TT 1.1.16
|
|
42
|
+
TC 1.4.10 and TT 1.1.17 (adds the offset arg to query.limit)
|
|
43
|
+
TC 1.4.11 and TT 1.1.18
|
|
44
|
+
TC 1.4.13 and TT 1.1.22 (added query.count)
|
|
45
|
+
TC 1.4.21 and TT 1.1.27
|
|
46
|
+
|
|
47
|
+
tc-ruby 1.20 and tt-ruby 1.3 (Rufus::Edo)
|
|
48
|
+
tc-ruby 1.21 and tt-ruby 1.5 (Rufus::Edo)
|
|
49
|
+
tc-ruby 1.21 and tt-ruby 1.7 (Rufus::Edo)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
=== TC Abstract API
|
|
53
|
+
|
|
54
|
+
http://tokyocabinet.sourceforge.net/spex-en.html#tcadbapi
|
|
55
|
+
|
|
56
|
+
to create a hash (file named 'data.tch')
|
|
57
|
+
|
|
58
|
+
require 'rubygems'
|
|
59
|
+
require 'rufus/tokyo'
|
|
60
|
+
|
|
61
|
+
db = Rufus::Tokyo::Cabinet.new('data.tch')
|
|
62
|
+
|
|
63
|
+
db['nada'] = 'surf'
|
|
64
|
+
|
|
65
|
+
p db['nada'] # => 'surf'
|
|
66
|
+
p db['lost'] # => nil
|
|
67
|
+
|
|
68
|
+
5000.times { |i| db[i.to_s] = "x" }
|
|
69
|
+
|
|
70
|
+
p db.inject { |r, (k, v)| k } # => 4999
|
|
71
|
+
|
|
72
|
+
db.close
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
=== TC Table API
|
|
76
|
+
|
|
77
|
+
http://tokyocabinet.sourceforge.net/spex-en.html#tctdbapi
|
|
78
|
+
|
|
79
|
+
require 'rubygems'
|
|
80
|
+
require 'rufus/tokyo'
|
|
81
|
+
|
|
82
|
+
t = Rufus::Tokyo::Table.new('table.tct')
|
|
83
|
+
|
|
84
|
+
t['pk0'] = { 'name' => 'alfred', 'age' => '22' }
|
|
85
|
+
t['pk1'] = { 'name' => 'bob', 'age' => '18' }
|
|
86
|
+
t['pk2'] = { 'name' => 'charly', 'age' => '45' }
|
|
87
|
+
t['pk3'] = { 'name' => 'doug', 'age' => '77' }
|
|
88
|
+
t['pk4'] = { 'name' => 'ephrem', 'age' => '32' }
|
|
89
|
+
|
|
90
|
+
p t.query { |q|
|
|
91
|
+
q.add_condition 'age', :numge, '32'
|
|
92
|
+
q.order_by 'age'
|
|
93
|
+
}
|
|
94
|
+
# => [ {"name"=>"ephrem", :pk=>"pk4", "age"=>"32"},
|
|
95
|
+
# {"name"=>"charly", :pk=>"pk2", "age"=>"45"} ]
|
|
96
|
+
|
|
97
|
+
t.close
|
|
98
|
+
|
|
99
|
+
Note that the Tokyo Cabinet Table API does support transactions :
|
|
100
|
+
|
|
101
|
+
p t.size
|
|
102
|
+
# => 0
|
|
103
|
+
|
|
104
|
+
t.transaction do
|
|
105
|
+
t['pk0'] = { 'name' => 'alfred', 'age' => '22' }
|
|
106
|
+
t['pk1'] = { 'name' => 'bob', 'age' => '18' }
|
|
107
|
+
t.abort
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
p t.size
|
|
111
|
+
# => 0
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
=== TT remote db
|
|
115
|
+
|
|
116
|
+
http://tokyocabinet.sourceforge.net/tyrantdoc/
|
|
117
|
+
|
|
118
|
+
to start a ttserver (backed by a hash), on the command line
|
|
119
|
+
|
|
120
|
+
ttserver -port 45001 data.tch
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
then, in Ruby :
|
|
124
|
+
|
|
125
|
+
require 'rubygems'
|
|
126
|
+
require 'rufus/tokyo/tyrant'
|
|
127
|
+
|
|
128
|
+
db = Rufus::Tokyo::Tyrant.new('localhost', 45001)
|
|
129
|
+
|
|
130
|
+
db['nada'] = 'surf'
|
|
131
|
+
|
|
132
|
+
p db['nada'] # => 'surf'
|
|
133
|
+
p db['lost'] # => nil
|
|
134
|
+
|
|
135
|
+
db.close
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
Rufus::Tokyo::Tyrant instances have a #stat method :
|
|
139
|
+
|
|
140
|
+
puts db.stat.inject('') { |s, (k, v)| s << "#{k} => #{v}\n" }
|
|
141
|
+
# =>
|
|
142
|
+
# pid => 7566
|
|
143
|
+
# loadavg => 0.398438
|
|
144
|
+
# size => 528736
|
|
145
|
+
# rnum => 0
|
|
146
|
+
# time => 1234764065.305923
|
|
147
|
+
# sid => 898521513
|
|
148
|
+
# type => hash
|
|
149
|
+
# bigend => 0
|
|
150
|
+
# ru_sys => 3.398698
|
|
151
|
+
# version => 1.1.15
|
|
152
|
+
# ru_user => 2.155215
|
|
153
|
+
# ru_real => 3218.451152
|
|
154
|
+
# fd => 7
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
Note that it's also OK to make a Tokyo Tyrant server listen on a unix socket :
|
|
158
|
+
|
|
159
|
+
ttserver -host /tmp/ttsocket -port 0 data.tch
|
|
160
|
+
|
|
161
|
+
and then :
|
|
162
|
+
|
|
163
|
+
require 'rubygems'
|
|
164
|
+
require 'rufus/tokyo/tyrant'
|
|
165
|
+
db = Rufus::Tokyo::Tyrant.new('/tmp/ttsocket')
|
|
166
|
+
db['a'] = 'alpha'
|
|
167
|
+
db.close
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
=== TT remote table
|
|
171
|
+
|
|
172
|
+
to start a ttserver (backed by a table), on the command line :
|
|
173
|
+
|
|
174
|
+
ttserver -port 45002 data.tct
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
then, in Ruby, much like a local table :
|
|
178
|
+
|
|
179
|
+
require 'rubygems'
|
|
180
|
+
require 'rufus/tokyo/tyrant'
|
|
181
|
+
|
|
182
|
+
t = Rufus::Tokyo::TyrantTable.new('localhost', 45002)
|
|
183
|
+
|
|
184
|
+
t['pk0'] = { 'name' => 'alfred', 'age' => '22' }
|
|
185
|
+
t['pk1'] = { 'name' => 'bob', 'age' => '18' }
|
|
186
|
+
t['pk2'] = { 'name' => 'charly', 'age' => '45' }
|
|
187
|
+
t['pk3'] = { 'name' => 'doug', 'age' => '77' }
|
|
188
|
+
t['pk4'] = { 'name' => 'ephrem', 'age' => '32' }
|
|
189
|
+
|
|
190
|
+
p t.query { |q|
|
|
191
|
+
q.add_condition 'age', :numge, '32'
|
|
192
|
+
q.order_by 'age'
|
|
193
|
+
}
|
|
194
|
+
# => [ {"name"=>"ephrem", :pk=>"pk4", "age"=>"32"},
|
|
195
|
+
# {"name"=>"charly", :pk=>"pk2", "age"=>"45"} ]
|
|
196
|
+
|
|
197
|
+
t.close
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
Rufus::Tokyo::TyrantTable instances have a #stat method :
|
|
201
|
+
|
|
202
|
+
puts t.stat.inject('') { |s, (k, v)| s << "#{k} => #{v}\n" }
|
|
203
|
+
# =>
|
|
204
|
+
# pid => 7569
|
|
205
|
+
# loadavg => 0.295410
|
|
206
|
+
# size => 935792
|
|
207
|
+
# rnum => 0
|
|
208
|
+
# time => 1234764228.942014
|
|
209
|
+
# sid => 1027604232
|
|
210
|
+
# type => table
|
|
211
|
+
# bigend => 0
|
|
212
|
+
# ru_sys => 5.966750
|
|
213
|
+
# version => 1.1.15
|
|
214
|
+
# ru_user => 2.601947
|
|
215
|
+
# ru_real => 3382.084479
|
|
216
|
+
# fd => 10
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
Note that it's also OK to make a Tokyo Tyrant server listen on a unix socket :
|
|
220
|
+
|
|
221
|
+
ttserver -host /tmp/tttsocket -port 0 data.tct
|
|
222
|
+
|
|
223
|
+
and then :
|
|
224
|
+
|
|
225
|
+
require 'rubygems'
|
|
226
|
+
require 'rufus/tokyo/tyrant'
|
|
227
|
+
t = Rufus::Tokyo::TyrantTable.new('/tmp/tttsocket')
|
|
228
|
+
t['customer0'] = { 'name' => 'Heike no Kyomori', 'age' => '75' }
|
|
229
|
+
t.close
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
== rdoc
|
|
233
|
+
|
|
234
|
+
more in the rdoc
|
|
235
|
+
|
|
236
|
+
http://rufus.rubyforge.org/rufus-tokyo/
|
|
237
|
+
http://rufus.rubyforge.org/rufus-tokyo/classes/Rufus/Tokyo/Cabinet.html
|
|
238
|
+
http://rufus.rubyforge.org/rufus-tokyo/classes/Rufus/Tokyo/Table.html
|
|
239
|
+
http://rufus.rubyforge.org/rufus-tokyo/classes/Rufus/Tokyo/Tyrant.html
|
|
240
|
+
http://rufus.rubyforge.org/rufus-tokyo/classes/Rufus/Tokyo/TyrantTable.html
|
|
241
|
+
|
|
242
|
+
don't hesitate to "man ttserver" on the command line.
|
|
243
|
+
|
|
244
|
+
or directly in the source
|
|
245
|
+
|
|
246
|
+
http://github.com/jmettraux/rufus-tokyo/blob/master/lib/rufus/tokyo/cabinet/abstract.rb
|
|
247
|
+
http://github.com/jmettraux/rufus-tokyo/blob/master/lib/rufus/tokyo/cabinet/table.rb
|
|
248
|
+
http://github.com/jmettraux/rufus-tokyo/blob/master/lib/rufus/tokyo/tyrant/abstract.rb
|
|
249
|
+
http://github.com/jmettraux/rufus-tokyo/blob/master/lib/rufus/tokyo/tyrant/table.rb
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
== Tokyo Cabinet / Tyrant install
|
|
253
|
+
|
|
254
|
+
a compilation of notes is available at :
|
|
255
|
+
|
|
256
|
+
http://openwferu.rubyforge.org/tokyo.html
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
== dependencies
|
|
260
|
+
|
|
261
|
+
the ruby gem 'ffi'
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
== mailing list
|
|
265
|
+
|
|
266
|
+
On the rufus-ruby list :
|
|
267
|
+
|
|
268
|
+
http://groups.google.com/group/rufus-ruby
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
== issue tracker
|
|
272
|
+
|
|
273
|
+
http://github.com/jmettraux/rufus-tokyo/issues/
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
== irc
|
|
277
|
+
|
|
278
|
+
irc.freenode.net #ruote
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
== source
|
|
282
|
+
|
|
283
|
+
http://github.com/jmettraux/rufus-tokyo
|
|
284
|
+
|
|
285
|
+
git clone git://github.com/jmettraux/rufus-tokyo.git
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
== credits
|
|
289
|
+
|
|
290
|
+
many thanks to the author of Tokyo Cabinet, Mikio Hirabayashi, and to the authors of ruby-ffi
|
|
291
|
+
|
|
292
|
+
http://tokyocabinet.sourceforge.net
|
|
293
|
+
http://kenai.com/projects/ruby-ffi
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
== authors
|
|
297
|
+
|
|
298
|
+
John Mettraux, jmettraux@gmail.com, http://jmettraux.wordpress.com
|
|
299
|
+
Zev Blut, http://www.iknow.co.jp/users/zev
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
== the rest of Rufus
|
|
303
|
+
|
|
304
|
+
http://rufus.rubyforge.org
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
== license
|
|
308
|
+
|
|
309
|
+
MIT
|
|
310
|
+
|