rtml 1.2.2 → 2.0.0.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +2 -2
- data/Manifest.txt +199 -389
- data/PostInstall.txt +6 -1
- data/README.rdoc +111 -26
- data/Rakefile +29 -33
- data/app_generators/rtml/USAGE +2 -2
- data/app_generators/rtml/rtml_generator.rb +2 -2
- data/app_generators/rtml/templates/rtml_template.rb +26 -0
- data/bin/rtml +2 -2
- data/builtin/controllers/rtml_controller.rb +58 -0
- data/builtin/models/rtml/document.rb +150 -0
- data/builtin/models/rtml/dom/element.rb +196 -0
- data/builtin/models/rtml/dom/frontend_element.rb +48 -0
- data/builtin/models/rtml/dom/property.rb +71 -0
- data/builtin/models/rtml/dom/screen_element.rb +14 -0
- data/builtin/models/rtml/instruction.rb +52 -0
- data/builtin/models/rtml/instruction/follow_class_methods.rb +101 -0
- data/builtin/models/rtml/state.rb +20 -0
- data/builtin/models/rtml/state/variable_mapping.rb +13 -0
- data/builtin/models/rtml/view.rb +5 -0
- data/builtin/rtml_helpers/rtml/get_state.rb +23 -0
- data/builtin/rtml_helpers/rtml/rescue_action.rb +25 -0
- data/builtin/views/rtml/rescue_action_in_public.rtml.erb +1 -0
- data/builtin/views/rtml/rescue_action_locally.rtml.erb +29 -0
- data/builtin/widgets/default_document.rb +25 -0
- data/builtin/widgets/document_variable_processing.rb +133 -0
- data/builtin/widgets/element_builder.rb +148 -0
- data/builtin/widgets/event_listener.rb +41 -0
- data/builtin/widgets/frontend.rb +71 -0
- data/builtin/widgets/highlevel_variable_processing.rb +130 -0
- data/builtin/widgets/screen_variable_processing.rb +63 -0
- data/builtin/widgets/screen_variants.rb +110 -0
- data/builtin/widgets/screens.rb +73 -0
- data/builtin/widgets/shorthand.rb +49 -0
- data/builtin/widgets/static_content.rb +51 -0
- data/builtin/widgets/subroutine.rb +54 -0
- data/generators/rtml_widget/USAGE +19 -0
- data/generators/rtml_widget/rtml_widget_generator.rb +59 -0
- data/generators/rtml_widget/templates/default_widget.erb +10 -0
- data/generators/rtml_widget/templates/default_widget.feature.erb +11 -0
- data/generators/rtml_widget/templates/default_widget_spec.erb +13 -0
- data/generators/rtml_widget/templates/default_widget_test.erb +13 -0
- data/lib/extensions/action_controller/response.rb +30 -0
- data/lib/extensions/action_controller/routing/route_set.rb +42 -0
- data/lib/extensions/active_support/test_case.rb +3 -0
- data/lib/extensions/hpricot/doc.rb +5 -0
- data/lib/extensions/hpricot/elem.rb +5 -0
- data/lib/extensions/string.rb +35 -0
- data/lib/rtml.rb +88 -2
- data/lib/rtml/configuration.rb +40 -0
- data/lib/rtml/controller/before_filters.rb +51 -0
- data/lib/rtml/controller/cache_helpers.rb +26 -0
- data/lib/rtml/controller/class_methods/rtml_action_helpers.rb +18 -0
- data/lib/rtml/controller/document_generator.rb +60 -0
- data/lib/rtml/controller/render_helpers.rb +29 -0
- data/lib/rtml/controller/rtml_helpers.rb +37 -0
- data/lib/rtml/controller/state.rb +73 -0
- data/lib/rtml/controller/template_helpers.rb +21 -0
- data/lib/rtml/controller/url_helpers.rb +9 -0
- data/lib/rtml/dependencies.rb +27 -0
- data/lib/rtml/dsl.rb +81 -0
- data/lib/rtml/environment.rb +28 -0
- data/lib/rtml/errors/invalid_format.rb +4 -0
- data/lib/rtml/errors/invalid_operation.rb +4 -0
- data/lib/rtml/errors/invalid_option_error.rb +4 -0
- data/lib/rtml/errors/missing_document_error.rb +4 -0
- data/lib/rtml/errors/missing_variable_error.rb +4 -0
- data/lib/rtml/errors/multiple_roots_error.rb +4 -0
- data/lib/rtml/errors/processing_error.rb +4 -0
- data/lib/rtml/errors/rules_violation_error.rb +4 -0
- data/lib/rtml/errors/screen_not_found.rb +4 -0
- data/lib/rtml/errors/screen_variant_error.rb +4 -0
- data/lib/rtml/errors/sti_type_error.rb +4 -0
- data/lib/rtml/errors/subprocessing_not_supported.rb +4 -0
- data/lib/rtml/errors/unknown_rtml_action.rb +4 -0
- data/lib/rtml/high_level/managed_variable.rb +72 -0
- data/lib/rtml/high_level/subroutine.rb +22 -0
- data/lib/rtml/high_level/variable_manager.rb +35 -0
- data/lib/rtml/inherited_instance_variables.rb +25 -0
- data/lib/rtml/init.rb +82 -0
- data/lib/rtml/reverse_engineering/crawler.rb +58 -0
- data/lib/rtml/reverse_engineering/simulator.rb +269 -0
- data/lib/rtml/reverse_engineering/simulator/casting.rb +9 -0
- data/lib/rtml/reverse_engineering/simulator/snapshot.rb +18 -0
- data/lib/rtml/reverse_engineering/simulator/variable_lookup.rb +32 -0
- data/lib/rtml/reverse_engineering/simulator/variable_value.rb +105 -0
- data/lib/rtml/rules/dom_ruleset.rb +166 -0
- data/lib/rtml/rules/dom_tag.rb +43 -0
- data/lib/rtml/rules/dom_validation.rb +162 -0
- data/{app_generators/rtml/templates/rtml/lib/rtml → lib/rtml/rules}/tml_param_parser.rb +14 -15
- data/lib/rtml/test/spec.rb +14 -0
- data/lib/rtml/tmlized_conditions.rb +37 -0
- data/lib/rtml/version.rb +10 -0
- data/lib/rtml/widget.rb +150 -0
- data/lib/rtml/widget_core/class_methods.rb +193 -0
- data/lib/rtml/widget_core/gui_configuration.rb +94 -0
- data/lib/rtml/widget_core/widget_accessor_class_methods.rb +12 -0
- data/lib/rtml/widget_core/widget_accessor_instance_methods.rb +19 -0
- data/lib/rtml/widget_core/widget_proxy.rb +70 -0
- data/lib/rtml/widgets.rb +112 -0
- data/lib/rtml_routes.rb +3 -0
- data/rails/init.rb +6 -0
- data/rails_generators/rtml/USAGE +19 -0
- data/rails_generators/rtml/rtml_generator.rb +64 -0
- data/rails_generators/rtml/templates/config/initializers/rtml.rb +13 -0
- data/rails_generators/rtml/templates/config/tml_dom_ruleset.rb +81 -0
- data/rails_generators/rtml/templates/db/migrate/20100108163703_create_rtml_dom_elements.rb +16 -0
- data/rails_generators/rtml/templates/db/migrate/20100108163827_create_rtml_dom_properties.rb +16 -0
- data/rails_generators/rtml/templates/db/migrate/20100108165127_create_rtml_documents.rb +15 -0
- data/rails_generators/rtml/templates/db/migrate/20100110060124_create_rtml_instructions.rb +15 -0
- data/rails_generators/rtml/templates/db/migrate/20100110071920_add_parent_id_to_rtml_instructions.rb +9 -0
- data/rails_generators/rtml/templates/db/migrate/20100113131401_add_options_to_properties.rb +9 -0
- data/rails_generators/rtml/templates/db/migrate/20100127173146_add_parent_type_to_rtml_dom_elements.rb +9 -0
- data/rails_generators/rtml/templates/db/migrate/20100208114234_create_rtml_states.rb +20 -0
- data/rails_generators/rtml/templates/db/migrate/20100303021609_add_x_and_y_to_rtml_instructions.rb +12 -0
- data/rails_generators/rtml/templates/doc/io_tml-application-development-guidelines.pdf +0 -0
- data/rails_generators/rtml/templates/lib/tasks/rtml.rake +65 -0
- data/rails_generators/rtml_action/USAGE +15 -0
- data/rails_generators/rtml_action/rtml_action_generator.rb +51 -0
- data/rails_generators/rtml_action/templates/action.erb +12 -0
- data/rails_generators/rtml_action/templates/view.erb +2 -0
- data/rails_generators/widget/USAGE +19 -0
- data/rails_generators/widget/templates/default_widget.erb +10 -0
- data/rails_generators/widget/templates/default_widget.feature.erb +11 -0
- data/rails_generators/widget/templates/default_widget_spec.erb +13 -0
- data/rails_generators/widget/templates/default_widget_test.erb +13 -0
- data/rails_generators/widget/widget_generator.rb +48 -0
- data/script/console +5 -2
- data/script/server +3 -0
- data/spec/controllers/inherited_controller_spec.rb +19 -0
- data/spec/controllers/rtml_controller_spec.rb +94 -0
- data/spec/lib/extensions/hpricot/doc_spec.rb +6 -0
- data/spec/lib/extensions/hpricot/elem_spec.rb +6 -0
- data/spec/lib/extensions/string_spec.rb +5 -0
- data/spec/lib/rtml/extensions_spec.rb +12 -0
- data/spec/lib/rtml/reverse_engineering/crawler_spec.rb +24 -0
- data/spec/lib/rtml/reverse_engineering/simulator/variable_value_spec.rb +120 -0
- data/spec/lib/rtml/reverse_engineering/simulator_spec.rb +96 -0
- data/spec/lib/rtml/routes_spec.rb +51 -0
- data/spec/lib/rtml/rules/dom_ruleset_spec.rb +54 -0
- data/spec/lib/rtml/rules/dom_validation_spec.rb +112 -0
- data/spec/lib/rtml/widget_core/generic_widget_consumer_spec.rb +28 -0
- data/spec/lib/rtml/widget_core/gui_configuration_spec.rb +109 -0
- data/spec/lib/rtml/widget_core/widget_proxy_spec.rb +31 -0
- data/spec/lib/rtml/widget_spec.rb +57 -0
- data/spec/lib/rtml/widgets_spec.rb +7 -0
- data/spec/models/rtml/document_spec.rb +97 -0
- data/spec/models/rtml/dom/element_spec.rb +14 -0
- data/spec/models/rtml/dom/frontend_element_spec.rb +22 -0
- data/spec/models/rtml/dom/property_spec.rb +28 -0
- data/spec/models/rtml/dom/screen_element_spec.rb +11 -0
- data/spec/models/rtml/instruction_spec.rb +45 -0
- data/spec/models/rtml/state/variable_mapping_spec.rb +9 -0
- data/spec/models/rtml/state_spec.rb +8 -0
- data/spec/rcov.opts +3 -0
- data/spec/spec.opts +5 -0
- data/spec/spec_helper.rb +45 -0
- data/spec/support/app/controllers/application_controller.rb +2 -0
- data/spec/support/app/controllers/inherited_controller.rb +8 -0
- data/spec/support/app/rtml_helpers/inherited/index.rb +10 -0
- data/spec/support/app/rtml_helpers/rtml/index.rb +14 -0
- data/spec/support/app/views/README.txt +6 -0
- data/spec/support/app/views/layouts/layout.rtml.erb +3 -0
- data/spec/support/app/views/magcard/_partial.erb +1 -0
- data/spec/support/app/views/magcard/main.rtml.erb +1 -0
- data/spec/support/app/views/rtml/index.html.erb +9 -0
- data/spec/support/app/views/rtml/index/main.rtml.erb +1 -0
- data/spec/support/config/database.yml +17 -0
- data/spec/support/config/environment.rb +1 -0
- data/{app_generators/rtml/templates/rtml/public/stylesheets/rtml/charts.css → spec/support/config/environments/development.rb} +0 -0
- data/spec/support/config/initializers/rtml.rb +6 -0
- data/spec/support/config/routes.rb +3 -0
- data/spec/support/config/tml_dom_ruleset.rb +82 -0
- data/spec/support/db/rtml_test_db.sqlite3 +0 -0
- data/spec/support/db/schema.rb +14 -0
- data/spec/support/lib/rtml/widgets/test_widget1.rb +15 -0
- data/spec/support/lib/rtml/widgets/test_widget2.rb +4 -0
- data/spec/support/rails.rb +22 -0
- data/spec/support/raw_tml/valid_document.tml +108 -0
- data/spec/support/rspec/example_groups.rb +3 -0
- data/spec/support/rspec/matchers.rb +53 -0
- data/spec/support/vendor/gems/rtml-bootstrapper-2.0.0/.specification +61 -0
- data/spec/support/vendor/gems/rtml-bootstrapper-2.0.0/lib/init_rtml_working_copy.rb +1 -0
- data/spec/support/vendor/gems/rtml-bootstrapper-2.0.0/rtml.gemspec +11 -0
- data/spec/widgets/document_variable_processing_spec.rb +84 -0
- data/spec/widgets/element_builder_spec.rb +124 -0
- data/spec/widgets/event_listener_spec.rb +51 -0
- data/spec/widgets/frontend_spec.rb +59 -0
- data/spec/widgets/highlevel_variable_processing_spec.rb +149 -0
- data/spec/widgets/screen_variable_processing_spec.rb +57 -0
- data/spec/widgets/screen_variants_spec.rb +97 -0
- data/spec/widgets/screens_spec.rb +55 -0
- data/spec/widgets/static_content_spec.rb +43 -0
- data/spec/widgets/subroutine_spec.rb +109 -0
- data/tasks/db.rake +6 -0
- data/tasks/rspec.rake +20 -0
- data/tasks/rtml.rake +5 -0
- data/test/test_generator_helper.rb +22 -0
- data/test/test_helper.rb +1 -1
- data/test/test_rtml_action_generator.rb +65 -0
- data/test/test_rtml_generator.rb +24 -4
- data/test/test_rtml_widget_generator.rb +47 -0
- data/test/test_widget_generator.rb +49 -0
- data/update.rb +19 -0
- metadata +343 -428
- data/app_generators/rtml/templates/rails_template.rb +0 -36
- data/app_generators/rtml/templates/rtml/MIT-LICENSE +0 -20
- data/app_generators/rtml/templates/rtml/README +0 -109
- data/app_generators/rtml/templates/rtml/Rakefile +0 -38
- data/app_generators/rtml/templates/rtml/app/controllers/beryl_controller.rb +0 -70
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/magcard_demo_controller.rb +0 -9
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/oe/btmlpa_controller.rb +0 -158
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/rtml_app_controller.rb +0 -252
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/tml_app_controller.rb +0 -418
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_helper.rb +0 -72
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/auth_result.rb +0 -56
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/common.rb +0 -19
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/index.rb +0 -82
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_helper.rb +0 -2
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/authorized.rb +0 -10
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/common.rb +0 -20
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/index.rb +0 -33
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_helper.rb +0 -2
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/auth_result.rb +0 -23
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/common.rb +0 -23
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/dynamic.rb +0 -11
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/icc.rb +0 -384
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/index.rb +0 -191
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/receipt.rb +0 -152
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/rtml_app_helper.rb +0 -74
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/rtml_app_tml_helpers/common.rb +0 -9
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/tml_app_helper.rb +0 -43
- data/app_generators/rtml/templates/rtml/app/models/rtml/card.rb +0 -83
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_avs.rb +0 -14
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_cvv.rb +0 -14
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_parser.rb +0 -21
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_pin.rb +0 -18
- data/app_generators/rtml/templates/rtml/app/models/rtml/emv_card_data.rb +0 -25
- data/app_generators/rtml/templates/rtml/app/models/rtml/mag_card_data.rb +0 -21
- data/app_generators/rtml/templates/rtml/app/models/rtml/reference_code.rb +0 -26
- data/app_generators/rtml/templates/rtml/app/models/rtml/state.rb +0 -12
- data/app_generators/rtml/templates/rtml/app/models/rtml/terminal.rb +0 -8
- data/app_generators/rtml/templates/rtml/app/models/rtml/transaction.rb +0 -68
- data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/another_rcpt.rtml.erb +0 -15
- data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/receipt.rtml.erb +0 -108
- data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/receipt_single_column.rtml.erb +0 -106
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/about.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/admin.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/construction.rtml.erb +0 -10
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/idle.rtml.erb +0 -13
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/main_menu.rtml.erb +0 -12
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/menu_credit.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/menu_debit.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/beryl_color.rtml.erb +0 -24
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/beryl_mono.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/magcard_demo_color.rtml.erb +0 -24
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/magcard_demo_mono.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/oe/btmlpa_i5100.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/oe/btmlpa_i8550.rtml.erb +0 -17
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/uml.html.erb +0 -11
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/authorized.html.erb +0 -15
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/authorized/main.rtml.erb +0 -5
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index.html.erb +0 -15
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/_error.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/enter_amount.rtml.erb +0 -5
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/main.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/dynamic/response.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/icc.rtml.erb +0 -760
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_enter_amount.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_about.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_duplicate.rtml.erb +0 -9
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_examples.rtml.erb +0 -9
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_logo.rtml.erb +0 -11
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_other.rtml.erb +0 -20
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_refund.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_reversal.rtml.erb +0 -9
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_sale.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_sale_cashback.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/about.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/assert.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/card_nmb.rtml.erb +0 -19
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/compl_txn.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/confirm_rev.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/duplicate_na.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/error_scr.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/main_menu.rtml.bak +0 -31
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/main_menu.rtml.erb +0 -40
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/print_pf.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/rd_sale_disp.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/read_refund.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/read_scb.rtml.erb +0 -10
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/reject_trans.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/remove_card.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/rev_bad.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/scb_check_f.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/sign_check.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/subm_err.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/to_man_entry.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/trans_abrt.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/void_trans.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/receipt/_receipt.rtml.erb +0 -29
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/receipt/error_paper.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_development.html.erb +0 -167
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_header.html.erb +0 -12
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_production.html.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/charts.html.erb +0 -14
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/do_tml_redirect.rtml.erb +0 -7
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/get_terminal_info.rtml.erb +0 -26
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/rescue_action_in_public.rtml.erb +0 -9
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/rescue_action_locally.rtml.erb +0 -42
- data/app_generators/rtml/templates/rtml/components/rtml/features/common.rb +0 -303
- data/app_generators/rtml/templates/rtml/components/rtml/features/force.rb +0 -46
- data/app_generators/rtml/templates/rtml/components/rtml/features/return.rb +0 -22
- data/app_generators/rtml/templates/rtml/components/rtml/features/sale.rb +0 -49
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_confirmation.rtml.erb +0 -10
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_agreement.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_footer.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_header.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/ask_cashback.rtml.erb +0 -11
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/card_imprint.rtml.erb +0 -7
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/check_cb.rtml.erb +0 -11
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/conf_debit.rtml.erb +0 -5
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/confirm_sale.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/confrm_force.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/cvv_skipped.rtml.erb +0 -10
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/disp_avs.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/do_avs_zip.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_amount.rtml.erb +0 -12
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_card.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_cashbk.rtml.erb +0 -10
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_cvv2.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_expiry.rtml.erb +0 -9
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/fraud_check1.rtml.erb +0 -6
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/fraud_check2.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_aprvl.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_avs_zip.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_bad_aprv.rtml.erb +0 -5
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frd_chk_fail.rtml.erb +0 -5
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/invalid_exp.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/no_entr_crd.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/remove_card.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/swipe_card.rtml.erb +0 -7
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/trans_abort.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/trans_reject.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/void_ref.rtml.erb +0 -10
- data/app_generators/rtml/templates/rtml/components/rtml/features/void.rb +0 -30
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/card_parser_widget.rb +0 -90
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/display_widget.rb +0 -66
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/element_builder_widget.rb +0 -123
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/emv_support_widget.rb +0 -365
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/form_submit_widget.rb +0 -65
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/get_transaction_variables_widget.rb +0 -33
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/get_variable_widget.rb +0 -39
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/receipt_widget.rb +0 -66
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/screen_builder_widget.rb +0 -49
- data/app_generators/rtml/templates/rtml/db/migrate/20090825132217_create_rtml_states.rb +0 -15
- data/app_generators/rtml/templates/rtml/db/migrate/20090825132401_create_rtml_terminals.rb +0 -16
- data/app_generators/rtml/templates/rtml/db/migrate/20090825132530_create_rtml_transactions.rb +0 -24
- data/app_generators/rtml/templates/rtml/db/migrate/20090825134118_create_rtml_cards.rb +0 -23
- data/app_generators/rtml/templates/rtml/db/migrate/20090825134622_create_rtml_emv_card_data.rb +0 -20
- data/app_generators/rtml/templates/rtml/db/migrate/20090825134629_create_rtml_mag_card_data.rb +0 -17
- data/app_generators/rtml/templates/rtml/db/migrate/20090825135838_create_rtml_card_parsers.rb +0 -19
- data/app_generators/rtml/templates/rtml/db/migrate/20090826103509_create_reference_codes.rb +0 -14
- data/app_generators/rtml/templates/rtml/db/migrate/20090915030044_add_batch_to_rtml_transactions.rb +0 -10
- data/app_generators/rtml/templates/rtml/db/migrate/20090915031155_add_additional_data_to_rtml_transactions.rb +0 -10
- data/app_generators/rtml/templates/rtml/db/migrate/20090915031156_add_hidden_data_to_rtml_transactions.rb +0 -10
- data/app_generators/rtml/templates/rtml/db/migrate/20091016133313_create_rtml_card_avs.rb +0 -16
- data/app_generators/rtml/templates/rtml/db/migrate/20091016135800_create_rtml_card_cvvs.rb +0 -16
- data/app_generators/rtml/templates/rtml/db/migrate/20091016135810_create_rtml_card_pins.rb +0 -16
- data/app_generators/rtml/templates/rtml/db/migrate/20091016135820_reverse_card_transaction_relationship.rb +0 -11
- data/app_generators/rtml/templates/rtml/db/migrate/20100127115105_convert_rtml_migrations_to_rails_migrations.rb +0 -31
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/USAGE +0 -25
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/rtml_controller_generator.rb +0 -49
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/common_tml_helper.rb +0 -20
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/controller.rb +0 -3
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/css_color.css +0 -37
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/css_mono.css +0 -12
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/functional_test.rb +0 -11
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/helper.rb +0 -2
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/layout_color.rtml.erb +0 -24
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/layout_mono.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/tml_helper.rb +0 -16
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/view.html.erb +0 -15
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/view.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/generators/rtml_document/USAGE +0 -8
- data/app_generators/rtml/templates/rtml/generators/rtml_document/rtml_document_generator.rb +0 -45
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/controller.rb +0 -7
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/functional_test.rb +0 -10
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/helper.rb +0 -2
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/view.rtml.erb +0 -11
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/USAGE +0 -8
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/rtml_widget_generator.rb +0 -66
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/templates/basic_widget.rb +0 -57
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/templates/basic_widget_no_help.rb +0 -27
- data/app_generators/rtml/templates/rtml/init.rb +0 -40
- data/app_generators/rtml/templates/rtml/install.rb +0 -18
- data/app_generators/rtml/templates/rtml/lib/environment.rb +0 -61
- data/app_generators/rtml/templates/rtml/lib/extensions/action_controller/request.rb +0 -9
- data/app_generators/rtml/templates/rtml/lib/extensions/action_controller/routing/route_set.rb +0 -34
- data/app_generators/rtml/templates/rtml/lib/extensions/action_view/base.rb +0 -74
- data/app_generators/rtml/templates/rtml/lib/extensions/action_view/partial_template.rb +0 -24
- data/app_generators/rtml/templates/rtml/lib/extensions/active_record.rb +0 -13
- data/app_generators/rtml/templates/rtml/lib/extensions/active_support/dependencies.rb +0 -25
- data/app_generators/rtml/templates/rtml/lib/extensions/array.rb +0 -15
- data/app_generators/rtml/templates/rtml/lib/extensions/attr_boolean.rb +0 -10
- data/app_generators/rtml/templates/rtml/lib/extensions/hash.rb +0 -28
- data/app_generators/rtml/templates/rtml/lib/extensions/nil_class.rb +0 -20
- data/app_generators/rtml/templates/rtml/lib/extensions/rake.rb +0 -19
- data/app_generators/rtml/templates/rtml/lib/extensions/regexp.rb +0 -16
- data/app_generators/rtml/templates/rtml/lib/extensions/string.rb +0 -37
- data/app_generators/rtml/templates/rtml/lib/other_plugins.rb +0 -23
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/MIT-LICENSE +0 -20
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/README +0 -36
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/Rakefile +0 -44
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/init.rb +0 -25
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/action_controller/filters/before_render_filter.rb +0 -30
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/before_render.rb +0 -43
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/before_render_instance.rb +0 -45
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/filter_chain_has_many_types_of_filters.rb +0 -87
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/filter_has_before_render.rb +0 -26
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/tasks/before_render_tasks.rake +0 -25
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/test/before_render_test.rb +0 -29
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/test/test_helper.rb +0 -24
- data/app_generators/rtml/templates/rtml/lib/rtml.rb +0 -77
- data/app_generators/rtml/templates/rtml/lib/rtml/beryl/constants.rb +0 -12
- data/app_generators/rtml/templates/rtml/lib/rtml/beryl/version.rb +0 -11
- data/app_generators/rtml/templates/rtml/lib/rtml/common/renderable.rb +0 -13
- data/app_generators/rtml/templates/rtml/lib/rtml/core/include.rb +0 -30
- data/app_generators/rtml/templates/rtml/lib/rtml/core/layout.rb +0 -59
- data/app_generators/rtml/templates/rtml/lib/rtml/core/next.rb +0 -188
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen.rb +0 -91
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/iterators.rb +0 -63
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/next_screen_methods.rb +0 -70
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/variable_methods.rb +0 -73
- data/app_generators/rtml/templates/rtml/lib/rtml/core/support/importer.rb +0 -55
- data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document.rb +0 -318
- data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document/screen_methods.rb +0 -79
- data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document/variable_methods.rb +0 -83
- data/app_generators/rtml/templates/rtml/lib/rtml/core/variable.rb +0 -123
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/browser_emulator.rb +0 -59
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/rtml_controller_test_case.rb +0 -7
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/rtml_core_unit_test.rb +0 -11
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/unit_test.rb +0 -3
- data/app_generators/rtml/templates/rtml/lib/rtml/delegation.rb +0 -8
- data/app_generators/rtml/templates/rtml/lib/rtml/doc.rb +0 -12
- data/app_generators/rtml/templates/rtml/lib/rtml/element.rb +0 -75
- data/app_generators/rtml/templates/rtml/lib/rtml/errors/widget_accessor_failure.rb +0 -9
- data/app_generators/rtml/templates/rtml/lib/rtml/events/event_handler.rb +0 -79
- data/app_generators/rtml/templates/rtml/lib/rtml/events/event_processor.rb +0 -106
- data/app_generators/rtml/templates/rtml/lib/rtml/events/processors.rb +0 -10
- data/app_generators/rtml/templates/rtml/lib/rtml/events/processors/defaults_processor.rb +0 -18
- data/app_generators/rtml/templates/rtml/lib/rtml/events/processors/key_processor.rb +0 -21
- data/app_generators/rtml/templates/rtml/lib/rtml/feature.rb +0 -32
- data/app_generators/rtml/templates/rtml/lib/rtml/feature_config.rb +0 -195
- data/app_generators/rtml/templates/rtml/lib/rtml/features.rb +0 -18
- data/app_generators/rtml/templates/rtml/lib/rtml/features/array_of_feature_instances.rb +0 -17
- data/app_generators/rtml/templates/rtml/lib/rtml/features/controller_class_methods.rb +0 -30
- data/app_generators/rtml/templates/rtml/lib/rtml/features/controller_instance_methods.rb +0 -35
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers.rb +0 -21
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/controller_helpers.rb +0 -59
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/controller_helpers/menu_helpers.rb +0 -193
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/action_view_wrapper.rb +0 -23
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/event_helpers.rb +0 -28
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/layout_helpers.rb +0 -47
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/widget_support.rb +0 -181
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/widget_support/class_methods.rb +0 -28
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/yield_helpers.rb +0 -33
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/proxy_helpers/feature_helpers.rb +0 -17
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/render_helper.rb +0 -71
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/terminal_helpers.rb +0 -21
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers.rb +0 -6
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers/tml_validation_assertions.rb +0 -10
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers/variable_assertions.rb +0 -27
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/view_helpers/form_helpers.rb +0 -70
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/view_helpers/rtml_form_builder.rb +0 -174
- data/app_generators/rtml/templates/rtml/lib/rtml/oe/btmlpa_constants.rb +0 -48
- data/app_generators/rtml/templates/rtml/lib/rtml/proxying/method_missing_methods.rb +0 -14
- data/app_generators/rtml/templates/rtml/lib/rtml/proxying/rtml_interface.rb +0 -33
- data/app_generators/rtml/templates/rtml/lib/rtml/proxying/sandbox.rb +0 -18
- data/app_generators/rtml/templates/rtml/lib/rtml/text_utils.rb +0 -51
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/dom_rule_parser.rb +0 -61
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/dom_tag.rb +0 -52
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/predefined_variable_rule_parser.rb +0 -97
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/tml_validator.rb +0 -16
- data/app_generators/rtml/templates/rtml/lib/rtml/version.rb +0 -11
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/property.rb +0 -11
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/property_accessors.rb +0 -59
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/widget.rb +0 -251
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/widget_class_methods.rb +0 -213
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/dot.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_can.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_cand.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_en.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_end.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_i.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icd.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icl.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icr.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_ics.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icsw.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icv.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_int.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_int2.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_men.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_mend.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_next.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_no.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_nod.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_ok.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_okd.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic1.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic2.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic3.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic4.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_top.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_txn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_yes.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_yesd.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/btmlpa.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/can_dn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/can_up.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/conf.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/iccemv.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/images.lib +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/magcard.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/no_dn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/no_up.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/ok_dn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/ok_up.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/top.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/yes_dn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/yes_up.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/beryl_color.css +0 -37
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/beryl_mono.css +0 -17
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/i5100.css +0 -12
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/i8550.css +0 -37
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/receipt.css +0 -4
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/examples/i5100.css +0 -12
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/examples/i8550.css +0 -37
- data/app_generators/rtml/templates/rtml/reporting/110409 +0 -227
- data/app_generators/rtml/templates/rtml/reporting/linecount.rb +0 -42
- data/app_generators/rtml/templates/rtml/rules/predefined_tml_variables.rb +0 -63
- data/app_generators/rtml/templates/rtml/rules/tml_document_structure.rb +0 -84
- data/app_generators/rtml/templates/rtml/rules/varns/audio.rb +0 -30
- data/app_generators/rtml/templates/rtml/rules/varns/card.rb +0 -17
- data/app_generators/rtml/templates/rtml/rules/varns/card/emv.rb +0 -31
- data/app_generators/rtml/templates/rtml/rules/varns/card/mag.rb +0 -8
- data/app_generators/rtml/templates/rtml/rules/varns/card/parser.rb +0 -7
- data/app_generators/rtml/templates/rtml/rules/varns/card/pin.rb +0 -6
- data/app_generators/rtml/templates/rtml/rules/varns/cfgm.rb +0 -15
- data/app_generators/rtml/templates/rtml/rules/varns/com.rb +0 -9
- data/app_generators/rtml/templates/rtml/rules/varns/err.rb +0 -14
- data/app_generators/rtml/templates/rtml/rules/varns/gma/event.rb +0 -13
- data/app_generators/rtml/templates/rtml/rules/varns/gprs.rb +0 -8
- data/app_generators/rtml/templates/rtml/rules/varns/imager.rb +0 -8
- data/app_generators/rtml/templates/rtml/rules/varns/ip.rb +0 -15
- data/app_generators/rtml/templates/rtml/rules/varns/oebr.rb +0 -42
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/3rdparty.rb +0 -7
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/backlight.rb +0 -4
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/cache.rb +0 -1
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/connect.rb +0 -5
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/connection.rb +0 -5
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/offline.rb +0 -5
- data/app_generators/rtml/templates/rtml/rules/varns/oegw.rb +0 -12
- data/app_generators/rtml/templates/rtml/rules/varns/payment.rb +0 -21
- data/app_generators/rtml/templates/rtml/rules/varns/ppp.rb +0 -11
- data/app_generators/rtml/templates/rtml/rules/varns/terminal.rb +0 -29
- data/app_generators/rtml/templates/rtml/tasks/rtml_tasks.rake +0 -78
- data/app_generators/rtml/templates/rtml/template.rb +0 -64
- data/app_generators/rtml/templates/rtml/test/core/element_test.rb +0 -17
- data/app_generators/rtml/templates/rtml/test/core/screen_test.rb +0 -91
- data/app_generators/rtml/templates/rtml/test/core/tml_document_test.rb +0 -53
- data/app_generators/rtml/templates/rtml/test/functional/beryl_controller_test.rb +0 -13
- data/app_generators/rtml/templates/rtml/test/functional/btmlpa_controller_test.rb +0 -13
- data/app_generators/rtml/templates/rtml/test/functional/magcard_demo_controller_test.rb +0 -20
- data/app_generators/rtml/templates/rtml/test/functional/rtml_app_controller_test.rb +0 -9
- data/app_generators/rtml/templates/rtml/test/functional/rtml_routing_test.rb +0 -19
- data/app_generators/rtml/templates/rtml/test/functional/tml_controller_params_test.rb +0 -20
- data/app_generators/rtml/templates/rtml/test/rtml_test_helper.rb +0 -44
- data/app_generators/rtml/templates/rtml/test/validation/predefined_variable_rule_parser_test.rb +0 -11
- data/app_generators/rtml/templates/rtml/uninstall.rb +0 -1
- data/app_generators/rtml/templates/rtml/update.rb +0 -57
- data/tasks/reglob.rake +0 -28
- data/test/test_rtml.rb +0 -11
@@ -0,0 +1,28 @@
|
|
1
|
+
path = File.expand_path File.join(File.dirname(__FILE__), '../..')
|
2
|
+
|
3
|
+
if defined?(Rails.configuration)
|
4
|
+
Rails.configuration.controller_paths << File.join(path, 'builtin/controllers')
|
5
|
+
end
|
6
|
+
|
7
|
+
%w(document
|
8
|
+
instruction
|
9
|
+
state
|
10
|
+
dom/element
|
11
|
+
dom/frontend_element
|
12
|
+
dom/property
|
13
|
+
dom/screen_element
|
14
|
+
instruction/follow_class_methods
|
15
|
+
state/variable_mapping).each do |fi|
|
16
|
+
require File.join(path, 'builtin/models/rtml', fi)
|
17
|
+
end
|
18
|
+
|
19
|
+
require File.join(path, 'builtin/rtml_helpers/rtml/get_state')
|
20
|
+
require File.join(path, 'builtin/rtml_helpers/rtml/rescue_action')
|
21
|
+
|
22
|
+
Dir[File.join(path, 'lib/extensions/**/*.rb')].each { |fi| require fi if File.file?(fi) }
|
23
|
+
|
24
|
+
# Add RTML routes
|
25
|
+
routes_file = File.join(Rtml.root, 'lib/rtml_routes.rb')
|
26
|
+
unless ActionController::Routing::Routes.configuration_files.include? routes_file
|
27
|
+
ActionController::Routing::Routes.configuration_files << routes_file
|
28
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
class Rtml::HighLevel::ManagedVariable
|
2
|
+
attr_reader :name
|
3
|
+
|
4
|
+
def initialize(name)
|
5
|
+
@name = name
|
6
|
+
end
|
7
|
+
|
8
|
+
# Returns the TML necessary to test whether this variable's value is equal to the specified argument's value.
|
9
|
+
def ==(other)
|
10
|
+
op(:equal, other)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Returns the TML necessary to test whether this variable's value is not equal to the specified argument's value.
|
14
|
+
def not_equal(other)
|
15
|
+
op(:not_equal, other)
|
16
|
+
end
|
17
|
+
alias not_equal_to not_equal
|
18
|
+
|
19
|
+
# Returns the TML necessary to test whether this variable's value is less than the specified argument's value.
|
20
|
+
def <(other)
|
21
|
+
op(:less, other)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Returns the TML necessary to test whether this variable's value is greater than the specified argument's value.
|
25
|
+
def >(other)
|
26
|
+
op(:greater, other)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns the TML necessary to test whether this variable's value is less than or equal to the specified value.
|
30
|
+
def <=(other)
|
31
|
+
op(:less_or_equal, other)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns the TML necessary to test whether this variable's value is greater than or equal to the specified value.
|
35
|
+
def >=(other)
|
36
|
+
op(:greater_or_equal, other)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Returns the TML necessary to add or concatenate the specified value with this one.
|
40
|
+
def +(other) op(:plus, other) end
|
41
|
+
|
42
|
+
# Returns the TML necessary to subtract the specified value from this one.
|
43
|
+
def -(other) op(:minus, other) end
|
44
|
+
|
45
|
+
# Returns the TML necessary to retrieve an item from the list with the specified index.
|
46
|
+
def item(other)
|
47
|
+
op(:item, other)
|
48
|
+
end
|
49
|
+
alias [] item
|
50
|
+
|
51
|
+
# Returns the TML necessary to retrieve the number of items in the list.
|
52
|
+
def number
|
53
|
+
op(:number, nil)
|
54
|
+
end
|
55
|
+
alias length number
|
56
|
+
alias size number
|
57
|
+
|
58
|
+
# Returns the TML necessary to format this variable using the specified format.
|
59
|
+
def format(other)
|
60
|
+
op(:format, other)
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
def op(which, other)
|
65
|
+
which = which.to_s
|
66
|
+
if other.kind_of?(Rtml::HighLevel::ManagedVariable)
|
67
|
+
["tmlvar:#{name}", which, "tmlvar:#{other.name}"]
|
68
|
+
else
|
69
|
+
["tmlvar:#{name}", which, other]
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class Rtml::HighLevel::Subroutine
|
2
|
+
def initialize(name, parent, options = {}, &blk)
|
3
|
+
@block = blk
|
4
|
+
@name = name
|
5
|
+
@parent = parent
|
6
|
+
end
|
7
|
+
|
8
|
+
def call(context, args)
|
9
|
+
method_name = @name
|
10
|
+
block = @block
|
11
|
+
|
12
|
+
(class << context; self; end).instance_eval do
|
13
|
+
define_method method_name, &block
|
14
|
+
new_method = instance_method(method_name)
|
15
|
+
define_method method_name do |arguments|
|
16
|
+
new_method.bind(self).call(arguments)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context.send(method_name, args)
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class Rtml::HighLevel::VariableManager
|
2
|
+
attr_accessor :screen
|
3
|
+
|
4
|
+
def initialize()
|
5
|
+
@vars = HashWithIndifferentAccess.new
|
6
|
+
end
|
7
|
+
|
8
|
+
def [](variable_name)
|
9
|
+
variable_name = variable_name.to_s
|
10
|
+
vardec = screen.document.variable_definitions.select { |i| i['name'] == variable_name }
|
11
|
+
vardec = vardec.collect { |i| i['name'] }.first
|
12
|
+
raise Rtml::Errors::MissingVariableError, "Could not find a TML variable named #{variable_name}. "+
|
13
|
+
"Did you forget to declare it?" unless vardec
|
14
|
+
@vars[variable_name] ||= Rtml::HighLevel::ManagedVariable.new(variable_name)
|
15
|
+
end
|
16
|
+
|
17
|
+
def []=(target, other)
|
18
|
+
case other
|
19
|
+
when Rtml::HighLevel::ManagedVariable
|
20
|
+
screen.set self[target].name => "tmlvar:#{other.name}"
|
21
|
+
else
|
22
|
+
screen.set self[target].name => other
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def method_missing(name, *args, &block)
|
27
|
+
if args.empty? && !block_given?
|
28
|
+
self.send("[]", name)
|
29
|
+
elsif name.to_s[-1] == ?= && args.length == 1 && !block_given?
|
30
|
+
self.send("[]=", name.to_s[0...-1], *args)
|
31
|
+
else
|
32
|
+
super
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Rtml::InheritedInstanceVariables
|
2
|
+
def copy_ivars_from(source)
|
3
|
+
ivars = source.instance_variables
|
4
|
+
ivars -= source.protected_instance_variables if source.respond_to?(:protected_instance_variables)
|
5
|
+
ivars.each { |ivar| instance_variable_set(ivar, source.instance_variable_get(ivar)) }
|
6
|
+
rescue
|
7
|
+
# fail silently if they can't be copied
|
8
|
+
end
|
9
|
+
|
10
|
+
def initialize_with_inherited_instance_variables(*a, &b)
|
11
|
+
initialize_without_inherited_instance_variables(*a, &b)
|
12
|
+
|
13
|
+
%w(controller document parent).each do |method|
|
14
|
+
copy_ivars_from(send(method)) if respond_to?(method) rescue nil
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.included(base)
|
19
|
+
base.instance_eval do
|
20
|
+
class_inheritable_array :protected_instance_variables
|
21
|
+
read_inheritable_attribute(:protected_instance_variables) || write_inheritable_attribute(:protected_instance_variables, [])
|
22
|
+
alias_method_chain :initialize, :inherited_instance_variables
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/rtml/init.rb
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
unless defined?(Rtml) && defined?(Rails)
|
2
|
+
# Now, for some reason, Rails (ActiveSupport?) is removing a lot of existing directories from
|
3
|
+
# the load path. Probably for optimization, but kind of counterproductive for this edge case.
|
4
|
+
# So I'm going to back them up, and then re-add them.
|
5
|
+
load_path_backup = $LOAD_PATH.collect { |lp| File.expand_path(lp) }
|
6
|
+
|
7
|
+
require File.join(File.dirname(__FILE__), '../rtml/dependencies')
|
8
|
+
|
9
|
+
unless defined?(RAILS_ROOT)
|
10
|
+
RAILS_ROOT = Dir.pwd.gsub(/\/test(\/|)$/, '')
|
11
|
+
end
|
12
|
+
|
13
|
+
module Rails
|
14
|
+
module VERSION
|
15
|
+
MAJOR = 2
|
16
|
+
MINOR = 3
|
17
|
+
TINY = 5
|
18
|
+
|
19
|
+
STRING = [MAJOR, MINOR, TINY].join('.')
|
20
|
+
end
|
21
|
+
|
22
|
+
class Configuration
|
23
|
+
attr_accessor :controller_paths, :view_path
|
24
|
+
|
25
|
+
def initialize
|
26
|
+
@controller_paths = [File.join(RAILS_ROOT, 'controllers'), File.join(File.dirname(__FILE__), '../../builtin/controllers')]
|
27
|
+
@view_path = File.join(RAILS_ROOT, 'views')
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class << self
|
32
|
+
attr_writer :logger, :backtrace_cleaner, :configuration
|
33
|
+
|
34
|
+
def logger
|
35
|
+
@logger ||= Logger.new(File.join(RAILS_ROOT, "tmp/rtml.log"))
|
36
|
+
end unless defined?(Rails.logger)
|
37
|
+
|
38
|
+
def backtrace_cleaner
|
39
|
+
@backtrace_cleaner ||= ActiveSupport::BacktraceCleaner.new
|
40
|
+
end
|
41
|
+
|
42
|
+
def configuration
|
43
|
+
@configuration ||= Configuration.new
|
44
|
+
end
|
45
|
+
|
46
|
+
def root
|
47
|
+
RAILS_ROOT
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class ApplicationController < ActionController::Base
|
53
|
+
end unless defined?(ApplicationController)
|
54
|
+
|
55
|
+
# Restore the missing load paths.
|
56
|
+
load_path_backup.reverse.each do |path|
|
57
|
+
$LOAD_PATH.unshift path unless $LOAD_PATH.include?(path)
|
58
|
+
end
|
59
|
+
|
60
|
+
ActiveRecord::Base.logger = Rails.logger
|
61
|
+
ActiveRecord::Base.establish_connection(:database => File.join(RAILS_ROOT, "tmp/rtml_test_db.sqlite3"),
|
62
|
+
:adapter => 'sqlite3',
|
63
|
+
:timeout => 5000,
|
64
|
+
:pool => 5)
|
65
|
+
|
66
|
+
|
67
|
+
ActionController::Base.session = { :key => '_myapp_session', :secret => '1'*60 }
|
68
|
+
|
69
|
+
# Now that we're emulating the bare bones of Rails (at least as far as RTML is concerned), let's
|
70
|
+
# get to RTML itself.
|
71
|
+
require File.join(File.dirname(__FILE__), '../rtml')
|
72
|
+
require File.join(File.dirname(__FILE__), '../rtml/environment')
|
73
|
+
|
74
|
+
if defined?(Rake::Task)
|
75
|
+
task :environment
|
76
|
+
load File.join(File.dirname(__FILE__), '../../tasks/rtml.rake')
|
77
|
+
load File.join(File.dirname(__FILE__), '../../tasks/db.rake')
|
78
|
+
load 'tasks/routes.rake'
|
79
|
+
end
|
80
|
+
|
81
|
+
Dir.chdir RAILS_ROOT
|
82
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
class Rtml::ReverseEngineering::Crawler
|
2
|
+
attr_reader :simulator, :session
|
3
|
+
delegate :tml, :route, :set, :to => :simulator
|
4
|
+
delegate :response, :request, :controller, :get, :post, :put, :delete, :to => :session
|
5
|
+
|
6
|
+
def tml=(tml)
|
7
|
+
@path = nil
|
8
|
+
simulator.tml = tml
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(options = {})
|
12
|
+
@simulator = Rtml::ReverseEngineering::Simulator.new(options.delete(:tml))
|
13
|
+
@session = ActionController::Integration::Session.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def visit(path, screen = nil)
|
17
|
+
path, screen = split_path_and_screen_name_out_of(path) unless screen
|
18
|
+
unless path.blank? or path == @path
|
19
|
+
get @path = path
|
20
|
+
format = response.template.template_format
|
21
|
+
if format == :rtml then simulator.tml = response.body
|
22
|
+
else raise Rtml::Errors::InvalidFormat, "Response must be in :rtml format; found #{format.inspect}:\n#{response.body}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
@simulator.visit screen
|
27
|
+
end
|
28
|
+
|
29
|
+
def split_path_and_screen_name_out_of(path)
|
30
|
+
path, screen = path.split(/#/)
|
31
|
+
if screen =~ /\?/
|
32
|
+
screen, query = screen.split(/\?/)
|
33
|
+
path = "#{path}?#{query}"
|
34
|
+
end
|
35
|
+
[path, screen]
|
36
|
+
end
|
37
|
+
|
38
|
+
def current_screen
|
39
|
+
route.last
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
# Since we're using ActionController::Integration::Session instead of including ActionController::TestProcess,
|
44
|
+
# this method isn't used any more and should really be removed.
|
45
|
+
def setup_controller_request_and_response
|
46
|
+
# How to get this info into a TestResult so we don't have to create 2 requests?! TestResult seems to always override
|
47
|
+
# the env with Rack::MockRequest.env_for("/"), even though it looks like it SHOULD be merging the two. Bug?
|
48
|
+
temp_request = ActionController::Request.new(Rack::MockRequest.env_for(@path))
|
49
|
+
@path_params = ActionController::Routing::Routes.recognize_path(temp_request.path)
|
50
|
+
@request = ActionController::TestRequest.new
|
51
|
+
@request.remote_addr = '123.231.12.3'
|
52
|
+
@response = ActionController::TestResponse.new
|
53
|
+
@controller = @path_params[:controller].to_controller.new
|
54
|
+
@controller.request = @request
|
55
|
+
@controller.params = temp_request.parameters
|
56
|
+
@controller.send(:initialize_current_url)
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,269 @@
|
|
1
|
+
class Rtml::ReverseEngineering::Simulator
|
2
|
+
include Rtml::Rules::DomValidation
|
3
|
+
include Rtml::ReverseEngineering::Simulator::VariableLookup
|
4
|
+
attr_reader :tml
|
5
|
+
|
6
|
+
def initialize(tml = nil)
|
7
|
+
self.tml = tml if tml
|
8
|
+
end
|
9
|
+
|
10
|
+
def set(values)
|
11
|
+
variables.merge!(values.with_indifferent_access)
|
12
|
+
end
|
13
|
+
|
14
|
+
def route
|
15
|
+
@stack.last ? @stack.last[4] : []
|
16
|
+
end
|
17
|
+
|
18
|
+
# Visits the specified screen. Evaluates variable assignments and follows TML logical flow, but does not interact
|
19
|
+
# with hotkeys, hyperlinks, etc.
|
20
|
+
#
|
21
|
+
# Timeouts are not evaluated because they *usually* indicate that some interaction is required by the user.
|
22
|
+
#
|
23
|
+
# The return value is the last screen to be visited with the above exceptions. Circular paths return the last
|
24
|
+
# screen in the path before it would loop over; external references return the URL of the reference.
|
25
|
+
def visit(screen_name = nil)
|
26
|
+
raise Rtml::Errors::ScreenNotFound, "No screens found to visit in RTML document!" unless first_screen
|
27
|
+
screen_name = first_screen['id'] if screen_name.blank?
|
28
|
+
response = analyze screen_name, :ignore_pathlist => true, :interaction => :none
|
29
|
+
response.kind_of?(Symbol) ? route.last || response : response
|
30
|
+
end
|
31
|
+
|
32
|
+
# Analyzes the specified path (which can be one or more symbols and/or strings) and verifies
|
33
|
+
# that screens with the specified IDs are followed, in the specified order. If any screen is encountered
|
34
|
+
# which is NOT in the list, no error is raised as long as the next screen in the list is visited at some point.
|
35
|
+
# Returns one of the following values:
|
36
|
+
#
|
37
|
+
# :completion - each screen was visited in the specified order.
|
38
|
+
# :assertion - a TML assertion error was raised in the form of the "assert" screen being visited.
|
39
|
+
# :no_route - The TML pathway did not result in the specified screens being visited in the expected order.
|
40
|
+
# :dead_end - The TML pathway ended abruptly, and did not visit all of the specified screens before doing so.
|
41
|
+
# :circular - The TML pathway was a circular route which never touched one or more nodes.
|
42
|
+
# :error - Processing ended abruptly, for an unknown reason.
|
43
|
+
# a String - The TML pathway encountered a link to an external document, and not an anchor. The String returned
|
44
|
+
# is the reference to the external document.
|
45
|
+
#
|
46
|
+
# This method also builds the #route up, so that you can analyze the order in which screens were visited.
|
47
|
+
#
|
48
|
+
def analyze(*path)
|
49
|
+
raise Rtml::Errors::ScreenNotFound, "No screens found to visit in RTML document!" unless first_screen
|
50
|
+
options = path.extract_options!
|
51
|
+
path.flatten!
|
52
|
+
raise ArgumentError, "Expected at least one screen ID as an argument" unless path.length > 0
|
53
|
+
@ignore_pathlist = path.empty? || options.delete(:ignore_pathlist)
|
54
|
+
@interaction = options.delete(:interaction) || options.delete(:interactions) || :all
|
55
|
+
@recursion_limit = options.delete(:recursion_limit) || options.delete(:max_depth) || 150
|
56
|
+
|
57
|
+
r = catch(:completion) do
|
58
|
+
current = path.shift || first_screen['id']
|
59
|
+
#route << current
|
60
|
+
@pathlist = path
|
61
|
+
catch(:abort) do
|
62
|
+
trace(find_screen(current))
|
63
|
+
:error
|
64
|
+
end
|
65
|
+
end
|
66
|
+
r
|
67
|
+
end
|
68
|
+
|
69
|
+
def tml=(value)
|
70
|
+
reset!
|
71
|
+
case value
|
72
|
+
when String then @tml = Hpricot::XML(value).root
|
73
|
+
when Hpricot::Doc then @tml = value.root
|
74
|
+
when Hpricot::Elem then @tml = value
|
75
|
+
else raise ArgumentError, "Expected TML to be a String, Hpricot::Doc or Hpricot::Elem"
|
76
|
+
end
|
77
|
+
|
78
|
+
parse_tml
|
79
|
+
end
|
80
|
+
|
81
|
+
def find_screen(id)
|
82
|
+
rt = screens.select { |scr| scr['id'] == id.to_s }
|
83
|
+
raise Rtml::Errors::ScreenNotFound, "Could not find screen with ID '#{id}'" if rt.empty?
|
84
|
+
scr = rt.shift
|
85
|
+
raise Rtml::Errors::ScreenNotFound, "Multiple ambiguous screens found with ID '#{id}'" unless rt.empty?
|
86
|
+
scr
|
87
|
+
end
|
88
|
+
|
89
|
+
private
|
90
|
+
# Returns all interactions that the simulator is allowed to perform in the form of an array.
|
91
|
+
def interactions
|
92
|
+
if @interaction.kind_of?(Symbol)
|
93
|
+
case @interaction
|
94
|
+
when :all then [:all, :key, :timeout, :href]
|
95
|
+
when :none then []
|
96
|
+
when :key, :timeout, :href then [@interaction]
|
97
|
+
end
|
98
|
+
else
|
99
|
+
@interaction
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
|
104
|
+
def trace(screen)
|
105
|
+
route << screen['id']
|
106
|
+
take_snapshot(screen)
|
107
|
+
unless @ignore_pathlist
|
108
|
+
@pathlist.shift if screen['id'] == @pathlist.first.to_s
|
109
|
+
throw :completion, :completion if @pathlist.empty?
|
110
|
+
end
|
111
|
+
|
112
|
+
process_variable_assignments(screen)
|
113
|
+
|
114
|
+
candidates = href_candidates(screen)
|
115
|
+
throw :completion, :completion unless candidates.empty? || interactions.include?(:href)
|
116
|
+
|
117
|
+
candidates.concat next_screen_for(screen)
|
118
|
+
throw :abort, :dead_end if candidates.empty?
|
119
|
+
|
120
|
+
abort_with = nil
|
121
|
+
anchors_for(candidates).each do |next_screen|
|
122
|
+
if next_screen.kind_of?(String)# == :external
|
123
|
+
throw :abort, next_screen # :external
|
124
|
+
elsif next_screen['id'] == 'assert'
|
125
|
+
throw :abort, :assertion
|
126
|
+
else
|
127
|
+
push_stack
|
128
|
+
abort_with = catch(:abort) do
|
129
|
+
trace(next_screen)
|
130
|
+
nil
|
131
|
+
end
|
132
|
+
throw :abort, abort_with if @ignore_pathlist
|
133
|
+
pop_stack if abort_with
|
134
|
+
end
|
135
|
+
end
|
136
|
+
throw :abort, abort_with if abort_with
|
137
|
+
end
|
138
|
+
|
139
|
+
# Finds the various +setvar+ elements in the specified screen and updates the simulator's variable states to match.
|
140
|
+
def process_variable_assignments(screen)
|
141
|
+
setvars = screen / "setvar"
|
142
|
+
setvars.each do |setvar|
|
143
|
+
variables[setvar['name']] = Rtml::ReverseEngineering::Simulator::VariableValue.new(setvar, variables, vardecs).value
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
# Finds all hyperlinks within the given screen and returns them.
|
148
|
+
#
|
149
|
+
def href_candidates(screen)
|
150
|
+
(screen / "a").select { |elem| elem['href'] }.collect { |elem| elem['href'] }
|
151
|
+
end
|
152
|
+
|
153
|
+
# Takes a "snapshot" of the state of the simulator, with the given screen as the index.
|
154
|
+
# This is used to track visited screens; it is a safe assumption that if all variables are identical
|
155
|
+
# to a given snapshot with the given screen, then this will result in a circular TML path.
|
156
|
+
# This method will throw :abort, :circular if this condition is true.
|
157
|
+
def take_snapshot(screen)
|
158
|
+
snapshot = Rtml::ReverseEngineering::Simulator::Snapshot.new(screen, variables)
|
159
|
+
if snapshots.length > @recursion_limit
|
160
|
+
raise Rtml::Errors::ProcessingError, "Recursion error: Probable infinite loop (or :recursion_limit is too low)"
|
161
|
+
end
|
162
|
+
if snapshots.include?(snapshot)
|
163
|
+
throw :abort, :circular
|
164
|
+
end
|
165
|
+
snapshots << snapshot
|
166
|
+
end
|
167
|
+
|
168
|
+
# returns the list of possible screenflow branches following the specified screen.
|
169
|
+
def next_screen_for(screen)
|
170
|
+
candidates = screen['next'] ? [screen['next']] : []
|
171
|
+
next_element = (screen / "next").shift
|
172
|
+
if next_element
|
173
|
+
candidates = find_adequate_variants(next_element) + [next_element['uri']]
|
174
|
+
end
|
175
|
+
|
176
|
+
candidates
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns array containing the screen element for each string in the array, or the original string if it is not found.
|
180
|
+
def anchors_for(candidates)
|
181
|
+
candidates.collect do |screen_id|
|
182
|
+
if screen_id =~ /^#/
|
183
|
+
find_screen(screen_id[1..-1]) # to drop the '#'
|
184
|
+
else
|
185
|
+
screen_id
|
186
|
+
#:external
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the first variant in the Hpricot::Elem which matches the current variable values, or nil if none match.
|
192
|
+
def find_adequate_variants(elem)
|
193
|
+
variants = elem / "variant"
|
194
|
+
|
195
|
+
candidates = []
|
196
|
+
variants.each do |variant|
|
197
|
+
uri, lo, op, ro, key, timeout =
|
198
|
+
variant['uri'], variant['lo'], variant['op'] || "equal", variant['ro'], variant['key'], variant['timeout']
|
199
|
+
%w(uri lo op ro key timeout).each { |lv| eval("#{lv} = resolve(#{lv}, variables, vardecs)") }
|
200
|
+
if (interactions.include?(:key) && key) || (interactions.include?(:timeout) && timeout)
|
201
|
+
candidates << uri
|
202
|
+
elsif key || timeout # if we're not interacting with them, pause to allow user interaction
|
203
|
+
throw :completion, :completion
|
204
|
+
else
|
205
|
+
# only follow if it's a match
|
206
|
+
ro = lo.kind_of?(Fixnum) ? ro.to_i : ro.to_s
|
207
|
+
|
208
|
+
match = case op
|
209
|
+
when 'equal' then lo == ro
|
210
|
+
when 'not_equal' then lo != ro
|
211
|
+
when 'less' then lo < ro
|
212
|
+
when 'less_or_equal' then lo <= ro
|
213
|
+
when 'contains' then lo.to_s[ro.to_s]
|
214
|
+
else raise Rtml::InvalidOperation, "Invalid operation: #{op}"
|
215
|
+
end
|
216
|
+
candidates << uri and break if match
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
candidates #candidates.empty? ? nil : candidates
|
221
|
+
end
|
222
|
+
|
223
|
+
def first_screen
|
224
|
+
(tml / "screen").first
|
225
|
+
end
|
226
|
+
|
227
|
+
# resets the various tracking variables
|
228
|
+
def reset!
|
229
|
+
@stack = [ ]
|
230
|
+
#@stack.clear
|
231
|
+
push_stack
|
232
|
+
end
|
233
|
+
|
234
|
+
def push_stack
|
235
|
+
@stack.push [ screens.dup, snapshots.dup, variables.dup, vardecs.dup, route.dup ]
|
236
|
+
end
|
237
|
+
|
238
|
+
def pop_stack
|
239
|
+
@stack.pop
|
240
|
+
end
|
241
|
+
|
242
|
+
def screens
|
243
|
+
@stack.last ? @stack.last[0] : []
|
244
|
+
end
|
245
|
+
|
246
|
+
def snapshots
|
247
|
+
@stack.last ? @stack.last[1] : []
|
248
|
+
end
|
249
|
+
|
250
|
+
def variables
|
251
|
+
@stack.last ? @stack.last[2] : {}
|
252
|
+
end
|
253
|
+
|
254
|
+
def vardecs
|
255
|
+
@stack.last ? @stack.last[3] : {}
|
256
|
+
end
|
257
|
+
|
258
|
+
# Validates the given TML, and then finds the +screen+ elements and tracks them.
|
259
|
+
def parse_tml
|
260
|
+
validate_tml(@tml)
|
261
|
+
(@tml / "vardcl").each do |elem|
|
262
|
+
vardecs[elem['name']] = elem['type'].to_sym
|
263
|
+
end
|
264
|
+
|
265
|
+
(@tml / "screen").each do |elem|
|
266
|
+
screens << elem
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|