rtml 1.2.2 → 2.0.0.alpha.1
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 +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,9 @@
|
|
|
1
|
+
module Rtml::ReverseEngineering::Simulator::Casting
|
|
2
|
+
# Returns an instance of +Rtml::ReverseEngineering::Simulator+ with self as the initialization argument.
|
|
3
|
+
def to_tml_simulator
|
|
4
|
+
Rtml::ReverseEngineering::Simulator.new(self)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
alias to_rtml_simulator to_tml_simulator
|
|
8
|
+
alias to_simulator to_tml_simulator
|
|
9
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# This class is used to contain a single +screen+ element (an instance of Hpricot::Elem) as well as any variable
|
|
2
|
+
# assignments that have been made. Basically, it is simply used by +Rtml::ReverseEngineering::Simulator+ to check
|
|
3
|
+
# for circular pathways. If two identical snapshots would be created, then it stands to reason that the resultant
|
|
4
|
+
# pathways for those two snapshots will also be identical. If you're following a path and creating snapshots at every
|
|
5
|
+
# step of the way, and two snapshots match, then using that logic, those two snapshots would indicate a circular
|
|
6
|
+
# pathway. (It comes down to either that, or waiting to catch a stack overflow error, which is less than optimal.)
|
|
7
|
+
#
|
|
8
|
+
class Rtml::ReverseEngineering::Simulator::Snapshot
|
|
9
|
+
attr_reader :screen, :variables
|
|
10
|
+
|
|
11
|
+
def initialize(screen, variables)
|
|
12
|
+
@screen, @variables = screen, variables.dup
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def ==(other_snapshot)
|
|
16
|
+
@screen == other_snapshot.screen && variables == other_snapshot.variables
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module Rtml::ReverseEngineering::Simulator::VariableLookup
|
|
2
|
+
# Checks a value to see if it references a TML variable; if so, it resolves that variable into its value;
|
|
3
|
+
# otherwise, the original value is returned.
|
|
4
|
+
def resolve(value, all_variables, known_variable_types)
|
|
5
|
+
if value =~ /^tmlvar:(.*)$/
|
|
6
|
+
lookup_variable_value($~[1], all_variables, known_variable_types)
|
|
7
|
+
else
|
|
8
|
+
value
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Finds the variable in the all_variables hash whose name matches the specified name (string or symbol), and then
|
|
13
|
+
# returns its value. If that value is an instance of +Rtml::ReverseEngineering::Simulator::VariableValue+, calls
|
|
14
|
+
# the #value method on that object instead.
|
|
15
|
+
#
|
|
16
|
+
# If the variable is not found, then a default value will be returned depending on its type.
|
|
17
|
+
def lookup_variable_value(name, all_variables, known_variable_types)
|
|
18
|
+
all_variables.each do |var_name, varval|
|
|
19
|
+
if var_name.to_s == name
|
|
20
|
+
return(varval.kind_of?(Rtml::ReverseEngineering::Simulator::VariableValue) ? varval.value : varval)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
default_value_for_type(known_variable_types[name])
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def default_value_for_type(type)
|
|
27
|
+
case type
|
|
28
|
+
when :integer then 1
|
|
29
|
+
else "generic"
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Used by +Rtml::ReverseEngineering::Simulator+ to track the value of a variable. Attempts
|
|
2
|
+
# to build a logical value by processing the setvar's :lo, :op and :ro attributes. References to
|
|
3
|
+
# other variables are automatically resolved. References to nonexistent values assume built-in variables
|
|
4
|
+
# and assign generic values to them.
|
|
5
|
+
#
|
|
6
|
+
# Implements a #== method to see if one variable's value is equal to another's, though this may not always be accurate.
|
|
7
|
+
#
|
|
8
|
+
class Rtml::ReverseEngineering::Simulator::VariableValue
|
|
9
|
+
include Rtml::ReverseEngineering::Simulator::VariableLookup
|
|
10
|
+
attr_reader :value
|
|
11
|
+
|
|
12
|
+
def initialize(setvar, all_variables, known_variable_types)
|
|
13
|
+
@setvar, @all_variables, @known_variable_types = setvar, all_variables, known_variable_types
|
|
14
|
+
@value = setvar.to_s
|
|
15
|
+
|
|
16
|
+
%w(lo op ro).each { |i| instance_variable_set("@#{i}", resolve(self.send(i), all_variables, known_variable_types)) }
|
|
17
|
+
catch(:done) do
|
|
18
|
+
check_for_assignment
|
|
19
|
+
check_for_operation
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
do_casting
|
|
23
|
+
check_boundaries
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def ==(other)
|
|
27
|
+
self.value == other.value
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
private
|
|
31
|
+
attr_reader :setvar, :all_variables, :known_variable_types
|
|
32
|
+
|
|
33
|
+
def type
|
|
34
|
+
@type ||= known_variable_types[setvar['name']]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def check_boundaries
|
|
38
|
+
case type
|
|
39
|
+
when :integer
|
|
40
|
+
unless (-999999999..999999999).include? @value
|
|
41
|
+
raise RulesViolationError, "TML numbers must be no more than 9 digits in length: #{@value}"
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def do_casting
|
|
47
|
+
@value = case type
|
|
48
|
+
when :integer then value.to_i
|
|
49
|
+
else value.to_s
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def check_for_operation
|
|
54
|
+
unless setvar['op'].blank?
|
|
55
|
+
method_name = "perform_operation_#{setvar['op']}"
|
|
56
|
+
@value = self.send(method_name)
|
|
57
|
+
throw :done
|
|
58
|
+
end
|
|
59
|
+
rescue NoMethodError
|
|
60
|
+
raise Rtml::Error::InvalidOperation
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def check_for_assignment
|
|
64
|
+
if setvar['op'].blank? && !setvar['lo'].blank?
|
|
65
|
+
@value = setvar['lo']
|
|
66
|
+
throw :done
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def lo; @lo ||= setvar['lo']; end
|
|
71
|
+
def op; @op ||= setvar['op']; end
|
|
72
|
+
def ro; @ro ||= setvar['ro']; end
|
|
73
|
+
|
|
74
|
+
def perform_operation_plus
|
|
75
|
+
case type
|
|
76
|
+
when :integer then lo.to_i + ro.to_i
|
|
77
|
+
when :string then lo.to_s + ro.to_s
|
|
78
|
+
when :date then "#{lo.to_s} + #{ro.to_s}"
|
|
79
|
+
else raise Rtml::Errors::InvalidOperation
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def perform_operation_minus
|
|
84
|
+
case type
|
|
85
|
+
when :integer then lo.to_i - ro.to_i
|
|
86
|
+
when :string then lo.to_s[0..-(ro.to_i+1)]
|
|
87
|
+
when :date then "#{lo.to_s} - #{ro.to_s}"
|
|
88
|
+
else raise Rtml::Errors::InvalidOperation
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def perform_operation_number
|
|
93
|
+
case type
|
|
94
|
+
when :integer then lo.split(/;/).length
|
|
95
|
+
else raise Rtml::Errors::InvalidOperation
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def perform_operation_item
|
|
100
|
+
case type
|
|
101
|
+
when :string then lo.split(/;/)[ro.to_i]
|
|
102
|
+
else raise Rtml::Errors::InvalidOperation
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
class Rtml::Rules::DomRuleset
|
|
2
|
+
def initialize
|
|
3
|
+
@tags = HashWithIndifferentAccess.new
|
|
4
|
+
@root = nil
|
|
5
|
+
@order = HashWithIndifferentAccess.new
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def freeze
|
|
9
|
+
super
|
|
10
|
+
@tags.freeze
|
|
11
|
+
@root.freeze
|
|
12
|
+
@order.freeze
|
|
13
|
+
self
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Loads the ruleset from a file.
|
|
17
|
+
def parse(file)
|
|
18
|
+
instance_eval File.read(file), file, 1
|
|
19
|
+
self
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Loads the ruleset from a file.
|
|
23
|
+
def self.parse(file)
|
|
24
|
+
self.new.parse(file)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns the tag with the specified name, or nil if it can't be found
|
|
28
|
+
def tag_rules(name)
|
|
29
|
+
return nil unless tags.include?(name)
|
|
30
|
+
tag(name)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# If a parent and children are supplied, the parent element may contain the specified children. This does not
|
|
34
|
+
# enforce order.
|
|
35
|
+
# If a block is supplied, notation can be simplified.
|
|
36
|
+
#
|
|
37
|
+
# If a parent is supplied, the valid children for that parent are returned.
|
|
38
|
+
# If no parent is supplied, nil is returned.
|
|
39
|
+
#
|
|
40
|
+
# A few options are also allowed:
|
|
41
|
+
# :minimum => the minimum number of children, 0 for no minimum
|
|
42
|
+
# :maximum => the maximum number of children, 0 for no maximum
|
|
43
|
+
#
|
|
44
|
+
# Examples:
|
|
45
|
+
# ruleset.children :head, :base, :link, :defaults # [:base, :link, :defaults] are valid children of :head
|
|
46
|
+
#
|
|
47
|
+
# # Does the same thing:
|
|
48
|
+
# ruleset.children do
|
|
49
|
+
# head :base, :link, :defaults
|
|
50
|
+
# end
|
|
51
|
+
#
|
|
52
|
+
# # Retrieve the array of valid children for :head
|
|
53
|
+
# ruleset.children(:head)
|
|
54
|
+
#
|
|
55
|
+
def children(parent = nil, *children, &block)
|
|
56
|
+
r = nil
|
|
57
|
+
if parent # make sure all tags are registered
|
|
58
|
+
options = children.extract_options!
|
|
59
|
+
tags = tag(parent, *children)
|
|
60
|
+
parent_tag = tags.shift
|
|
61
|
+
parent_tag.child_tags << (children.flatten.collect { |i| i.to_s } + [options]) unless tags.empty?
|
|
62
|
+
r = parent_tag.children
|
|
63
|
+
end
|
|
64
|
+
if block_given?
|
|
65
|
+
proxy_into(:children).new(self).instance_eval &block
|
|
66
|
+
end
|
|
67
|
+
r
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Creates a proxy class for the specified method.
|
|
71
|
+
def proxy_into(method_name)
|
|
72
|
+
@proxy_classes ||= HashWithIndifferentAccess.new
|
|
73
|
+
return @proxy_classes[method_name] if @proxy_classes[method_name]
|
|
74
|
+
klass = Class.new
|
|
75
|
+
line = __LINE__ + 2
|
|
76
|
+
code = <<-end_code
|
|
77
|
+
def initialize(parent)
|
|
78
|
+
@parent = parent
|
|
79
|
+
# Proxy known tags in case they clash with Ruby methods
|
|
80
|
+
@parent.tags.each do |tag|
|
|
81
|
+
line = __LINE__ + 2
|
|
82
|
+
kode = <<-end_kode
|
|
83
|
+
def \#{tag}(*args, &block)
|
|
84
|
+
@parent.#{method_name} :\#{tag}, *args, &block
|
|
85
|
+
end
|
|
86
|
+
end_kode
|
|
87
|
+
instance_eval kode, __FILE__, line
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
def method_missing(name, *args, &block) @parent.#{method_name} name, *args, █ end
|
|
91
|
+
end_code
|
|
92
|
+
klass.class_eval code, __FILE__, line
|
|
93
|
+
@proxy_classes[method_name] = klass
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# If parent and children are supplied, the order of the children within the parent element will be enforced.
|
|
97
|
+
# If a block is supplied, notation can be simplified.
|
|
98
|
+
#
|
|
99
|
+
# If a parent is supplied, then the order of its children is returned.
|
|
100
|
+
# If no parent is supplied, then nil is returned.
|
|
101
|
+
#
|
|
102
|
+
# Examples:
|
|
103
|
+
# ruleset.order :head, :base, :link, :defaults # order [:base, :link, :defaults] beneath :head
|
|
104
|
+
#
|
|
105
|
+
# # Does the same thing:
|
|
106
|
+
# ruleset.order do
|
|
107
|
+
# head :base, :link, :defaults
|
|
108
|
+
# end
|
|
109
|
+
#
|
|
110
|
+
# # Retrieve the order of :head
|
|
111
|
+
# ruleset.order(:head)
|
|
112
|
+
#
|
|
113
|
+
def order(parent = nil, *children, &block)
|
|
114
|
+
if parent # make sure all tags are registered
|
|
115
|
+
parent_tag = tag(parent, *children).first
|
|
116
|
+
parent_tag.order.concat children.flatten.collect { |i| i.to_s }
|
|
117
|
+
end
|
|
118
|
+
if block_given?
|
|
119
|
+
proxy_into(:order).new(self).instance_eval &block
|
|
120
|
+
end
|
|
121
|
+
return tag(parent).order if parent
|
|
122
|
+
return nil
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Declares one or more tags. If a tag is used that has not been previously declared, it will be
|
|
126
|
+
# added automatically. Returns an array of all added tags, or the tag itself if there was only one.
|
|
127
|
+
#
|
|
128
|
+
# If no arguments are specified, nothing happens and an array of all registered tags is returned.
|
|
129
|
+
def tag(*value)
|
|
130
|
+
return @tags if value.empty?
|
|
131
|
+
ts = []
|
|
132
|
+
value.flatten.each do |t|
|
|
133
|
+
if @tags.key?(t) || !frozen?
|
|
134
|
+
ts << (@tags[t] ||= Rtml::Rules::DomTag.new(t.to_s))
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
ts.length == 1 ? ts.first : ts
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def all_tag_names
|
|
141
|
+
tags.collect { |a| a[0] }
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
alias tags tag
|
|
145
|
+
|
|
146
|
+
# Returns true if the specified String or Symbol represents a root tag.
|
|
147
|
+
def root?(name)
|
|
148
|
+
name.to_s == @root
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Returns true if the specified String or Symbol represents a tag.
|
|
152
|
+
def tag?(name)
|
|
153
|
+
tags.collect { |t| t.name }.include?(name.to_s)
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Specifies a root tag. If a root tag has already been specified, an error will be raised.
|
|
157
|
+
# If no root tag is specified, the current root tag is returned instead, or nil if there is none.
|
|
158
|
+
def root(*value)
|
|
159
|
+
unless value.empty?
|
|
160
|
+
raise Rtml::Errors::MultipleRootsError, "Can only have one root element" if @root
|
|
161
|
+
@root = value.shift.to_s
|
|
162
|
+
tag @root
|
|
163
|
+
end
|
|
164
|
+
@root
|
|
165
|
+
end
|
|
166
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
class Rtml::Rules::DomTag
|
|
2
|
+
attr_reader :name
|
|
3
|
+
attr_reader :child_tags
|
|
4
|
+
attr_reader :order
|
|
5
|
+
|
|
6
|
+
def initialize(name)
|
|
7
|
+
@name = name
|
|
8
|
+
@child_tags = []
|
|
9
|
+
@order = []
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def children
|
|
13
|
+
child_tags.flatten.select { |t| t.kind_of?(String) }
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def minimum(child_name) option_for_child(child_name, :minimum) end
|
|
17
|
+
def maximum(child_name) option_for_child(child_name, :maximum) end
|
|
18
|
+
|
|
19
|
+
# compatiblity with Array; see Tml::Dom::Ruleset
|
|
20
|
+
def first
|
|
21
|
+
self
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def ==(a)
|
|
25
|
+
a.kind_of?(String) ? a == name : a.name == name
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def to_s
|
|
29
|
+
name
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
private
|
|
33
|
+
def option_for_child(child_name, key)
|
|
34
|
+
child_tags.each do |children|
|
|
35
|
+
charr = children.dup
|
|
36
|
+
options = charr.extract_options!
|
|
37
|
+
unless charr.select { |i| i == child_name }.empty?
|
|
38
|
+
return options[key].to_i
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
raise "Element with name '#{child_name}' is not allowed within parent '#{name}'"
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
module Rtml::Rules::DomValidation
|
|
2
|
+
# Validates that the TML produced by the given string or Rtml::Document is well-formed and syntactically valid
|
|
3
|
+
def validate_tml(doc)
|
|
4
|
+
if doc.kind_of?(String) || doc.kind_of?(Symbol)
|
|
5
|
+
tag = Hpricot::XML(doc.respond_to?(:to_tml) ? doc.to_tml : doc).root
|
|
6
|
+
else tag = doc
|
|
7
|
+
end
|
|
8
|
+
validate_tml_tag(tag)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Validates that the TML produced by the specified tag matches the overall structure. Structure can be
|
|
12
|
+
# a symbol, an array of symbols, or a hash of symbols and arrays of symbols. Only tag names are matched.
|
|
13
|
+
# The tag may contain additional tags, so this method should be used to check that the tag contains
|
|
14
|
+
# *at least* the given structure, and not to check for *at most* the given structure.
|
|
15
|
+
#
|
|
16
|
+
# Example:
|
|
17
|
+
# validate_tml_dom("<tml><screen id='init'><next uri='#main' /><display> . . . </display></screen></tml>",
|
|
18
|
+
# :tml => { :screen => [ :next, :display ] }) #=> true
|
|
19
|
+
def validate_tml_dom(tag, structure)
|
|
20
|
+
structure = ignore_root_tag(structure)
|
|
21
|
+
tag = root_hpricot_tag(tag)
|
|
22
|
+
|
|
23
|
+
matches = []
|
|
24
|
+
case structure
|
|
25
|
+
when String, Symbol then matches.concat validate_tml_dom_with_string(tag, structure)
|
|
26
|
+
when Array then matches.concat validate_tml_dom_with_array(tag, structure)
|
|
27
|
+
when Hash then matches.concat validate_tml_dom_with_hash(tag, structure)
|
|
28
|
+
else raise ArgumentError, "Expected a String, Symbol, Array or Hash argument", caller
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
matches
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Validates that the TML produced by the specified tag is syntactically valid. Does not check its parent.
|
|
35
|
+
def validate_tml_tag(tag, parent_options = {})
|
|
36
|
+
tag = root_hpricot_tag(tag)
|
|
37
|
+
tag_name = tag.name
|
|
38
|
+
tag_rules = rules.tag_rules(tag_name) # contains :name, :minimum, :maximum, :children, :order
|
|
39
|
+
tracker = {}
|
|
40
|
+
|
|
41
|
+
validate_tag_exists(tag_name)
|
|
42
|
+
|
|
43
|
+
# add to parent_options for tracking, to match against minimum after children have been validated
|
|
44
|
+
parent_options[tag_name] = parent_options[tag_name].to_i + 1
|
|
45
|
+
|
|
46
|
+
if tag.children
|
|
47
|
+
assert_children_in_order(tag)
|
|
48
|
+
tag.children.each do |child|
|
|
49
|
+
next unless child.kind_of?(Hpricot::Elem)
|
|
50
|
+
assert_element_allowed(tag, child)
|
|
51
|
+
validate_tml_tag(child, tracker)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# assert each child >= minimum (&& <= maximum unless maximum == 0)
|
|
55
|
+
tag_rules.children.each do |child_name|
|
|
56
|
+
count = tracker[child_name] || 0
|
|
57
|
+
minimum = rules.tag(tag_name).minimum(child_name)
|
|
58
|
+
maximum = rules.tag(tag_name).maximum(child_name)
|
|
59
|
+
raise Rtml::Errors::RulesViolationError, "Too few '#{child_name}' tags within parent '#{tag_name}'" unless count >= minimum
|
|
60
|
+
raise Rtml::Errors::RulesViolationError, "Too many '#{child_name}' tags within parent '#{tag_name}'" unless maximum == 0 || count <= maximum
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
private
|
|
66
|
+
def validate_tag_exists(tag_name)
|
|
67
|
+
raise Rtml::Errors::RulesViolationError, "Tag does not exist: #{tag_name}" unless rules.tag_rules(tag_name)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def validate_tml_dom_with_hash(tag, structure)
|
|
71
|
+
matches = []
|
|
72
|
+
structure.each do |parent, child|
|
|
73
|
+
unless parent.kind_of?(String) || parent.kind_of?(Symbol)
|
|
74
|
+
raise ArgumentError, "Keys of hashes should be symbols or strings", caller
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
matches.concat validate_tml_dom(tag, parent)
|
|
78
|
+
failure = true
|
|
79
|
+
matches.each do |match|
|
|
80
|
+
begin
|
|
81
|
+
validate_tml_dom(match, child)
|
|
82
|
+
failure = false
|
|
83
|
+
rescue Rtml::Errors::RulesViolationError
|
|
84
|
+
|
|
85
|
+
end
|
|
86
|
+
break unless failure
|
|
87
|
+
end
|
|
88
|
+
raise Rtml::Errors::RulesViolationError, "Expected all of #{structure.inspect} but found #{tag}" if failure
|
|
89
|
+
end
|
|
90
|
+
matches
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def validate_tml_dom_with_array(tag, structure)
|
|
94
|
+
matches = []
|
|
95
|
+
structure.each do |e|
|
|
96
|
+
begin
|
|
97
|
+
matches.concat validate_tml_dom(tag, e)
|
|
98
|
+
rescue
|
|
99
|
+
raise Rtml::Errors::RulesViolationError,
|
|
100
|
+
"Expected all of #{structure.inspect} but couldn't find #{e.to_s}\nin tml: #{tag}"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
matches
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def validate_tml_dom_with_string(tag, structure)
|
|
107
|
+
matches = []
|
|
108
|
+
matches.concat tag / structure
|
|
109
|
+
if matches.empty?
|
|
110
|
+
raise Rtml::Errors::RulesViolationError,
|
|
111
|
+
"Expected <#{structure.inspect}> but found\n#{tag.to_s}\nin tml: #{tag}"
|
|
112
|
+
end
|
|
113
|
+
matches
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def ignore_root_tag(structure)
|
|
117
|
+
if structure.kind_of?(Hash) && structure.keys.length == 1 && structure.keys.first.to_s == rules.root
|
|
118
|
+
structure.delete(structure.keys[0])
|
|
119
|
+
else
|
|
120
|
+
structure.kind_of?(Symbol) ? structure.to_s : structure
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def root_hpricot_tag(tag)
|
|
125
|
+
if tag.kind_of?(String) then Hpricot::XML(tag).root
|
|
126
|
+
elsif tag.respond_to?(:to_tml) then Hpricot::XML(tag.to_tml).root
|
|
127
|
+
else tag
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def rules
|
|
132
|
+
@rules ||= Rtml::Document.rules
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# asserts that all children of the given tag appear in their proper order.
|
|
136
|
+
def assert_children_in_order(element)
|
|
137
|
+
# assert children appear in order
|
|
138
|
+
tag_name = element.name
|
|
139
|
+
tag_rules = rules.tag_rules(tag_name)
|
|
140
|
+
prev_index = -1
|
|
141
|
+
element.children.each do |child|
|
|
142
|
+
chn = child.name
|
|
143
|
+
prn = '[no element]'
|
|
144
|
+
index = tag_rules.order.index(child.name)
|
|
145
|
+
unless index.nil? # if element is not mentioned, then it can appear at any time.
|
|
146
|
+
unless index >= prev_index
|
|
147
|
+
raise Rtml::Errors::RulesViolationError, "Elements out of order: '#{chn}' follows '#{prn}' within parent '#{tag_name}'"
|
|
148
|
+
end
|
|
149
|
+
prev_index = index
|
|
150
|
+
prn = chn
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# asserts that child is allowed to appear within element
|
|
156
|
+
def assert_element_allowed(element, child)
|
|
157
|
+
tag_rules = rules.tag_rules(element.name)
|
|
158
|
+
unless tag_rules.children.include?(child.name)
|
|
159
|
+
raise Rtml::Errors::RulesViolationError, "Tag '#{child.name}' not allowed within parent '#{element.name}'"
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|