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
|
@@ -5,38 +5,38 @@
|
|
|
5
5
|
# application/x-www-form-urlencoded data instead of XML, which would
|
|
6
6
|
# render this class unnecessary overhead.
|
|
7
7
|
#
|
|
8
|
-
class Rtml::TmlParamParser
|
|
8
|
+
class Rtml::Rules::TmlParamParser
|
|
9
9
|
attr_reader :params
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
def initialize(data)
|
|
12
12
|
tml = Hpricot.XML(data)
|
|
13
13
|
tmlpost = tml.at('tmlpost')
|
|
14
14
|
postvars = tml.search("//postvar")
|
|
15
15
|
@params = {}.with_indifferent_access
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
if tmlpost and postvars
|
|
18
18
|
params[:post_id] = tmlpost['post_id'].to_i
|
|
19
|
-
params[:date]
|
|
20
|
-
params[:itid]
|
|
21
|
-
params[:xmlns]
|
|
19
|
+
params[:date] = Date.parse(tmlpost['date'])
|
|
20
|
+
params[:itid] = tmlpost['itid']
|
|
21
|
+
params[:xmlns] = tmlpost['xmlns']
|
|
22
22
|
p = {}
|
|
23
23
|
postvars.each do |postvar|
|
|
24
24
|
name, value = name_and_value_of postvar
|
|
25
25
|
p[name] = value
|
|
26
26
|
end
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
# The reason this is broken into two phases is because if we don't, there's a chance we'll
|
|
29
29
|
# miss a value that looks like (but isn't) a namespace. Example:
|
|
30
30
|
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
31
|
+
# card.pin = '3C30E0EEB1978A58' # this is actually the pin block itself
|
|
32
|
+
# card.pin.smid = '00000E0001E000CB' # this is the smid
|
|
33
33
|
#
|
|
34
34
|
# When parsed from parmstr, card.pin.smid would normally create params[:card][:pin] = {:smid => '...'}
|
|
35
35
|
# But this would overwrite card.pin = '3C30E0EEB1978A58', and we'd lose the pin block. It'd probably
|
|
36
36
|
# be more correct to fix this at the TML level, but we can't expect every TML developer to figure that
|
|
37
37
|
# out, and RTML can only help so much. It breaks the convention, but I think it's safer in the
|
|
38
38
|
# long run to turn this into params[:card][:pin] and params[:card]['pin.smid']. Even though it
|
|
39
|
-
# will doubtlessly add confusion to a developer who has to work with it, at least this confusion
|
|
39
|
+
# will doubtlessly add confusion to a developer who has to work with it, at least this confusion
|
|
40
40
|
# should be rare in RTML (because RTML sorts all this info into its Transaction model and expects
|
|
41
41
|
# the developer to deal with transactions through the model, and not the params themselves).
|
|
42
42
|
#
|
|
@@ -52,7 +52,7 @@ class Rtml::TmlParamParser
|
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
54
|
end
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
private
|
|
57
57
|
def sort_and_assign(name, value, p = params)
|
|
58
58
|
if name =~ /\./
|
|
@@ -67,7 +67,7 @@ class Rtml::TmlParamParser
|
|
|
67
67
|
p[name] = value
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
def name_and_value_of(postvar)
|
|
72
72
|
type = postvar['type']
|
|
73
73
|
name = postvar['name']
|
|
@@ -79,12 +79,11 @@ class Rtml::TmlParamParser
|
|
|
79
79
|
when 'date' then DateTime.strptime(value, "%d %m %Y %H:%M:%S").to_time
|
|
80
80
|
when 'integer' then value.to_i
|
|
81
81
|
when 'string' then value
|
|
82
|
-
|
|
83
|
-
when 'opaque' then value
|
|
82
|
+
when 'opaque' then value.hex_to_bin
|
|
84
83
|
# Decided to simply assign string value instead of raising error on unknown types, so that user
|
|
85
84
|
# can handle it without having to hack the framework.
|
|
86
85
|
else value
|
|
87
|
-
#else raise "Unknown TML type: #{type}"
|
|
86
|
+
#else raise ArgumentError, "Unknown TML type: #{type}"
|
|
88
87
|
end
|
|
89
88
|
rescue
|
|
90
89
|
warn "Error #{$!.message} while parsing value #{value.inspect} for TML param #{name.inspect} (#{type})"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
begin
|
|
2
|
+
require 'webrat'
|
|
3
|
+
rescue LoadError
|
|
4
|
+
# optional. Or should it be?
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
class RtmlExampleGroup < (defined?(Test::Unit::TestCase) ? Test::Unit::TestCase : Object)
|
|
8
|
+
extend Spec::Example::ExampleGroupMethods
|
|
9
|
+
include Spec::Example::ExampleMethods
|
|
10
|
+
include(Webrat::Matchers) if defined?(Webrat)
|
|
11
|
+
include(Rtml::Rules::DomValidation)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
Spec::Example::ExampleGroupFactory.register(:rtml, RtmlExampleGroup)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# This module provides helpers to "TML-ize" conditions.
|
|
2
|
+
module Rtml::TmlizedConditions
|
|
3
|
+
# returns [lo, op, ro] such that each are valid within a <variant> element.
|
|
4
|
+
#
|
|
5
|
+
# Condition can be :if or :unless.
|
|
6
|
+
#
|
|
7
|
+
def tmlize_condition(lo, op, ro, condition = :if)
|
|
8
|
+
raise ArgumentError, "Expected condition to be :if or :unless" unless [:if, :unless].include? condition
|
|
9
|
+
case op
|
|
10
|
+
when '<', 'less', 'less_than' then lo, op, ro = lo, 'less', ro
|
|
11
|
+
when '<=', 'less_or_equal', 'less_than_or_equal_to' then lo, op, ro = lo, 'less_or_equal', ro
|
|
12
|
+
when '>=', 'greater_or_equal', 'greater_than_or_equal_to' then lo, op, ro = ro, 'less', lo
|
|
13
|
+
when '>', 'greater', 'greater_than' then lo, op, ro = ro, 'less_or_equal', lo
|
|
14
|
+
when '==', 'equal', 'equal_to' then lo, op, ro = lo, 'equal', ro
|
|
15
|
+
when '!=', 'not_equal', 'not_equal_to' then lo, op, ro = lo, 'not_equal', ro
|
|
16
|
+
when '=~' then op = 'contains'
|
|
17
|
+
when '+', 'plus' then op = 'plus'
|
|
18
|
+
when '-', 'minus' then op = 'minus'
|
|
19
|
+
end
|
|
20
|
+
op = invert_condition(op) if condition == :unless
|
|
21
|
+
[lo, op, ro]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Returns the operation that is the opposite of the specified operation.
|
|
25
|
+
def invert_condition(op)
|
|
26
|
+
case op
|
|
27
|
+
when 'less' then 'greater'
|
|
28
|
+
when 'less_or_equal' then 'greater_or_equal'
|
|
29
|
+
when 'greater_or_equal' then 'less_or_equal'
|
|
30
|
+
when 'greater' then 'less'
|
|
31
|
+
when 'equal' then 'not_equal'
|
|
32
|
+
when 'not_equal' then 'equal'
|
|
33
|
+
when 'plus' then 'minus'
|
|
34
|
+
when 'minus' then 'plus'
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
data/lib/rtml/version.rb
ADDED
data/lib/rtml/widget.rb
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# The Widget is the driving force behind RubyTML. It is interaction with Widgets of all shapes and sizes that produces
|
|
2
|
+
# a document model and, finally, the TML document itself. A Widget is so named because it is a generic class that can
|
|
3
|
+
# be made to encapsulate any desired functionality. The Rtml::Widget base class takes care of interfacing content
|
|
4
|
+
# generation code with the RTML project as a whole.
|
|
5
|
+
#
|
|
6
|
+
# If you've done any RTML programming at all, you've been using Widgets. Does the following code look familiar?
|
|
7
|
+
#
|
|
8
|
+
# screen :idle, :next => :main, :timeout => 3 do
|
|
9
|
+
# display
|
|
10
|
+
# end
|
|
11
|
+
#
|
|
12
|
+
# Even core functionality such as the "screen" method is traced back to a Widget -- in this case,
|
|
13
|
+
# +Rtml::Widgets::Screens+.
|
|
14
|
+
#
|
|
15
|
+
# Since interfacing with the various components of RTML is handled by the base class, writing a Widget is easy:
|
|
16
|
+
#
|
|
17
|
+
# class Rtml::Widgets::CardParser < Rtml::Widget
|
|
18
|
+
# affects :screen
|
|
19
|
+
# entry_point :card
|
|
20
|
+
#
|
|
21
|
+
# def card(options = {})
|
|
22
|
+
# raise ":parser must be provided" unless options[:parser]
|
|
23
|
+
# parent.build :card, :parser => options[:parser], :parser_params => (options[:params] || 'read_data')
|
|
24
|
+
# end
|
|
25
|
+
# end
|
|
26
|
+
#
|
|
27
|
+
# When invoked from a Screen, this code will produce a TML card parser element:
|
|
28
|
+
# screen . . . do
|
|
29
|
+
# card :parser => :mag #=> <card parser='mag' params='read_data' />
|
|
30
|
+
# end
|
|
31
|
+
#
|
|
32
|
+
# If you are just interested in using the Widgets, you are encouraged to read the documentation for the various Widgets
|
|
33
|
+
# themselves. If you find that you need to program a new Widget in order to address some missing functionality, you can
|
|
34
|
+
# generate one easily with the command line generator:
|
|
35
|
+
# ruby script/generate widget my_widget [entry_point1 entry_point2 . . .]
|
|
36
|
+
#
|
|
37
|
+
class Rtml::Widget
|
|
38
|
+
# These are the accessors that RDoc uses to define what a particular RTML-specific attribute maps to.
|
|
39
|
+
#
|
|
40
|
+
# There are 3 kinds of accessors:
|
|
41
|
+
# - Shared variable
|
|
42
|
+
# * These are used to create variables that are different across parent objects, but which are shared between
|
|
43
|
+
# multiple Widgets (whether totally separate, or instances of the same) on the same instantiated parent.
|
|
44
|
+
# It's a little complicated, but it's critical in (for example) tracking TML variable definitions.
|
|
45
|
+
# - Valid parent
|
|
46
|
+
# * These are the names of TML elements (or "document" for document-level Widgets) that are allowed to instantiate
|
|
47
|
+
# the Widget in question by calling its entry points.
|
|
48
|
+
# - Entry point
|
|
49
|
+
# * These are instance methods defined by the Widget which are proxied into potential parent objects. Calling an
|
|
50
|
+
# entry point results in the configuration and eventual instantiation of the Widget which declared the entry
|
|
51
|
+
# point.
|
|
52
|
+
#
|
|
53
|
+
RDOC_ACCESSORS = {
|
|
54
|
+
:shared => 'shared variable',
|
|
55
|
+
:affects => 'valid parent',
|
|
56
|
+
:entry_point => "entry point",
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@@widget_id_tracker = 0
|
|
60
|
+
class_inheritable_array :targets
|
|
61
|
+
class_inheritable_array :shared_variables
|
|
62
|
+
class_inheritable_array :entry_points
|
|
63
|
+
read_inheritable_attribute(:targets) || write_inheritable_attribute(:targets, [])
|
|
64
|
+
read_inheritable_attribute(:shared_variables) || write_inheritable_attribute(:shared_variables, [])
|
|
65
|
+
read_inheritable_attribute(:entry_points) || write_inheritable_attribute(:entry_points, [])
|
|
66
|
+
attr_reader :parent
|
|
67
|
+
attr_reader :source_type
|
|
68
|
+
extend Rtml::WidgetCore::ClassMethods
|
|
69
|
+
|
|
70
|
+
def validate_parent(*options)
|
|
71
|
+
options = options.flatten.collect { |o| o.kind_of?(String) ? o : o.to_s }
|
|
72
|
+
unless options.include?(parent.name)
|
|
73
|
+
raise ArgumentError, "Expected parent to be one of #{options.to_sentence(:language => :en)}; found #{parent.name}"
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def document
|
|
78
|
+
@document ||= (parent.kind_of?(Rtml::Document) || !parent.respond_to?(:document) ? parent : parent.document)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# A guaranteed unique ID for this Widget.
|
|
82
|
+
def widget_id
|
|
83
|
+
@widget_id ||= (@@widget_id_tracker += 1)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def initialize(parent)
|
|
87
|
+
@parent = parent
|
|
88
|
+
set_source_type!
|
|
89
|
+
parent.widget_instances << self
|
|
90
|
+
# proxy parent methods into parent, unless they exist for widget already
|
|
91
|
+
singleton_class = (class << self; self; end)
|
|
92
|
+
(@parent.public_methods - self.public_methods).each do |proxy_method|
|
|
93
|
+
# don't delegate entry points -- this addresses the infinite loop issue in which calling a method that's been
|
|
94
|
+
# defined as an entry point but hasn't been created in the Widget itself would recurse back into the parent
|
|
95
|
+
# object forever.
|
|
96
|
+
unless entry_points.include? proxy_method
|
|
97
|
+
singleton_class.send(:delegate, proxy_method, :to => :parent)
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
self.class.shared_variables.each do |sv|
|
|
103
|
+
unless @parent.instance_variable_get("@#{sv[:name]}")
|
|
104
|
+
if sv[:default_value]
|
|
105
|
+
if sv[:default_value].kind_of?(Class)
|
|
106
|
+
@parent.instance_variable_set("@#{sv[:name]}", sv[:default_value].new)
|
|
107
|
+
else
|
|
108
|
+
@parent.instance_variable_set("@#{sv[:name]}", sv[:default_value].dup)
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Returns true if subprocessing has been disabled. See also #disable_subprocessing!
|
|
116
|
+
def subprocessing_disabled?
|
|
117
|
+
@disable_subprocessing = self.class.disable_subprocessing? unless defined?(@disable_subprocessing)
|
|
118
|
+
@disable_subprocessing
|
|
119
|
+
end
|
|
120
|
+
alias disable_subprocessing? subprocessing_disabled?
|
|
121
|
+
|
|
122
|
+
# Use this to enable subprocessing after it has already been disabled. See #disable_subprocessing!
|
|
123
|
+
def enable_subprocessing!
|
|
124
|
+
@disable_subprocessing = false
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# By default, if a Widget's entry point is called with a block argument, it will be passed into the #process method
|
|
128
|
+
# of the entry point's return value. This is called subprocessing -- that is, processing the element to be returned
|
|
129
|
+
# at a lower level. This method disables subprocessing and its related assertions. It's useful, for instance, if you
|
|
130
|
+
# want to manually control how or when the block argument is processed, or if you want to ignore it entirely.
|
|
131
|
+
#
|
|
132
|
+
# There is a class method of the same name that has the same effect for the entire class; this instance method can
|
|
133
|
+
# disable subprocessing for particular instances, and is useful if you only want subprocessing under certain
|
|
134
|
+
# conditions.
|
|
135
|
+
def disable_subprocessing!
|
|
136
|
+
@disable_subprocessing = true
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
alias parent_type source_type
|
|
140
|
+
|
|
141
|
+
private
|
|
142
|
+
def set_source_type!
|
|
143
|
+
case parent
|
|
144
|
+
when Rtml::Document
|
|
145
|
+
@source_type = :document
|
|
146
|
+
else
|
|
147
|
+
@source_type = parent.name.to_sym
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
module Rtml::WidgetCore::ClassMethods
|
|
2
|
+
@@gui_enabled_widgets = {}
|
|
3
|
+
|
|
4
|
+
def proxy_module
|
|
5
|
+
return @proxy_module if @proxy_module
|
|
6
|
+
@proxy_module = Module.new
|
|
7
|
+
@proxy_module.instance_variable_set("@shared_variables", shared_variables)
|
|
8
|
+
@proxy_module.instance_eval do
|
|
9
|
+
def included(base)
|
|
10
|
+
@shared_variables.each do |sv|
|
|
11
|
+
base.send(:attr_accessor, sv[:name])
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
@proxy_module
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Yields this Widget's GUI configuration to the supplied block, allowing you to set up your Widget to be accessible
|
|
20
|
+
# from the RTML Application Builder. Note that if this method is never called, your Widget will not be available to
|
|
21
|
+
# the GUI.
|
|
22
|
+
def gui
|
|
23
|
+
yield(gui_configuration)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Returns the +Rtml::WidgetCore::GuiConfiguration+ instance for this Widget.
|
|
27
|
+
# Shorthand for:
|
|
28
|
+
# widget.gui_enabled_widgets[widget]
|
|
29
|
+
def gui_configuration
|
|
30
|
+
gui_enabled_widgets[self] ||= Rtml::WidgetCore::GuiConfiguration.new(self)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
## Returns the array of Widgets that have called the #gui method, thereby marking themselves as accessible to the
|
|
34
|
+
## RTML Application Builder.
|
|
35
|
+
def gui_enabled_widgets
|
|
36
|
+
@@gui_enabled_widgets
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Creates a "shared" variable for the parent object with the specified default value, if any. This is much like
|
|
40
|
+
# a class variable, except that it is unique to the parent object in question. Multiple calls to a Widget's
|
|
41
|
+
# entry point will result in multiple Widgets being instantiated. If you use an instance variable to hold data,
|
|
42
|
+
# then that instance variable will be different for every entry point called. However, sometimes you need to share
|
|
43
|
+
# data across multiple instances of the same Widget, but not across *all* instances of the same Widget. For
|
|
44
|
+
# instance, your Widget may want to track references to variables in an individual Screen, but not across multiple
|
|
45
|
+
# Screens. To accomplish this, you essentially need an instance variable for the Screen. The "shared" method
|
|
46
|
+
# manages these variables for you.
|
|
47
|
+
#
|
|
48
|
+
# Examples:
|
|
49
|
+
# shared :tml_variables
|
|
50
|
+
# shared :variable_definitions, :variable_declarations
|
|
51
|
+
# shared :tml_variables => [] # initializes #tml_variables to [].dup
|
|
52
|
+
def shared(*names)
|
|
53
|
+
names.each do |name|
|
|
54
|
+
if name.kind_of? Hash
|
|
55
|
+
value = name.values.first
|
|
56
|
+
name = name.keys.first.to_s
|
|
57
|
+
shared_variables << { :name => name, :default_value => value }
|
|
58
|
+
else
|
|
59
|
+
name = name.to_s
|
|
60
|
+
shared_variables << { :name => name, :default_value => nil }
|
|
61
|
+
end
|
|
62
|
+
delegate name, "#{name}=", :to => :parent
|
|
63
|
+
end
|
|
64
|
+
reinclude_proxy_module
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# By default, if a Widget's entry point is called with a block argument, it will be passed into the #process method
|
|
68
|
+
# of the entry point's return value. This is called subprocessing -- that is, processing the element to be returned
|
|
69
|
+
# at a lower level. This method disables subprocessing and its related assertions. It's useful, for instance, if you
|
|
70
|
+
# want to manually control how or when the block argument is processed, or if you want to ignore it entirely.
|
|
71
|
+
#
|
|
72
|
+
# If you want to disable subprocessing only under certain conditions, see the instance method of the same name.
|
|
73
|
+
def disable_subprocessing!
|
|
74
|
+
@disable_subprocessing = true
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Use this to enable subprocessing after it has already been disabled. See #disable_subprocessing!
|
|
78
|
+
def enable_subprocessing!
|
|
79
|
+
@disable_subprocessing = false
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Returns true if subprocessing has been disabled. See also #disable_subprocessing!
|
|
83
|
+
def subprocessing_disabled?
|
|
84
|
+
@disable_subprocessing ||= false
|
|
85
|
+
end
|
|
86
|
+
alias disable_subprocessing? subprocessing_disabled?
|
|
87
|
+
|
|
88
|
+
# Specifies the targets that this Widget will affect. A target can be a name of a model or the name of a TML tag,
|
|
89
|
+
# which matches that model's "name" attribute.
|
|
90
|
+
#
|
|
91
|
+
# Examples:
|
|
92
|
+
# affects :document, :element, :property # names of models
|
|
93
|
+
# affects :tml, :head, :screen # names of TML tags
|
|
94
|
+
#
|
|
95
|
+
def affects(*targets)
|
|
96
|
+
targets.flatten.each do |target|
|
|
97
|
+
target = target.to_s unless target.kind_of?(String)
|
|
98
|
+
unless self.targets.include? target
|
|
99
|
+
self.targets << target
|
|
100
|
+
map = Rtml::Widgets.mapping(target)
|
|
101
|
+
map.proxied_widgets << self
|
|
102
|
+
map.imbue(proxy_module)
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Goes through each of the targets of this Widget, looks up its mapping in Rtml::Widgets.mapping, and calls
|
|
108
|
+
# proxy_module.append_features(mapping) for each of those mappings.
|
|
109
|
+
def reinclude_proxy_module
|
|
110
|
+
targets.each do |target|
|
|
111
|
+
Rtml::Widgets.mapping(target).imbue(proxy_module)
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Specifies entry points, which are names of methods that can be called from the targets to invoke this Widget.
|
|
116
|
+
#
|
|
117
|
+
# Examples:
|
|
118
|
+
# entry_point :screen
|
|
119
|
+
#
|
|
120
|
+
def entry_point(*names)
|
|
121
|
+
names.each do |name|
|
|
122
|
+
name = name.to_s
|
|
123
|
+
unless entry_points.include?(name)
|
|
124
|
+
entry_points << name
|
|
125
|
+
add_entry_point(name)
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Adds the specified entry point to this Widget's proxy module.
|
|
131
|
+
def add_entry_point(entry_point)
|
|
132
|
+
# This validation doesn't work because it's not this proxy module, it's those of the OTHER Widgets
|
|
133
|
+
# that should be checked. Not sure of the best way to do that yet.
|
|
134
|
+
# if proxy_module.public_instance_methods.include?(entry_point)
|
|
135
|
+
# raise Rtml::Errors::RulesViolationError,
|
|
136
|
+
# "Widget entry point #{entry_point} cannot be defined because it already exists!"
|
|
137
|
+
# end
|
|
138
|
+
entry_point = entry_point.to_s if entry_point.is_a?(Symbol)
|
|
139
|
+
|
|
140
|
+
enter_from_hash = "#{entry_point}_from_hash"
|
|
141
|
+
['?','!'].each do |i|
|
|
142
|
+
enter_from_hash = enter_from_hash.gsub(/#{Regexp::escape(i)}/, '') + i if enter_from_hash[i]
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
line = __LINE__ + 2
|
|
146
|
+
code = <<-end_code
|
|
147
|
+
def #{entry_point}(*args, &block) # def screen(*args, &block)
|
|
148
|
+
widget = #{self.name}.new(self) # widget = Rtml::Widgets::Screens.new(self)
|
|
149
|
+
r = widget.#{entry_point}(*args, &block) # r = widget.screen(*args, &block)
|
|
150
|
+
|
|
151
|
+
unless widget.disable_subprocessing? || !block_given?
|
|
152
|
+
unless r.respond_to?(:process)
|
|
153
|
+
raise Rtml::Errors::SubprocessingNotSupported, "Return value \#{r} does not support subprocessing"
|
|
154
|
+
end
|
|
155
|
+
r.process &block
|
|
156
|
+
end
|
|
157
|
+
r
|
|
158
|
+
rescue ArgumentError => ae
|
|
159
|
+
if ae.backtrace[0] =~ /#{Regexp::escape entry_point}/
|
|
160
|
+
raise ArgumentError, ae.message, caller
|
|
161
|
+
else raise ae
|
|
162
|
+
end
|
|
163
|
+
end # end
|
|
164
|
+
|
|
165
|
+
# Calls the entry point after reformatting the arguments in hash to fit the entry point's requirements
|
|
166
|
+
# per +Rtml::WidgetCore::GuiConfiguration#construct_arguments+
|
|
167
|
+
#
|
|
168
|
+
# This is primarily for interfacing with the RTML GUI.
|
|
169
|
+
#
|
|
170
|
+
def #{enter_from_hash}(hash, &block)
|
|
171
|
+
arguments = #{self}.gui_configuration.construct_arguments(hash || {})
|
|
172
|
+
self.#{entry_point} *arguments, &block
|
|
173
|
+
end
|
|
174
|
+
end_code
|
|
175
|
+
proxy_module.class_eval code, __FILE__, line
|
|
176
|
+
reinclude_proxy_module
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Returns true if the specified class is a valid target of this Widget
|
|
180
|
+
def target?(base)
|
|
181
|
+
if base.respond_to?(:name)
|
|
182
|
+
name = base.name.underscore.sub(/^.*\//, '')
|
|
183
|
+
targets.each do |target|
|
|
184
|
+
if base.kind_of?(ActiveRecord::Base) # it's an instance, so we should check the tag name, not the class name
|
|
185
|
+
return true if target == base.name
|
|
186
|
+
else
|
|
187
|
+
return true if target == name
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
false
|
|
192
|
+
end
|
|
193
|
+
end
|