rtml 1.2.2 → 2.0.0.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +2 -2
- data/Manifest.txt +199 -389
- data/PostInstall.txt +6 -1
- data/README.rdoc +111 -26
- data/Rakefile +29 -33
- data/app_generators/rtml/USAGE +2 -2
- data/app_generators/rtml/rtml_generator.rb +2 -2
- data/app_generators/rtml/templates/rtml_template.rb +26 -0
- data/bin/rtml +2 -2
- data/builtin/controllers/rtml_controller.rb +58 -0
- data/builtin/models/rtml/document.rb +150 -0
- data/builtin/models/rtml/dom/element.rb +196 -0
- data/builtin/models/rtml/dom/frontend_element.rb +48 -0
- data/builtin/models/rtml/dom/property.rb +71 -0
- data/builtin/models/rtml/dom/screen_element.rb +14 -0
- data/builtin/models/rtml/instruction.rb +52 -0
- data/builtin/models/rtml/instruction/follow_class_methods.rb +101 -0
- data/builtin/models/rtml/state.rb +20 -0
- data/builtin/models/rtml/state/variable_mapping.rb +13 -0
- data/builtin/models/rtml/view.rb +5 -0
- data/builtin/rtml_helpers/rtml/get_state.rb +23 -0
- data/builtin/rtml_helpers/rtml/rescue_action.rb +25 -0
- data/builtin/views/rtml/rescue_action_in_public.rtml.erb +1 -0
- data/builtin/views/rtml/rescue_action_locally.rtml.erb +29 -0
- data/builtin/widgets/default_document.rb +25 -0
- data/builtin/widgets/document_variable_processing.rb +133 -0
- data/builtin/widgets/element_builder.rb +148 -0
- data/builtin/widgets/event_listener.rb +41 -0
- data/builtin/widgets/frontend.rb +71 -0
- data/builtin/widgets/highlevel_variable_processing.rb +130 -0
- data/builtin/widgets/screen_variable_processing.rb +63 -0
- data/builtin/widgets/screen_variants.rb +110 -0
- data/builtin/widgets/screens.rb +73 -0
- data/builtin/widgets/shorthand.rb +49 -0
- data/builtin/widgets/static_content.rb +51 -0
- data/builtin/widgets/subroutine.rb +54 -0
- data/generators/rtml_widget/USAGE +19 -0
- data/generators/rtml_widget/rtml_widget_generator.rb +59 -0
- data/generators/rtml_widget/templates/default_widget.erb +10 -0
- data/generators/rtml_widget/templates/default_widget.feature.erb +11 -0
- data/generators/rtml_widget/templates/default_widget_spec.erb +13 -0
- data/generators/rtml_widget/templates/default_widget_test.erb +13 -0
- data/lib/extensions/action_controller/response.rb +30 -0
- data/lib/extensions/action_controller/routing/route_set.rb +42 -0
- data/lib/extensions/active_support/test_case.rb +3 -0
- data/lib/extensions/hpricot/doc.rb +5 -0
- data/lib/extensions/hpricot/elem.rb +5 -0
- data/lib/extensions/string.rb +35 -0
- data/lib/rtml.rb +88 -2
- data/lib/rtml/configuration.rb +40 -0
- data/lib/rtml/controller/before_filters.rb +51 -0
- data/lib/rtml/controller/cache_helpers.rb +26 -0
- data/lib/rtml/controller/class_methods/rtml_action_helpers.rb +18 -0
- data/lib/rtml/controller/document_generator.rb +60 -0
- data/lib/rtml/controller/render_helpers.rb +29 -0
- data/lib/rtml/controller/rtml_helpers.rb +37 -0
- data/lib/rtml/controller/state.rb +73 -0
- data/lib/rtml/controller/template_helpers.rb +21 -0
- data/lib/rtml/controller/url_helpers.rb +9 -0
- data/lib/rtml/dependencies.rb +27 -0
- data/lib/rtml/dsl.rb +81 -0
- data/lib/rtml/environment.rb +28 -0
- data/lib/rtml/errors/invalid_format.rb +4 -0
- data/lib/rtml/errors/invalid_operation.rb +4 -0
- data/lib/rtml/errors/invalid_option_error.rb +4 -0
- data/lib/rtml/errors/missing_document_error.rb +4 -0
- data/lib/rtml/errors/missing_variable_error.rb +4 -0
- data/lib/rtml/errors/multiple_roots_error.rb +4 -0
- data/lib/rtml/errors/processing_error.rb +4 -0
- data/lib/rtml/errors/rules_violation_error.rb +4 -0
- data/lib/rtml/errors/screen_not_found.rb +4 -0
- data/lib/rtml/errors/screen_variant_error.rb +4 -0
- data/lib/rtml/errors/sti_type_error.rb +4 -0
- data/lib/rtml/errors/subprocessing_not_supported.rb +4 -0
- data/lib/rtml/errors/unknown_rtml_action.rb +4 -0
- data/lib/rtml/high_level/managed_variable.rb +72 -0
- data/lib/rtml/high_level/subroutine.rb +22 -0
- data/lib/rtml/high_level/variable_manager.rb +35 -0
- data/lib/rtml/inherited_instance_variables.rb +25 -0
- data/lib/rtml/init.rb +82 -0
- data/lib/rtml/reverse_engineering/crawler.rb +58 -0
- data/lib/rtml/reverse_engineering/simulator.rb +269 -0
- data/lib/rtml/reverse_engineering/simulator/casting.rb +9 -0
- data/lib/rtml/reverse_engineering/simulator/snapshot.rb +18 -0
- data/lib/rtml/reverse_engineering/simulator/variable_lookup.rb +32 -0
- data/lib/rtml/reverse_engineering/simulator/variable_value.rb +105 -0
- data/lib/rtml/rules/dom_ruleset.rb +166 -0
- data/lib/rtml/rules/dom_tag.rb +43 -0
- data/lib/rtml/rules/dom_validation.rb +162 -0
- data/{app_generators/rtml/templates/rtml/lib/rtml → lib/rtml/rules}/tml_param_parser.rb +14 -15
- data/lib/rtml/test/spec.rb +14 -0
- data/lib/rtml/tmlized_conditions.rb +37 -0
- data/lib/rtml/version.rb +10 -0
- data/lib/rtml/widget.rb +150 -0
- data/lib/rtml/widget_core/class_methods.rb +193 -0
- data/lib/rtml/widget_core/gui_configuration.rb +94 -0
- data/lib/rtml/widget_core/widget_accessor_class_methods.rb +12 -0
- data/lib/rtml/widget_core/widget_accessor_instance_methods.rb +19 -0
- data/lib/rtml/widget_core/widget_proxy.rb +70 -0
- data/lib/rtml/widgets.rb +112 -0
- data/lib/rtml_routes.rb +3 -0
- data/rails/init.rb +6 -0
- data/rails_generators/rtml/USAGE +19 -0
- data/rails_generators/rtml/rtml_generator.rb +64 -0
- data/rails_generators/rtml/templates/config/initializers/rtml.rb +13 -0
- data/rails_generators/rtml/templates/config/tml_dom_ruleset.rb +81 -0
- data/rails_generators/rtml/templates/db/migrate/20100108163703_create_rtml_dom_elements.rb +16 -0
- data/rails_generators/rtml/templates/db/migrate/20100108163827_create_rtml_dom_properties.rb +16 -0
- data/rails_generators/rtml/templates/db/migrate/20100108165127_create_rtml_documents.rb +15 -0
- data/rails_generators/rtml/templates/db/migrate/20100110060124_create_rtml_instructions.rb +15 -0
- data/rails_generators/rtml/templates/db/migrate/20100110071920_add_parent_id_to_rtml_instructions.rb +9 -0
- data/rails_generators/rtml/templates/db/migrate/20100113131401_add_options_to_properties.rb +9 -0
- data/rails_generators/rtml/templates/db/migrate/20100127173146_add_parent_type_to_rtml_dom_elements.rb +9 -0
- data/rails_generators/rtml/templates/db/migrate/20100208114234_create_rtml_states.rb +20 -0
- data/rails_generators/rtml/templates/db/migrate/20100303021609_add_x_and_y_to_rtml_instructions.rb +12 -0
- data/rails_generators/rtml/templates/doc/io_tml-application-development-guidelines.pdf +0 -0
- data/rails_generators/rtml/templates/lib/tasks/rtml.rake +65 -0
- data/rails_generators/rtml_action/USAGE +15 -0
- data/rails_generators/rtml_action/rtml_action_generator.rb +51 -0
- data/rails_generators/rtml_action/templates/action.erb +12 -0
- data/rails_generators/rtml_action/templates/view.erb +2 -0
- data/rails_generators/widget/USAGE +19 -0
- data/rails_generators/widget/templates/default_widget.erb +10 -0
- data/rails_generators/widget/templates/default_widget.feature.erb +11 -0
- data/rails_generators/widget/templates/default_widget_spec.erb +13 -0
- data/rails_generators/widget/templates/default_widget_test.erb +13 -0
- data/rails_generators/widget/widget_generator.rb +48 -0
- data/script/console +5 -2
- data/script/server +3 -0
- data/spec/controllers/inherited_controller_spec.rb +19 -0
- data/spec/controllers/rtml_controller_spec.rb +94 -0
- data/spec/lib/extensions/hpricot/doc_spec.rb +6 -0
- data/spec/lib/extensions/hpricot/elem_spec.rb +6 -0
- data/spec/lib/extensions/string_spec.rb +5 -0
- data/spec/lib/rtml/extensions_spec.rb +12 -0
- data/spec/lib/rtml/reverse_engineering/crawler_spec.rb +24 -0
- data/spec/lib/rtml/reverse_engineering/simulator/variable_value_spec.rb +120 -0
- data/spec/lib/rtml/reverse_engineering/simulator_spec.rb +96 -0
- data/spec/lib/rtml/routes_spec.rb +51 -0
- data/spec/lib/rtml/rules/dom_ruleset_spec.rb +54 -0
- data/spec/lib/rtml/rules/dom_validation_spec.rb +112 -0
- data/spec/lib/rtml/widget_core/generic_widget_consumer_spec.rb +28 -0
- data/spec/lib/rtml/widget_core/gui_configuration_spec.rb +109 -0
- data/spec/lib/rtml/widget_core/widget_proxy_spec.rb +31 -0
- data/spec/lib/rtml/widget_spec.rb +57 -0
- data/spec/lib/rtml/widgets_spec.rb +7 -0
- data/spec/models/rtml/document_spec.rb +97 -0
- data/spec/models/rtml/dom/element_spec.rb +14 -0
- data/spec/models/rtml/dom/frontend_element_spec.rb +22 -0
- data/spec/models/rtml/dom/property_spec.rb +28 -0
- data/spec/models/rtml/dom/screen_element_spec.rb +11 -0
- data/spec/models/rtml/instruction_spec.rb +45 -0
- data/spec/models/rtml/state/variable_mapping_spec.rb +9 -0
- data/spec/models/rtml/state_spec.rb +8 -0
- data/spec/rcov.opts +3 -0
- data/spec/spec.opts +5 -0
- data/spec/spec_helper.rb +45 -0
- data/spec/support/app/controllers/application_controller.rb +2 -0
- data/spec/support/app/controllers/inherited_controller.rb +8 -0
- data/spec/support/app/rtml_helpers/inherited/index.rb +10 -0
- data/spec/support/app/rtml_helpers/rtml/index.rb +14 -0
- data/spec/support/app/views/README.txt +6 -0
- data/spec/support/app/views/layouts/layout.rtml.erb +3 -0
- data/spec/support/app/views/magcard/_partial.erb +1 -0
- data/spec/support/app/views/magcard/main.rtml.erb +1 -0
- data/spec/support/app/views/rtml/index.html.erb +9 -0
- data/spec/support/app/views/rtml/index/main.rtml.erb +1 -0
- data/spec/support/config/database.yml +17 -0
- data/spec/support/config/environment.rb +1 -0
- data/{app_generators/rtml/templates/rtml/public/stylesheets/rtml/charts.css → spec/support/config/environments/development.rb} +0 -0
- data/spec/support/config/initializers/rtml.rb +6 -0
- data/spec/support/config/routes.rb +3 -0
- data/spec/support/config/tml_dom_ruleset.rb +82 -0
- data/spec/support/db/rtml_test_db.sqlite3 +0 -0
- data/spec/support/db/schema.rb +14 -0
- data/spec/support/lib/rtml/widgets/test_widget1.rb +15 -0
- data/spec/support/lib/rtml/widgets/test_widget2.rb +4 -0
- data/spec/support/rails.rb +22 -0
- data/spec/support/raw_tml/valid_document.tml +108 -0
- data/spec/support/rspec/example_groups.rb +3 -0
- data/spec/support/rspec/matchers.rb +53 -0
- data/spec/support/vendor/gems/rtml-bootstrapper-2.0.0/.specification +61 -0
- data/spec/support/vendor/gems/rtml-bootstrapper-2.0.0/lib/init_rtml_working_copy.rb +1 -0
- data/spec/support/vendor/gems/rtml-bootstrapper-2.0.0/rtml.gemspec +11 -0
- data/spec/widgets/document_variable_processing_spec.rb +84 -0
- data/spec/widgets/element_builder_spec.rb +124 -0
- data/spec/widgets/event_listener_spec.rb +51 -0
- data/spec/widgets/frontend_spec.rb +59 -0
- data/spec/widgets/highlevel_variable_processing_spec.rb +149 -0
- data/spec/widgets/screen_variable_processing_spec.rb +57 -0
- data/spec/widgets/screen_variants_spec.rb +97 -0
- data/spec/widgets/screens_spec.rb +55 -0
- data/spec/widgets/static_content_spec.rb +43 -0
- data/spec/widgets/subroutine_spec.rb +109 -0
- data/tasks/db.rake +6 -0
- data/tasks/rspec.rake +20 -0
- data/tasks/rtml.rake +5 -0
- data/test/test_generator_helper.rb +22 -0
- data/test/test_helper.rb +1 -1
- data/test/test_rtml_action_generator.rb +65 -0
- data/test/test_rtml_generator.rb +24 -4
- data/test/test_rtml_widget_generator.rb +47 -0
- data/test/test_widget_generator.rb +49 -0
- data/update.rb +19 -0
- metadata +343 -428
- data/app_generators/rtml/templates/rails_template.rb +0 -36
- data/app_generators/rtml/templates/rtml/MIT-LICENSE +0 -20
- data/app_generators/rtml/templates/rtml/README +0 -109
- data/app_generators/rtml/templates/rtml/Rakefile +0 -38
- data/app_generators/rtml/templates/rtml/app/controllers/beryl_controller.rb +0 -70
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/magcard_demo_controller.rb +0 -9
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/oe/btmlpa_controller.rb +0 -158
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/rtml_app_controller.rb +0 -252
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/tml_app_controller.rb +0 -418
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_helper.rb +0 -72
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/auth_result.rb +0 -56
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/common.rb +0 -19
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/index.rb +0 -82
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_helper.rb +0 -2
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/authorized.rb +0 -10
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/common.rb +0 -20
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/index.rb +0 -33
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_helper.rb +0 -2
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/auth_result.rb +0 -23
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/common.rb +0 -23
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/dynamic.rb +0 -11
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/icc.rb +0 -384
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/index.rb +0 -191
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/receipt.rb +0 -152
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/rtml_app_helper.rb +0 -74
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/rtml_app_tml_helpers/common.rb +0 -9
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/tml_app_helper.rb +0 -43
- data/app_generators/rtml/templates/rtml/app/models/rtml/card.rb +0 -83
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_avs.rb +0 -14
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_cvv.rb +0 -14
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_parser.rb +0 -21
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_pin.rb +0 -18
- data/app_generators/rtml/templates/rtml/app/models/rtml/emv_card_data.rb +0 -25
- data/app_generators/rtml/templates/rtml/app/models/rtml/mag_card_data.rb +0 -21
- data/app_generators/rtml/templates/rtml/app/models/rtml/reference_code.rb +0 -26
- data/app_generators/rtml/templates/rtml/app/models/rtml/state.rb +0 -12
- data/app_generators/rtml/templates/rtml/app/models/rtml/terminal.rb +0 -8
- data/app_generators/rtml/templates/rtml/app/models/rtml/transaction.rb +0 -68
- data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/another_rcpt.rtml.erb +0 -15
- data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/receipt.rtml.erb +0 -108
- data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/receipt_single_column.rtml.erb +0 -106
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/about.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/admin.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/construction.rtml.erb +0 -10
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/idle.rtml.erb +0 -13
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/main_menu.rtml.erb +0 -12
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/menu_credit.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/menu_debit.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/beryl_color.rtml.erb +0 -24
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/beryl_mono.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/magcard_demo_color.rtml.erb +0 -24
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/magcard_demo_mono.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/oe/btmlpa_i5100.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/oe/btmlpa_i8550.rtml.erb +0 -17
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/uml.html.erb +0 -11
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/authorized.html.erb +0 -15
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/authorized/main.rtml.erb +0 -5
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index.html.erb +0 -15
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/_error.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/enter_amount.rtml.erb +0 -5
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/main.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/dynamic/response.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/icc.rtml.erb +0 -760
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_enter_amount.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_about.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_duplicate.rtml.erb +0 -9
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_examples.rtml.erb +0 -9
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_logo.rtml.erb +0 -11
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_other.rtml.erb +0 -20
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_refund.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_reversal.rtml.erb +0 -9
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_sale.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_sale_cashback.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/about.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/assert.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/card_nmb.rtml.erb +0 -19
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/compl_txn.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/confirm_rev.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/duplicate_na.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/error_scr.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/main_menu.rtml.bak +0 -31
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/main_menu.rtml.erb +0 -40
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/print_pf.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/rd_sale_disp.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/read_refund.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/read_scb.rtml.erb +0 -10
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/reject_trans.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/remove_card.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/rev_bad.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/scb_check_f.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/sign_check.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/subm_err.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/to_man_entry.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/trans_abrt.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/void_trans.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/receipt/_receipt.rtml.erb +0 -29
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/receipt/error_paper.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_development.html.erb +0 -167
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_header.html.erb +0 -12
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_production.html.erb +0 -8
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/charts.html.erb +0 -14
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/do_tml_redirect.rtml.erb +0 -7
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/get_terminal_info.rtml.erb +0 -26
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/rescue_action_in_public.rtml.erb +0 -9
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/rescue_action_locally.rtml.erb +0 -42
- data/app_generators/rtml/templates/rtml/components/rtml/features/common.rb +0 -303
- data/app_generators/rtml/templates/rtml/components/rtml/features/force.rb +0 -46
- data/app_generators/rtml/templates/rtml/components/rtml/features/return.rb +0 -22
- data/app_generators/rtml/templates/rtml/components/rtml/features/sale.rb +0 -49
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_confirmation.rtml.erb +0 -10
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_agreement.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_footer.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_header.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/ask_cashback.rtml.erb +0 -11
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/card_imprint.rtml.erb +0 -7
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/check_cb.rtml.erb +0 -11
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/conf_debit.rtml.erb +0 -5
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/confirm_sale.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/confrm_force.rtml.erb +0 -4
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/cvv_skipped.rtml.erb +0 -10
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/disp_avs.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/do_avs_zip.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_amount.rtml.erb +0 -12
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_card.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_cashbk.rtml.erb +0 -10
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_cvv2.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_expiry.rtml.erb +0 -9
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/fraud_check1.rtml.erb +0 -6
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/fraud_check2.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_aprvl.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_avs_zip.rtml.erb +0 -8
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_bad_aprv.rtml.erb +0 -5
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frd_chk_fail.rtml.erb +0 -5
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/invalid_exp.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/no_entr_crd.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/remove_card.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/swipe_card.rtml.erb +0 -7
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/trans_abort.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/trans_reject.rtml.erb +0 -1
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/void_ref.rtml.erb +0 -10
- data/app_generators/rtml/templates/rtml/components/rtml/features/void.rb +0 -30
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/card_parser_widget.rb +0 -90
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/display_widget.rb +0 -66
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/element_builder_widget.rb +0 -123
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/emv_support_widget.rb +0 -365
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/form_submit_widget.rb +0 -65
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/get_transaction_variables_widget.rb +0 -33
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/get_variable_widget.rb +0 -39
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/receipt_widget.rb +0 -66
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/screen_builder_widget.rb +0 -49
- data/app_generators/rtml/templates/rtml/db/migrate/20090825132217_create_rtml_states.rb +0 -15
- data/app_generators/rtml/templates/rtml/db/migrate/20090825132401_create_rtml_terminals.rb +0 -16
- data/app_generators/rtml/templates/rtml/db/migrate/20090825132530_create_rtml_transactions.rb +0 -24
- data/app_generators/rtml/templates/rtml/db/migrate/20090825134118_create_rtml_cards.rb +0 -23
- data/app_generators/rtml/templates/rtml/db/migrate/20090825134622_create_rtml_emv_card_data.rb +0 -20
- data/app_generators/rtml/templates/rtml/db/migrate/20090825134629_create_rtml_mag_card_data.rb +0 -17
- data/app_generators/rtml/templates/rtml/db/migrate/20090825135838_create_rtml_card_parsers.rb +0 -19
- data/app_generators/rtml/templates/rtml/db/migrate/20090826103509_create_reference_codes.rb +0 -14
- data/app_generators/rtml/templates/rtml/db/migrate/20090915030044_add_batch_to_rtml_transactions.rb +0 -10
- data/app_generators/rtml/templates/rtml/db/migrate/20090915031155_add_additional_data_to_rtml_transactions.rb +0 -10
- data/app_generators/rtml/templates/rtml/db/migrate/20090915031156_add_hidden_data_to_rtml_transactions.rb +0 -10
- data/app_generators/rtml/templates/rtml/db/migrate/20091016133313_create_rtml_card_avs.rb +0 -16
- data/app_generators/rtml/templates/rtml/db/migrate/20091016135800_create_rtml_card_cvvs.rb +0 -16
- data/app_generators/rtml/templates/rtml/db/migrate/20091016135810_create_rtml_card_pins.rb +0 -16
- data/app_generators/rtml/templates/rtml/db/migrate/20091016135820_reverse_card_transaction_relationship.rb +0 -11
- data/app_generators/rtml/templates/rtml/db/migrate/20100127115105_convert_rtml_migrations_to_rails_migrations.rb +0 -31
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/USAGE +0 -25
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/rtml_controller_generator.rb +0 -49
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/common_tml_helper.rb +0 -20
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/controller.rb +0 -3
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/css_color.css +0 -37
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/css_mono.css +0 -12
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/functional_test.rb +0 -11
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/helper.rb +0 -2
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/layout_color.rtml.erb +0 -24
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/layout_mono.rtml.erb +0 -3
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/tml_helper.rb +0 -16
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/view.html.erb +0 -15
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/view.rtml.erb +0 -2
- data/app_generators/rtml/templates/rtml/generators/rtml_document/USAGE +0 -8
- data/app_generators/rtml/templates/rtml/generators/rtml_document/rtml_document_generator.rb +0 -45
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/controller.rb +0 -7
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/functional_test.rb +0 -10
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/helper.rb +0 -2
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/view.rtml.erb +0 -11
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/USAGE +0 -8
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/rtml_widget_generator.rb +0 -66
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/templates/basic_widget.rb +0 -57
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/templates/basic_widget_no_help.rb +0 -27
- data/app_generators/rtml/templates/rtml/init.rb +0 -40
- data/app_generators/rtml/templates/rtml/install.rb +0 -18
- data/app_generators/rtml/templates/rtml/lib/environment.rb +0 -61
- data/app_generators/rtml/templates/rtml/lib/extensions/action_controller/request.rb +0 -9
- data/app_generators/rtml/templates/rtml/lib/extensions/action_controller/routing/route_set.rb +0 -34
- data/app_generators/rtml/templates/rtml/lib/extensions/action_view/base.rb +0 -74
- data/app_generators/rtml/templates/rtml/lib/extensions/action_view/partial_template.rb +0 -24
- data/app_generators/rtml/templates/rtml/lib/extensions/active_record.rb +0 -13
- data/app_generators/rtml/templates/rtml/lib/extensions/active_support/dependencies.rb +0 -25
- data/app_generators/rtml/templates/rtml/lib/extensions/array.rb +0 -15
- data/app_generators/rtml/templates/rtml/lib/extensions/attr_boolean.rb +0 -10
- data/app_generators/rtml/templates/rtml/lib/extensions/hash.rb +0 -28
- data/app_generators/rtml/templates/rtml/lib/extensions/nil_class.rb +0 -20
- data/app_generators/rtml/templates/rtml/lib/extensions/rake.rb +0 -19
- data/app_generators/rtml/templates/rtml/lib/extensions/regexp.rb +0 -16
- data/app_generators/rtml/templates/rtml/lib/extensions/string.rb +0 -37
- data/app_generators/rtml/templates/rtml/lib/other_plugins.rb +0 -23
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/MIT-LICENSE +0 -20
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/README +0 -36
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/Rakefile +0 -44
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/init.rb +0 -25
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/action_controller/filters/before_render_filter.rb +0 -30
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/before_render.rb +0 -43
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/before_render_instance.rb +0 -45
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/filter_chain_has_many_types_of_filters.rb +0 -87
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/filter_has_before_render.rb +0 -26
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/tasks/before_render_tasks.rake +0 -25
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/test/before_render_test.rb +0 -29
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/test/test_helper.rb +0 -24
- data/app_generators/rtml/templates/rtml/lib/rtml.rb +0 -77
- data/app_generators/rtml/templates/rtml/lib/rtml/beryl/constants.rb +0 -12
- data/app_generators/rtml/templates/rtml/lib/rtml/beryl/version.rb +0 -11
- data/app_generators/rtml/templates/rtml/lib/rtml/common/renderable.rb +0 -13
- data/app_generators/rtml/templates/rtml/lib/rtml/core/include.rb +0 -30
- data/app_generators/rtml/templates/rtml/lib/rtml/core/layout.rb +0 -59
- data/app_generators/rtml/templates/rtml/lib/rtml/core/next.rb +0 -188
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen.rb +0 -91
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/iterators.rb +0 -63
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/next_screen_methods.rb +0 -70
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/variable_methods.rb +0 -73
- data/app_generators/rtml/templates/rtml/lib/rtml/core/support/importer.rb +0 -55
- data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document.rb +0 -318
- data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document/screen_methods.rb +0 -79
- data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document/variable_methods.rb +0 -83
- data/app_generators/rtml/templates/rtml/lib/rtml/core/variable.rb +0 -123
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/browser_emulator.rb +0 -59
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/rtml_controller_test_case.rb +0 -7
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/rtml_core_unit_test.rb +0 -11
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/unit_test.rb +0 -3
- data/app_generators/rtml/templates/rtml/lib/rtml/delegation.rb +0 -8
- data/app_generators/rtml/templates/rtml/lib/rtml/doc.rb +0 -12
- data/app_generators/rtml/templates/rtml/lib/rtml/element.rb +0 -75
- data/app_generators/rtml/templates/rtml/lib/rtml/errors/widget_accessor_failure.rb +0 -9
- data/app_generators/rtml/templates/rtml/lib/rtml/events/event_handler.rb +0 -79
- data/app_generators/rtml/templates/rtml/lib/rtml/events/event_processor.rb +0 -106
- data/app_generators/rtml/templates/rtml/lib/rtml/events/processors.rb +0 -10
- data/app_generators/rtml/templates/rtml/lib/rtml/events/processors/defaults_processor.rb +0 -18
- data/app_generators/rtml/templates/rtml/lib/rtml/events/processors/key_processor.rb +0 -21
- data/app_generators/rtml/templates/rtml/lib/rtml/feature.rb +0 -32
- data/app_generators/rtml/templates/rtml/lib/rtml/feature_config.rb +0 -195
- data/app_generators/rtml/templates/rtml/lib/rtml/features.rb +0 -18
- data/app_generators/rtml/templates/rtml/lib/rtml/features/array_of_feature_instances.rb +0 -17
- data/app_generators/rtml/templates/rtml/lib/rtml/features/controller_class_methods.rb +0 -30
- data/app_generators/rtml/templates/rtml/lib/rtml/features/controller_instance_methods.rb +0 -35
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers.rb +0 -21
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/controller_helpers.rb +0 -59
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/controller_helpers/menu_helpers.rb +0 -193
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/action_view_wrapper.rb +0 -23
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/event_helpers.rb +0 -28
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/layout_helpers.rb +0 -47
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/widget_support.rb +0 -181
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/widget_support/class_methods.rb +0 -28
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/yield_helpers.rb +0 -33
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/proxy_helpers/feature_helpers.rb +0 -17
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/render_helper.rb +0 -71
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/terminal_helpers.rb +0 -21
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers.rb +0 -6
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers/tml_validation_assertions.rb +0 -10
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers/variable_assertions.rb +0 -27
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/view_helpers/form_helpers.rb +0 -70
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/view_helpers/rtml_form_builder.rb +0 -174
- data/app_generators/rtml/templates/rtml/lib/rtml/oe/btmlpa_constants.rb +0 -48
- data/app_generators/rtml/templates/rtml/lib/rtml/proxying/method_missing_methods.rb +0 -14
- data/app_generators/rtml/templates/rtml/lib/rtml/proxying/rtml_interface.rb +0 -33
- data/app_generators/rtml/templates/rtml/lib/rtml/proxying/sandbox.rb +0 -18
- data/app_generators/rtml/templates/rtml/lib/rtml/text_utils.rb +0 -51
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/dom_rule_parser.rb +0 -61
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/dom_tag.rb +0 -52
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/predefined_variable_rule_parser.rb +0 -97
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/tml_validator.rb +0 -16
- data/app_generators/rtml/templates/rtml/lib/rtml/version.rb +0 -11
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/property.rb +0 -11
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/property_accessors.rb +0 -59
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/widget.rb +0 -251
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/widget_class_methods.rb +0 -213
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/dot.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_can.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_cand.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_en.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_end.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_i.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icd.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icl.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icr.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_ics.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icsw.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icv.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_int.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_int2.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_men.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_mend.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_next.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_no.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_nod.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_ok.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_okd.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic1.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic2.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic3.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic4.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_top.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_txn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_yes.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_yesd.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/btmlpa.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/can_dn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/can_up.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/conf.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/iccemv.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/images.lib +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/magcard.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/no_dn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/no_up.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/ok_dn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/ok_up.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/top.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/yes_dn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/yes_up.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/beryl_color.css +0 -37
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/beryl_mono.css +0 -17
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/i5100.css +0 -12
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/i8550.css +0 -37
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/receipt.css +0 -4
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/examples/i5100.css +0 -12
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/examples/i8550.css +0 -37
- data/app_generators/rtml/templates/rtml/reporting/110409 +0 -227
- data/app_generators/rtml/templates/rtml/reporting/linecount.rb +0 -42
- data/app_generators/rtml/templates/rtml/rules/predefined_tml_variables.rb +0 -63
- data/app_generators/rtml/templates/rtml/rules/tml_document_structure.rb +0 -84
- data/app_generators/rtml/templates/rtml/rules/varns/audio.rb +0 -30
- data/app_generators/rtml/templates/rtml/rules/varns/card.rb +0 -17
- data/app_generators/rtml/templates/rtml/rules/varns/card/emv.rb +0 -31
- data/app_generators/rtml/templates/rtml/rules/varns/card/mag.rb +0 -8
- data/app_generators/rtml/templates/rtml/rules/varns/card/parser.rb +0 -7
- data/app_generators/rtml/templates/rtml/rules/varns/card/pin.rb +0 -6
- data/app_generators/rtml/templates/rtml/rules/varns/cfgm.rb +0 -15
- data/app_generators/rtml/templates/rtml/rules/varns/com.rb +0 -9
- data/app_generators/rtml/templates/rtml/rules/varns/err.rb +0 -14
- data/app_generators/rtml/templates/rtml/rules/varns/gma/event.rb +0 -13
- data/app_generators/rtml/templates/rtml/rules/varns/gprs.rb +0 -8
- data/app_generators/rtml/templates/rtml/rules/varns/imager.rb +0 -8
- data/app_generators/rtml/templates/rtml/rules/varns/ip.rb +0 -15
- data/app_generators/rtml/templates/rtml/rules/varns/oebr.rb +0 -42
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/3rdparty.rb +0 -7
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/backlight.rb +0 -4
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/cache.rb +0 -1
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/connect.rb +0 -5
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/connection.rb +0 -5
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/offline.rb +0 -5
- data/app_generators/rtml/templates/rtml/rules/varns/oegw.rb +0 -12
- data/app_generators/rtml/templates/rtml/rules/varns/payment.rb +0 -21
- data/app_generators/rtml/templates/rtml/rules/varns/ppp.rb +0 -11
- data/app_generators/rtml/templates/rtml/rules/varns/terminal.rb +0 -29
- data/app_generators/rtml/templates/rtml/tasks/rtml_tasks.rake +0 -78
- data/app_generators/rtml/templates/rtml/template.rb +0 -64
- data/app_generators/rtml/templates/rtml/test/core/element_test.rb +0 -17
- data/app_generators/rtml/templates/rtml/test/core/screen_test.rb +0 -91
- data/app_generators/rtml/templates/rtml/test/core/tml_document_test.rb +0 -53
- data/app_generators/rtml/templates/rtml/test/functional/beryl_controller_test.rb +0 -13
- data/app_generators/rtml/templates/rtml/test/functional/btmlpa_controller_test.rb +0 -13
- data/app_generators/rtml/templates/rtml/test/functional/magcard_demo_controller_test.rb +0 -20
- data/app_generators/rtml/templates/rtml/test/functional/rtml_app_controller_test.rb +0 -9
- data/app_generators/rtml/templates/rtml/test/functional/rtml_routing_test.rb +0 -19
- data/app_generators/rtml/templates/rtml/test/functional/tml_controller_params_test.rb +0 -20
- data/app_generators/rtml/templates/rtml/test/rtml_test_helper.rb +0 -44
- data/app_generators/rtml/templates/rtml/test/validation/predefined_variable_rule_parser_test.rb +0 -11
- data/app_generators/rtml/templates/rtml/uninstall.rb +0 -1
- data/app_generators/rtml/templates/rtml/update.rb +0 -57
- data/tasks/reglob.rake +0 -28
- data/test/test_rtml.rb +0 -11
data/PostInstall.txt
CHANGED
data/README.rdoc
CHANGED
@@ -1,42 +1,127 @@
|
|
1
|
-
=
|
1
|
+
= RubyTML v2.0
|
2
2
|
|
3
3
|
* http://www.rubytml.com
|
4
|
-
* http://github.com/sinisterchipmunk/rtml
|
5
4
|
|
6
5
|
== DESCRIPTION:
|
7
6
|
|
8
|
-
|
7
|
+
RubyTML (or just RTML) is a Ruby framework for communicating with Ingenico's Incendo-based payment devices.
|
8
|
+
|
9
|
+
To really understand what RTML is about, you first have to understand what TML is. TML is an XML-like language called
|
10
|
+
the "Terminal Markup Language" (yeah, we're really creative with our naming conventions around here). Essentially, it
|
11
|
+
allows developers to write terminal applications using a syntax that is essentially XML. This is a step forward for
|
12
|
+
terminal developers, who are used to writing their applications in embedded C.
|
13
|
+
|
14
|
+
The Incendo architecture that runs all of this provides a gateway between an application server, which houses the TML,
|
15
|
+
and the terminal. The TML is translated to byte code and then sent to the terminal via SSL. The terminal then executes
|
16
|
+
this byte code, and only reconnects when it's ready to download a new TML application. This is another step forward
|
17
|
+
from embedded C, because there's no longer any need to manually compile and then download applications to the terminal.
|
18
|
+
|
19
|
+
However, at the end of the day it's still TML, and someone has to write that TML code. That's where I come in. I was
|
20
|
+
brought into Ingenico to write this TML, and I found the task nothing less than daunting. I came from a Java
|
21
|
+
background, so of course the first thing I did was start looking at ways to write Java and have it generate TML.
|
22
|
+
Unfortunately, that was like drilling a hole with a sledgehammer, and it didn't work out too well. I quickly realized
|
23
|
+
that I was going to spend more time writing the supporting Java code than I would on the TML itself, and given fairly
|
24
|
+
ambitious deadlines, that just wasn't going to be an option.
|
25
|
+
|
26
|
+
So I turned to Ruby. I'd been experimenting with Ruby on Rails over the past month or two, and was amazed at how
|
27
|
+
brain-dead-simple it made standard Web development. I began to think -- what is a TML application except for a bunch of
|
28
|
+
glorified Web services? What if Rails could do to TML and XML what it has already done to HTML?
|
29
|
+
|
30
|
+
The biggest difference between HTML and TML is that the former is purely (or, in a Web 2.0 world, _almost_ purely) View
|
31
|
+
oriented. That is, HTML is designed for marking up and displaying content, not for transforming it. TML is a bit of a
|
32
|
+
misnomer in that respect, because it is very much about the transforming of data. It takes care of receiving and
|
33
|
+
processing the swipe of magnetic cards, amounts, and so on. In fact, the only thing it doesn't really handle is
|
34
|
+
actually processing a payment, which is a job left for the remote server.
|
35
|
+
|
36
|
+
So the short answer to just what _is_ RTML? It's a giant DSL (Domain Specific Language), basically, designed for
|
37
|
+
generating TML with a vast reduction in keystrokes and lines-of-code. Check out the RTML web site at www.rubytml.com
|
38
|
+
for more information -- from tutorials to my RTML blog.
|
39
|
+
|
40
|
+
== FEATURES:
|
41
|
+
|
42
|
+
* It's AWESOME!
|
43
|
+
* RTML 1.x reduced lines of code in comparison to raw TML by an average factor of 60-70%, (in some cases as much as
|
44
|
+
90%), and RTML 2.0 intends to improve this gain in coding efficiency even further by abstracting all repeatable tasks
|
45
|
+
into Widgets, which can now easily be published as Ruby Gems.
|
46
|
+
* Widgets allow developers to write highly reusable blocks of RTML code which can then be called from an RTML
|
47
|
+
application as many times as needed.
|
48
|
+
* Adapts the Rails MVC approach to TML, neatly separating TML logic from server-side Rails code, moving
|
49
|
+
display-oriented TML code into Views, and creating an Rtml::Transaction model which captures data sent back from a
|
50
|
+
TML application.
|
51
|
+
|
52
|
+
|
53
|
+
== PROBLEMS:
|
54
|
+
|
55
|
+
* RubyTML is not a total TML replacement :( You still have to follow the rules, and the overall design process isn't
|
56
|
+
significantly different. That's why a copy of the Incendo TML documentation is added to your Rails project when you
|
57
|
+
script/generate rtml.
|
58
|
+
|
59
|
+
== SYNOPSIS:
|
60
|
+
|
61
|
+
Rtml.action :index, :controller => :my_app do
|
62
|
+
# cached document expires in 2 hours
|
63
|
+
expires_at { 2.hours.from_now }
|
64
|
+
integer :amount
|
65
|
+
layout 'index' # applies the layout in app/views/layouts/index.rtml.erb to every screen
|
66
|
+
|
67
|
+
screen :init, :next => :idle do
|
68
|
+
tml.amount = 0 # sets the terminal client-side variable 'amount' to 0
|
69
|
+
end
|
70
|
+
|
71
|
+
screen :idle, :next => :idle do
|
72
|
+
display # renders the view in app/views/my_app/index/idle.rtml.erb
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
You should also check the rdoc documentation for Rtml::Widget and the various built-in Widgets for more information
|
77
|
+
and usage examples. Also, don't forget to go to www.rubytml.com for many more examples and walkthroughs!
|
9
78
|
|
10
79
|
== REQUIREMENTS:
|
11
80
|
|
12
|
-
*
|
13
|
-
*
|
81
|
+
* hpricot - 0.8.2
|
82
|
+
* rails - 2.3.5
|
83
|
+
* sc-core-ext - 1.1.1
|
84
|
+
|
85
|
+
Test dependencies can be a bit of a question mark. RTML tests were actually written in rspec and make use of webrat
|
86
|
+
for testing the TML output. There's nothing preventing you from using the standard Rails Test::Unit framework, and
|
87
|
+
generated code will generate Test::Unit tests for you. But you need to install the following rspec-specific gems if you
|
88
|
+
plan to run the in-application tests via "rake rtml:test" -- and enabling this will also generate rspec tests instead
|
89
|
+
of Test::Unit ones. While there are a number of Test::Unit extensions for RTML, the unofficially official test
|
90
|
+
framework for RTML is, obviously, rspec.
|
91
|
+
|
92
|
+
* rspec - 1.3.0
|
93
|
+
* rspec-rails - 1.3.2
|
94
|
+
* webrat - 0.7.0
|
95
|
+
|
96
|
+
In order to activate these gems after installation, you'll also want to:
|
97
|
+
|
98
|
+
ruby script/generate rspec
|
14
99
|
|
15
100
|
== INSTALL:
|
16
101
|
|
17
|
-
* gem install rtml
|
102
|
+
* sudo gem install rtml
|
103
|
+
|
104
|
+
Then, Within Your Rails Application...
|
105
|
+
|
106
|
+
* config.gem 'rtml' #=> marks RTML as an application dependency
|
107
|
+
* script/generate rtml #=> generates the RTML migrations and supporting files
|
108
|
+
* rake rtml:test #=> runs the entire RTML test suite within your app, to make sure all is peachy
|
18
109
|
|
19
110
|
== LICENSE:
|
20
111
|
|
21
112
|
(The MIT License)
|
22
113
|
|
23
|
-
Copyright (c) 2010
|
24
|
-
|
25
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
THE SOFTWARE
|
37
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
38
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
39
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
40
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
41
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
42
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
114
|
+
Copyright (c) 2010 Colin MacKenzie IV
|
115
|
+
|
116
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
117
|
+
documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the
|
118
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
119
|
+
persons to whom the Software is furnished to do so, subject to the following conditions:
|
120
|
+
|
121
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
122
|
+
Software.
|
123
|
+
|
124
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
125
|
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
126
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
127
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,33 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require '
|
4
|
-
|
5
|
-
require '
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
# Hoe.plugin :
|
10
|
-
|
11
|
-
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
self.
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
# TODO - want other tests/tasks run by default? Add them to the list
|
32
|
-
# remove_task :default
|
33
|
-
# task :default => [:spec, :features]
|
1
|
+
#RTML_ROOT = File.expand_path(File.join(File.dirname(__FILE__)))
|
2
|
+
#require 'rubygems'
|
3
|
+
require './spec/support/rails'
|
4
|
+
gem 'hoe', '>= 2.1.0'
|
5
|
+
require 'hoe'
|
6
|
+
require 'fileutils'
|
7
|
+
|
8
|
+
Hoe.plugin :newgem
|
9
|
+
# Hoe.plugin :website
|
10
|
+
# Hoe.plugin :cucumberfeatures
|
11
|
+
|
12
|
+
# Generate all the Rake tasks
|
13
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
14
|
+
$hoe = Hoe.spec 'rtml' do
|
15
|
+
self.developer 'Colin MacKenzie IV', 'colin.mackenzie4@ingenico.com'
|
16
|
+
self.post_install_message = File.read('PostInstall.txt')
|
17
|
+
self.extra_deps = [['rails','>= 2.3.5'], ['hpricot','>= 0.8.2'], ['sc-core-ext','>= 1.1.1'],
|
18
|
+
['rubigen','>= 1.5.2']]
|
19
|
+
self.extra_dev_deps = [['rspec','>= 1.3.0'], ['rspec-rails','>= 1.3.2'], ['webrat', '>= 0.7.0']]
|
20
|
+
self.version = Rtml::VERSION::STRING
|
21
|
+
self.readme_file = "README.rdoc"
|
22
|
+
end
|
23
|
+
|
24
|
+
require 'newgem/tasks'
|
25
|
+
Dir['./tasks/**/*.rake'].each { |t| load File.expand_path(t) }
|
26
|
+
|
27
|
+
# TODO - want other tests/tasks run by default? Add them to the list
|
28
|
+
# remove_task :default
|
29
|
+
# task :default => [:spec, :features]
|
data/app_generators/rtml/USAGE
CHANGED
@@ -32,7 +32,7 @@ class RtmlGenerator < RubiGen::Base
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
m.file "
|
35
|
+
m.file "rtml_template.rb", "rtml_template.rb"
|
36
36
|
|
37
37
|
# m.dependency "install_rubigen_scripts", [destination_root, 'rtml'],
|
38
38
|
# :shebang => options[:shebang], :collision => :force
|
@@ -75,4 +75,4 @@ EOS
|
|
75
75
|
test
|
76
76
|
tmp
|
77
77
|
)
|
78
|
-
end
|
78
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#HELPERS
|
2
|
+
def win_env?
|
3
|
+
RUBY_PLATFORM=~ /win32/
|
4
|
+
end
|
5
|
+
|
6
|
+
def rake(command, options = {})
|
7
|
+
env = options[:env] || 'development'
|
8
|
+
log 'rake', "#{command} in #{env} "
|
9
|
+
sudo = win_env? ? '' : (options[:sudo] ? 'sudo' : '')
|
10
|
+
rake_cmd = win_env? ? "rake.bat" : 'rake'
|
11
|
+
in_root { run("#{sudo} #{rake_cmd} #{command} RAILS_ENV=#{env}", false) }
|
12
|
+
end
|
13
|
+
|
14
|
+
# OPTIONS
|
15
|
+
rake_migrations = yes?("Run migrations?")
|
16
|
+
|
17
|
+
# GENERATE
|
18
|
+
gem "rtml"
|
19
|
+
rake "gems:install"
|
20
|
+
|
21
|
+
run "ruby script/generate rtml"
|
22
|
+
route 'map.connect_rtml :controller => "rtml"'
|
23
|
+
|
24
|
+
if rake_migrations
|
25
|
+
rake "db:migrate"
|
26
|
+
end
|
data/bin/rtml
CHANGED
@@ -27,10 +27,10 @@ RubiGen::Base.append_sources source
|
|
27
27
|
RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'rtml')
|
28
28
|
|
29
29
|
Dir.chdir args.first do
|
30
|
-
result = system("rake#{ext} rails:template LOCATION=./
|
30
|
+
result = system("rake#{ext} rails:template LOCATION=./rtml_template.rb")
|
31
31
|
if $?.to_i != 0 || result == false
|
32
32
|
puts result || "Internal error executing command: is Rake installed?"
|
33
33
|
exit
|
34
34
|
end
|
35
|
-
File.delete("
|
35
|
+
File.delete("rtml_template.rb")
|
36
36
|
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
class RtmlController < (defined? Rails) ? ApplicationController : ActionController::Base
|
2
|
+
unless include?(Rtml::Controller::RenderHelpers)
|
3
|
+
include Rtml::Controller::BeforeFilters
|
4
|
+
include Rtml::Controller::RenderHelpers
|
5
|
+
include Rtml::Controller::RtmlHelpers
|
6
|
+
include Rtml::Controller::State
|
7
|
+
include Rtml::Controller::CacheHelpers
|
8
|
+
include Rtml::Controller::TemplateHelpers
|
9
|
+
include Rtml::Controller::UrlHelpers
|
10
|
+
extend Rtml::Controller::ClassMethods::RtmlActionHelpers
|
11
|
+
end
|
12
|
+
|
13
|
+
hide_action :rtml_document, :rtml_exception
|
14
|
+
hide_action :screen_layout, :embedded_app
|
15
|
+
helper_method :screen_layout, :embedded_app
|
16
|
+
|
17
|
+
rescue_from Exception, :with => :rtml_exception
|
18
|
+
|
19
|
+
def rtml_exception
|
20
|
+
add_view_path(File.expand_path(File.join(Rtml.root, 'builtin/views')))
|
21
|
+
|
22
|
+
method = (ENV['RAILS_ENV'] == 'production') ? 'rescue_action_in_public' : 'rescue_action_locally'
|
23
|
+
|
24
|
+
# to address the scenario "what if these methods were not defined due to a failing before_filter"
|
25
|
+
rtml = false
|
26
|
+
rtml = request.rtml? if request.respond_to?(:rtml?)
|
27
|
+
rtml = response.rtml? if response.respond_to?(:rtml?)
|
28
|
+
|
29
|
+
if (params[:error_mode] == 'rtml' || rtml) && rtml_helpers.respond_to?(method)
|
30
|
+
@exception = $!
|
31
|
+
rtml_document.reset!
|
32
|
+
erase_results
|
33
|
+
render :rtml => method
|
34
|
+
else
|
35
|
+
raise $!
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def embedded_app
|
40
|
+
"emb://embedded.tml"
|
41
|
+
end
|
42
|
+
|
43
|
+
def screen_layout
|
44
|
+
"rtml/#{state[:model]}"
|
45
|
+
end
|
46
|
+
|
47
|
+
def rtml_document
|
48
|
+
@rtml_document ||= Rtml::Document.new(:name => "#{controller_name}/#{action_name}",
|
49
|
+
:view_paths => view_paths,
|
50
|
+
:controller => self)
|
51
|
+
end
|
52
|
+
|
53
|
+
protected
|
54
|
+
def add_view_path(path)
|
55
|
+
view_paths << path
|
56
|
+
rtml_document.view_paths << path
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,150 @@
|
|
1
|
+
class Rtml::Document < ActiveRecord::Base
|
2
|
+
@@ruleset_file = File.expand_path(File.join(defined?(Rails) ? Rails.root : ".", "config/tml_dom_ruleset.rb"))
|
3
|
+
@@ruleset_file = File.expand_path(File.join(Rtml.root, "rails_generators/rtml/templates/config/tml_dom_ruleset.rb")) unless File.file?(@@ruleset_file)
|
4
|
+
include Rtml::DSL
|
5
|
+
include Rtml::Widgets
|
6
|
+
include ActionController::Layout
|
7
|
+
layout :layout
|
8
|
+
|
9
|
+
set_table_name 'rtml_documents'
|
10
|
+
has_one :root, :class_name => 'Rtml::Dom::Element', :as => :parent, :autosave => true
|
11
|
+
has_many :instructions, :class_name => 'Rtml::Instruction', :as => :source, :autosave => true
|
12
|
+
attr_reader :rules, :controller
|
13
|
+
delegate :render, :view_paths, :view_paths=, :to => :view
|
14
|
+
delegate :request, :response, :params, :flash, :to => :controller
|
15
|
+
|
16
|
+
validates_presence_of :name
|
17
|
+
validates_uniqueness_of :name
|
18
|
+
|
19
|
+
def initialize_with_default_document(attributes = nil)
|
20
|
+
if attributes
|
21
|
+
@controller = attributes.delete(:controller)
|
22
|
+
@initialize_to_empty = attributes.delete(:empty)
|
23
|
+
apply_document_options(attributes)
|
24
|
+
end
|
25
|
+
initialize_without_default_document(attributes)
|
26
|
+
end
|
27
|
+
|
28
|
+
include Rtml::InheritedInstanceVariables
|
29
|
+
protected_instance_variables.concat ["@controller", "@changed_attributes", "@view", "@new_record", "@initialize_to_empty", "@widget_instances", "@rules", "@root", "@attributes_cache", "@attributes"]
|
30
|
+
|
31
|
+
def after_initialize
|
32
|
+
@rules = Rtml::Document.rules
|
33
|
+
if new_record? && !@initialize_to_empty
|
34
|
+
setup_default_document
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# This calls root.target, because root is technically an Association object, and target retrieves the actual object.
|
39
|
+
# This resolves ambiguities such as root.build(), which exists as both an Association method (build a new root object)
|
40
|
+
# and as a Widget method (build a new RTML Element).
|
41
|
+
def root_with_target
|
42
|
+
root_without_target.nil? ? nil : root_without_target.target
|
43
|
+
end
|
44
|
+
|
45
|
+
alias_method_chain :root, :target
|
46
|
+
|
47
|
+
def layout(assignment = :_no_assignment)
|
48
|
+
if assignment != :_no_assignment
|
49
|
+
@layout_file = assignment
|
50
|
+
else
|
51
|
+
@layout_file
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def default_template_format
|
56
|
+
:rtml
|
57
|
+
end
|
58
|
+
|
59
|
+
def cache(setting)
|
60
|
+
case setting
|
61
|
+
when :on, true, 'on', 'true', 'yes', 'allow', :yes, :allow
|
62
|
+
setting = 'allow'
|
63
|
+
when :off, false, 'off', 'false', 'no', 'deny', :no, :deny
|
64
|
+
setting = 'deny'
|
65
|
+
end
|
66
|
+
root.property('cache', setting)
|
67
|
+
end
|
68
|
+
|
69
|
+
# Resets this document so that it contains no elements, and then follows the instructions associated with this
|
70
|
+
# document.
|
71
|
+
def follow_instructions!
|
72
|
+
reset!
|
73
|
+
instructions.each { |instruction| instruction.follow(self) }
|
74
|
+
self
|
75
|
+
end
|
76
|
+
|
77
|
+
# Valid options include
|
78
|
+
# :view_path => String
|
79
|
+
# :view_paths => Array of Strings
|
80
|
+
# and are removed from the hash as they are processed.
|
81
|
+
#
|
82
|
+
# Invalid options are dropped silently.
|
83
|
+
#
|
84
|
+
def apply_document_options(options)
|
85
|
+
options.each do |key, value|
|
86
|
+
case key.to_s
|
87
|
+
when 'view_path', 'view_paths'
|
88
|
+
options.delete key
|
89
|
+
value = [value] unless value.kind_of?(Array)
|
90
|
+
self.view_paths = value.collect { |path| File.exist?(path) ? path : File.join(Rails.root, path) }
|
91
|
+
#else raise ArgumentError, "Key ungrecognized: #{key.inspect}"
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
alias_method_chain :initialize, :default_document
|
97
|
+
|
98
|
+
def reset!
|
99
|
+
#elements.destroy_all
|
100
|
+
#self.elements = []
|
101
|
+
root.destroy if root
|
102
|
+
self.root = nil
|
103
|
+
setup_default_document
|
104
|
+
self
|
105
|
+
end
|
106
|
+
|
107
|
+
def view
|
108
|
+
return @view if @view
|
109
|
+
@view = ActionView::Base.new(Rails.configuration.view_path, {}, @controller)
|
110
|
+
@view.helpers.send :include, @controller.class.master_helper_module if @controller
|
111
|
+
@view.template_format = 'rtml'
|
112
|
+
@view
|
113
|
+
end
|
114
|
+
|
115
|
+
def /(name)
|
116
|
+
if name == root.name then [root]
|
117
|
+
else root / name
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
def screens
|
122
|
+
root ? root.elements.select { |ele| ele.name == 'screen' } : []
|
123
|
+
end
|
124
|
+
|
125
|
+
def to_tml
|
126
|
+
during_finalization_blocks.each { |i| self.process(&i) }
|
127
|
+
("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + (root ? root.to_tml : '')).gsub(/\t/, ' ')
|
128
|
+
end
|
129
|
+
|
130
|
+
# You can associate a block with this method, and the block will be called as a callback when self#to_tml
|
131
|
+
# is called.
|
132
|
+
def during_finalization(&block)
|
133
|
+
during_finalization_blocks << block
|
134
|
+
end
|
135
|
+
|
136
|
+
class << self
|
137
|
+
def ruleset_file
|
138
|
+
@@ruleset_file
|
139
|
+
end
|
140
|
+
|
141
|
+
def rules
|
142
|
+
Rtml::Rules::DomRuleset.parse(ruleset_file)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
private
|
147
|
+
def during_finalization_blocks
|
148
|
+
@during_finalization_blocks ||= []
|
149
|
+
end
|
150
|
+
end
|