rtml 1.2.2
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 +4 -0
- data/Manifest.txt +396 -0
- data/PostInstall.txt +2 -0
- data/README.rdoc +42 -0
- data/Rakefile +33 -0
- data/app_generators/rtml/USAGE +5 -0
- data/app_generators/rtml/rtml_generator.rb +78 -0
- data/app_generators/rtml/templates/rails_template.rb +36 -0
- data/app_generators/rtml/templates/rtml/MIT-LICENSE +20 -0
- data/app_generators/rtml/templates/rtml/README +109 -0
- data/app_generators/rtml/templates/rtml/Rakefile +38 -0
- data/app_generators/rtml/templates/rtml/app/controllers/beryl_controller.rb +70 -0
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/magcard_demo_controller.rb +9 -0
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/oe/btmlpa_controller.rb +158 -0
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/rtml_app_controller.rb +252 -0
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/tml_app_controller.rb +418 -0
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_helper.rb +72 -0
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/auth_result.rb +56 -0
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/common.rb +19 -0
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/index.rb +82 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_helper.rb +2 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/authorized.rb +10 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/common.rb +20 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/index.rb +33 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_helper.rb +2 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/auth_result.rb +23 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/common.rb +23 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/dynamic.rb +11 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/icc.rb +384 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/index.rb +191 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/receipt.rb +152 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/rtml_app_helper.rb +74 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/rtml_app_tml_helpers/common.rb +9 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/tml_app_helper.rb +43 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/card.rb +83 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_avs.rb +14 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_cvv.rb +14 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_parser.rb +21 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_pin.rb +18 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/emv_card_data.rb +25 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/mag_card_data.rb +21 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/reference_code.rb +26 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/state.rb +12 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/terminal.rb +8 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/transaction.rb +68 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/another_rcpt.rtml.erb +15 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/receipt.rtml.erb +108 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/receipt_single_column.rtml.erb +106 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/about.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/admin.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/construction.rtml.erb +10 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/idle.rtml.erb +13 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/main_menu.rtml.erb +12 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/menu_credit.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/menu_debit.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/beryl_color.rtml.erb +24 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/beryl_mono.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/magcard_demo_color.rtml.erb +24 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/magcard_demo_mono.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/oe/btmlpa_i5100.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/oe/btmlpa_i8550.rtml.erb +17 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/uml.html.erb +11 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/authorized.html.erb +15 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/authorized/main.rtml.erb +5 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index.html.erb +15 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/_error.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/enter_amount.rtml.erb +5 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/main.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/dynamic/response.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/icc.rtml.erb +760 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_enter_amount.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_about.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_duplicate.rtml.erb +9 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_examples.rtml.erb +9 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_logo.rtml.erb +11 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_other.rtml.erb +20 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_refund.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_reversal.rtml.erb +9 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_sale.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_sale_cashback.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/about.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/assert.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/card_nmb.rtml.erb +19 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/compl_txn.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/confirm_rev.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/duplicate_na.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/error_scr.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/main_menu.rtml.bak +31 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/main_menu.rtml.erb +40 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/print_pf.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/rd_sale_disp.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/read_refund.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/read_scb.rtml.erb +10 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/reject_trans.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/remove_card.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/rev_bad.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/scb_check_f.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/sign_check.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/subm_err.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/to_man_entry.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/trans_abrt.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/void_trans.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/receipt/_receipt.rtml.erb +29 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/receipt/error_paper.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_development.html.erb +167 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_header.html.erb +12 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_production.html.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/charts.html.erb +14 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/do_tml_redirect.rtml.erb +7 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/get_terminal_info.rtml.erb +26 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/rescue_action_in_public.rtml.erb +9 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/rescue_action_locally.rtml.erb +42 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/common.rb +303 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/force.rb +46 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/return.rb +22 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/sale.rb +49 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_confirmation.rtml.erb +10 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_agreement.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_footer.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_header.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/ask_cashback.rtml.erb +11 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/card_imprint.rtml.erb +7 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/check_cb.rtml.erb +11 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/conf_debit.rtml.erb +5 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/confirm_sale.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/confrm_force.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/cvv_skipped.rtml.erb +10 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/disp_avs.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/do_avs_zip.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_amount.rtml.erb +12 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_card.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_cashbk.rtml.erb +10 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_cvv2.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_expiry.rtml.erb +9 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/fraud_check1.rtml.erb +6 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/fraud_check2.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_aprvl.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_avs_zip.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_bad_aprv.rtml.erb +5 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frd_chk_fail.rtml.erb +5 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/invalid_exp.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/no_entr_crd.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/remove_card.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/swipe_card.rtml.erb +7 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/trans_abort.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/trans_reject.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/void_ref.rtml.erb +10 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/void.rb +30 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/card_parser_widget.rb +90 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/display_widget.rb +66 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/element_builder_widget.rb +123 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/emv_support_widget.rb +365 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/form_submit_widget.rb +65 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/get_transaction_variables_widget.rb +33 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/get_variable_widget.rb +39 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/receipt_widget.rb +66 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/screen_builder_widget.rb +49 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825132217_create_rtml_states.rb +15 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825132401_create_rtml_terminals.rb +16 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825132530_create_rtml_transactions.rb +24 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825134118_create_rtml_cards.rb +23 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825134622_create_rtml_emv_card_data.rb +20 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825134629_create_rtml_mag_card_data.rb +17 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825135838_create_rtml_card_parsers.rb +19 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090826103509_create_reference_codes.rb +14 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090915030044_add_batch_to_rtml_transactions.rb +10 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090915031155_add_additional_data_to_rtml_transactions.rb +10 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090915031156_add_hidden_data_to_rtml_transactions.rb +10 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20091016133313_create_rtml_card_avs.rb +16 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20091016135800_create_rtml_card_cvvs.rb +16 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20091016135810_create_rtml_card_pins.rb +16 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20091016135820_reverse_card_transaction_relationship.rb +11 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20100127115105_convert_rtml_migrations_to_rails_migrations.rb +31 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/USAGE +25 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/rtml_controller_generator.rb +49 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/common_tml_helper.rb +20 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/controller.rb +3 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/css_color.css +37 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/css_mono.css +12 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/functional_test.rb +11 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/helper.rb +2 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/layout_color.rtml.erb +24 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/layout_mono.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/tml_helper.rb +16 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/view.html.erb +15 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/view.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_document/USAGE +8 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_document/rtml_document_generator.rb +45 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/controller.rb +7 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/functional_test.rb +10 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/helper.rb +2 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/view.rtml.erb +11 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/USAGE +8 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/rtml_widget_generator.rb +66 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/templates/basic_widget.rb +57 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/templates/basic_widget_no_help.rb +27 -0
- data/app_generators/rtml/templates/rtml/init.rb +40 -0
- data/app_generators/rtml/templates/rtml/install.rb +18 -0
- data/app_generators/rtml/templates/rtml/lib/environment.rb +61 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/action_controller/request.rb +9 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/action_controller/routing/route_set.rb +34 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/action_view/base.rb +74 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/action_view/partial_template.rb +24 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/active_record.rb +13 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/active_support/dependencies.rb +25 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/array.rb +15 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/attr_boolean.rb +10 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/hash.rb +28 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/nil_class.rb +20 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/rake.rb +19 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/regexp.rb +16 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/string.rb +37 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins.rb +23 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/MIT-LICENSE +20 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/README +36 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/Rakefile +44 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/init.rb +25 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/action_controller/filters/before_render_filter.rb +30 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/before_render.rb +43 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/before_render_instance.rb +45 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/filter_chain_has_many_types_of_filters.rb +87 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/filter_has_before_render.rb +26 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/tasks/before_render_tasks.rake +25 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/test/before_render_test.rb +29 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/test/test_helper.rb +24 -0
- data/app_generators/rtml/templates/rtml/lib/rtml.rb +77 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/beryl/constants.rb +12 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/beryl/version.rb +11 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/common/renderable.rb +13 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/include.rb +30 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/layout.rb +59 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/next.rb +188 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen.rb +91 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/iterators.rb +63 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/next_screen_methods.rb +70 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/variable_methods.rb +73 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/support/importer.rb +55 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document.rb +318 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document/screen_methods.rb +79 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document/variable_methods.rb +83 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/variable.rb +123 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/browser_emulator.rb +59 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/rtml_controller_test_case.rb +7 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/rtml_core_unit_test.rb +11 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/unit_test.rb +3 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/delegation.rb +8 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/doc.rb +12 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/element.rb +75 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/errors/widget_accessor_failure.rb +9 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/events/event_handler.rb +79 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/events/event_processor.rb +106 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/events/processors.rb +10 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/events/processors/defaults_processor.rb +18 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/events/processors/key_processor.rb +21 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/feature.rb +32 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/feature_config.rb +195 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/features.rb +18 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/features/array_of_feature_instances.rb +17 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/features/controller_class_methods.rb +30 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/features/controller_instance_methods.rb +35 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers.rb +21 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/controller_helpers.rb +59 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/controller_helpers/menu_helpers.rb +193 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/action_view_wrapper.rb +23 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/event_helpers.rb +28 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/layout_helpers.rb +47 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/widget_support.rb +181 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/widget_support/class_methods.rb +28 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/yield_helpers.rb +33 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/proxy_helpers/feature_helpers.rb +17 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/render_helper.rb +71 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/terminal_helpers.rb +21 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers.rb +6 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers/tml_validation_assertions.rb +10 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers/variable_assertions.rb +27 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/view_helpers/form_helpers.rb +70 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/view_helpers/rtml_form_builder.rb +174 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/oe/btmlpa_constants.rb +48 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/proxying/method_missing_methods.rb +14 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/proxying/rtml_interface.rb +33 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/proxying/sandbox.rb +18 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/text_utils.rb +51 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/tml_param_parser.rb +95 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/dom_rule_parser.rb +61 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/dom_tag.rb +52 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/predefined_variable_rule_parser.rb +97 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/tml_validator.rb +16 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/version.rb +11 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/property.rb +11 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/property_accessors.rb +59 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/widget.rb +251 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/widget_class_methods.rb +213 -0
- 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 +37 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/beryl_mono.css +17 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/charts.css +0 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/i5100.css +12 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/i8550.css +37 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/receipt.css +4 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/examples/i5100.css +12 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/examples/i8550.css +37 -0
- data/app_generators/rtml/templates/rtml/reporting/110409 +227 -0
- data/app_generators/rtml/templates/rtml/reporting/linecount.rb +42 -0
- data/app_generators/rtml/templates/rtml/rules/predefined_tml_variables.rb +63 -0
- data/app_generators/rtml/templates/rtml/rules/tml_document_structure.rb +84 -0
- data/app_generators/rtml/templates/rtml/rules/varns/audio.rb +30 -0
- data/app_generators/rtml/templates/rtml/rules/varns/card.rb +17 -0
- data/app_generators/rtml/templates/rtml/rules/varns/card/emv.rb +31 -0
- data/app_generators/rtml/templates/rtml/rules/varns/card/mag.rb +8 -0
- data/app_generators/rtml/templates/rtml/rules/varns/card/parser.rb +7 -0
- data/app_generators/rtml/templates/rtml/rules/varns/card/pin.rb +6 -0
- data/app_generators/rtml/templates/rtml/rules/varns/cfgm.rb +15 -0
- data/app_generators/rtml/templates/rtml/rules/varns/com.rb +9 -0
- data/app_generators/rtml/templates/rtml/rules/varns/err.rb +14 -0
- data/app_generators/rtml/templates/rtml/rules/varns/gma/event.rb +13 -0
- data/app_generators/rtml/templates/rtml/rules/varns/gprs.rb +8 -0
- data/app_generators/rtml/templates/rtml/rules/varns/imager.rb +8 -0
- data/app_generators/rtml/templates/rtml/rules/varns/ip.rb +15 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr.rb +42 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/3rdparty.rb +7 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/backlight.rb +4 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/cache.rb +1 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/connect.rb +5 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/connection.rb +5 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/offline.rb +5 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oegw.rb +12 -0
- data/app_generators/rtml/templates/rtml/rules/varns/payment.rb +21 -0
- data/app_generators/rtml/templates/rtml/rules/varns/ppp.rb +11 -0
- data/app_generators/rtml/templates/rtml/rules/varns/terminal.rb +29 -0
- data/app_generators/rtml/templates/rtml/tasks/rtml_tasks.rake +78 -0
- data/app_generators/rtml/templates/rtml/template.rb +64 -0
- data/app_generators/rtml/templates/rtml/test/core/element_test.rb +17 -0
- data/app_generators/rtml/templates/rtml/test/core/screen_test.rb +91 -0
- data/app_generators/rtml/templates/rtml/test/core/tml_document_test.rb +53 -0
- data/app_generators/rtml/templates/rtml/test/functional/beryl_controller_test.rb +13 -0
- data/app_generators/rtml/templates/rtml/test/functional/btmlpa_controller_test.rb +13 -0
- data/app_generators/rtml/templates/rtml/test/functional/magcard_demo_controller_test.rb +20 -0
- data/app_generators/rtml/templates/rtml/test/functional/rtml_app_controller_test.rb +9 -0
- data/app_generators/rtml/templates/rtml/test/functional/rtml_routing_test.rb +19 -0
- data/app_generators/rtml/templates/rtml/test/functional/tml_controller_params_test.rb +20 -0
- data/app_generators/rtml/templates/rtml/test/rtml_test_helper.rb +44 -0
- data/app_generators/rtml/templates/rtml/test/validation/predefined_variable_rule_parser_test.rb +11 -0
- data/app_generators/rtml/templates/rtml/uninstall.rb +1 -0
- data/app_generators/rtml/templates/rtml/update.rb +57 -0
- data/bin/rtml +36 -0
- data/lib/rtml.rb +4 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/tasks/reglob.rake +28 -0
- data/test/test_generator_helper.rb +29 -0
- data/test/test_helper.rb +3 -0
- data/test/test_rtml.rb +11 -0
- data/test/test_rtml_generator.rb +43 -0
- metadata +516 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module Rtml
|
|
2
|
+
module Widgets
|
|
3
|
+
class <%=class_name%>Widget < Rtml::Widgets::Widget
|
|
4
|
+
# To define one or more properties:
|
|
5
|
+
# property :property_1, :property_2, . . .
|
|
6
|
+
# To define properties with callback methods:
|
|
7
|
+
# property :property_1 => :callback_1, :property_2 => :callback_2, . . .
|
|
8
|
+
# You can mix and match:
|
|
9
|
+
# property :property_1, :property_2 => :callback, :property_3, . . .
|
|
10
|
+
<%- properties.each do |prop| -%>
|
|
11
|
+
# <%=prop.to_s.titleize %>
|
|
12
|
+
property :<%=prop %>
|
|
13
|
+
<%- end -%>
|
|
14
|
+
|
|
15
|
+
# To make your widget accessible, specify the class name of either another
|
|
16
|
+
# Widget, or one of the built-in accessor types (TMLDocument, Screen, Display):
|
|
17
|
+
# You can specify more than one accessor:
|
|
18
|
+
# accessor Screen, TMLDocument
|
|
19
|
+
# You can also specify the accessor command more than once.
|
|
20
|
+
<% unless accessors.empty? %>accessor <%=accessors.join(", ")%><% end %>
|
|
21
|
+
|
|
22
|
+
# To alias your Widget so that you don't need to call it by its full name, use
|
|
23
|
+
# the accessor_alias method. You can specify multiple aliases on the same line
|
|
24
|
+
# by separating them with a comma.
|
|
25
|
+
accessor_alias :<%=class_name.underscore%>
|
|
26
|
+
<% unless aliases.empty? %>accessor_alias <%=aliases.collect { |i| ":#{i}" }.join(", ")%><% end %>
|
|
27
|
+
|
|
28
|
+
# If you wish to specify a default value for a property, you should do so in the
|
|
29
|
+
# init_properties method. Alternatively, you can give it a value of :required and
|
|
30
|
+
# an error will be raised if the user tries to use your Widget without setting the
|
|
31
|
+
# property.
|
|
32
|
+
def init_properties #:nodoc:
|
|
33
|
+
<%- properties.each do |prop| -%>
|
|
34
|
+
<%=prop%> :required
|
|
35
|
+
<%- end -%>
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# If you specified a callback for a property, above, then you should define that
|
|
39
|
+
# method:
|
|
40
|
+
# def name_assigned(new_val)
|
|
41
|
+
# # do something with the new value
|
|
42
|
+
# # IMPORTANT: The return value from a callback method is assigned to the property!
|
|
43
|
+
# new_val
|
|
44
|
+
# end
|
|
45
|
+
|
|
46
|
+
# You must define a to_tml method, which returns a String. This will be the
|
|
47
|
+
# result of your Widget, embedded into the TML document that is being generated.
|
|
48
|
+
def to_tml #:nodoc:
|
|
49
|
+
# You can call do_layout on a Widget, Element or String to apply any active layouts.
|
|
50
|
+
do_layout display <<-end_tml
|
|
51
|
+
Test Helpers (#{self.class.name})<br/>
|
|
52
|
+
Find me in lib/tml/widgets/test_helpers_widget.rb
|
|
53
|
+
end_tml
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
data/app_generators/rtml/templates/rtml/generators/rtml_widget/templates/basic_widget_no_help.rb
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module Rtml
|
|
2
|
+
module Widgets
|
|
3
|
+
class <%=class_name%>Widget < Rtml::Widgets::Widget
|
|
4
|
+
<%- properties.each do |prop| -%>
|
|
5
|
+
# <%=prop.to_s.titleize %>
|
|
6
|
+
property :<%=prop %>
|
|
7
|
+
<%- end -%>
|
|
8
|
+
|
|
9
|
+
<% unless accessors.empty? %>accessor <%=accessors.join(", ")%><% end %>
|
|
10
|
+
accessor_alias :<%=class_name.underscore%>
|
|
11
|
+
<% unless aliases.empty? %>accessor_alias <%=aliases.collect { |i| ":#{i}" }.join(", ")%><% end %>
|
|
12
|
+
|
|
13
|
+
def init_properties #:nodoc:
|
|
14
|
+
<%- properties.each do |prop| -%>
|
|
15
|
+
<%=prop%> :required
|
|
16
|
+
<%- end -%>
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def to_tml #:nodoc:
|
|
20
|
+
do_layout display <<-end_tml
|
|
21
|
+
Test Helpers (#{self.class.name})<br/>
|
|
22
|
+
Find me in lib/tml/widgets/test_helpers_widget.rb
|
|
23
|
+
end_tml
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
unless ((Rails.version >= "2.3.2" rescue false))
|
|
2
|
+
message = "RTML requires Rails 2.3.2 or higher. Please use a more recent version of Rails."
|
|
3
|
+
ActionController::Base::logger.error message
|
|
4
|
+
puts message
|
|
5
|
+
raise message
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
require 'extensions/attr_boolean'
|
|
9
|
+
require 'extensions/rake'
|
|
10
|
+
require 'extensions/array'
|
|
11
|
+
require 'extensions/string'
|
|
12
|
+
require 'extensions/hash'
|
|
13
|
+
require 'extensions/nil_class'
|
|
14
|
+
require 'extensions/regexp'
|
|
15
|
+
require 'extensions/active_record'
|
|
16
|
+
require 'extensions/action_view/partial_template' if Rails.version < "2.3"
|
|
17
|
+
require 'extensions/action_view/base' if Rails.version >= "2.3"
|
|
18
|
+
require 'extensions/action_controller/request'
|
|
19
|
+
require 'extensions/action_controller/routing/route_set'
|
|
20
|
+
require 'extensions/active_support/dependencies' if %W(2.3.2 2.3.3).include? Rails.version
|
|
21
|
+
require 'environment'
|
|
22
|
+
require 'other_plugins'
|
|
23
|
+
require 'open-uri'
|
|
24
|
+
|
|
25
|
+
# check for updates
|
|
26
|
+
unless ENV['RTML_UPDATE'] == false or ENV['RAILS_ENV'] == 'production'
|
|
27
|
+
update_file = "http://github.com/sinisterchipmunk/rtml/raw/master/update.rb"
|
|
28
|
+
begin
|
|
29
|
+
eval open(update_file).read, binding, update_file, 1
|
|
30
|
+
rescue
|
|
31
|
+
warning = ["Could not check for RTML updates: #{$!.message}",
|
|
32
|
+
"Add the following to config/environments.rb to supress this check:",
|
|
33
|
+
"\tENV['RTML_UPDATE'] = false"]
|
|
34
|
+
if defined? Rails
|
|
35
|
+
warning.each { |line| Rails.logger.warn line }
|
|
36
|
+
else
|
|
37
|
+
warning.each { |line| warn line }
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Install hook code here
|
|
2
|
+
require 'ftools'
|
|
3
|
+
require 'find'
|
|
4
|
+
|
|
5
|
+
%w(public doc).each do |dir|
|
|
6
|
+
Dir.glob(File.join(File.dirname(__FILE__), dir, "**/*")) do |fi|
|
|
7
|
+
next if File.directory? fi
|
|
8
|
+
target = File.join("../../../", fi.sub(File.dirname(__FILE__), ""))
|
|
9
|
+
unless File.directory? File.dirname(target)
|
|
10
|
+
puts "Creating directory: #{File.dirname(target)}"
|
|
11
|
+
File.makedirs(File.dirname(target))
|
|
12
|
+
end
|
|
13
|
+
unless File.exist? target
|
|
14
|
+
puts "Copying file: #{fi}"
|
|
15
|
+
File.copy(fi, target)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
require 'find'
|
|
2
|
+
|
|
3
|
+
Rails.backtrace_cleaner.add_silencer { |line| line =~ /rtml\/helpers\/action_view_wrapper\.rb/ }
|
|
4
|
+
Rails.backtrace_cleaner.add_silencer { |line| line =~ /rtml\/proxying\// }
|
|
5
|
+
|
|
6
|
+
configuration = template_base = nil
|
|
7
|
+
unless defined? RAILS_ROOT
|
|
8
|
+
RAILS_ROOT = File.join(File.dirname(__FILE__), "..",'..','..','..')
|
|
9
|
+
end
|
|
10
|
+
PLUGIN_BASE = File.join(RAILS_ROOT, "vendor", "plugins", "rtml")
|
|
11
|
+
|
|
12
|
+
def add_load_path(path, configuration) #:nodoc:
|
|
13
|
+
#path.gsub /^#{Regexp.escape File.join(RAILS_ROOT, "")}/, '' if defined? RAILS_ROOT
|
|
14
|
+
$LOAD_PATH << path
|
|
15
|
+
configuration.load_paths << path
|
|
16
|
+
|
|
17
|
+
if ENV['RAILS_ENV'] != 'production'
|
|
18
|
+
po = ((defined? RAILS_ROOT) ? path.gsub(/^#{Regexp.escape File.join(RAILS_ROOT, "")}/, '') : path)
|
|
19
|
+
ActionController::Base.logger.debug "Added load path #{po}"
|
|
20
|
+
configuration.load_once_paths.delete(path)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
if defined? Dependencies then configuration = Dependencies
|
|
25
|
+
elsif defined? ActiveSupport::Dependencies then configuration = ActiveSupport::Dependencies
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
if defined? ActionView
|
|
29
|
+
if defined? ActionView::Template and ActionView::Template.respond_to? :register_template_handler
|
|
30
|
+
template_base = ActionView::Template
|
|
31
|
+
else template_base = ActionView::Base
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
if configuration.nil? or template_base.nil?
|
|
36
|
+
raise "Couldn't find ActiveSupport dependencies and/or ActionView template base! " +
|
|
37
|
+
"Make sure you are using Rails v2.3.2 or higher."
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# autoloading of various stuffs
|
|
41
|
+
configuration.load_once_paths.delete(File.join(File.dirname(__FILE__))) if configuration
|
|
42
|
+
if configuration
|
|
43
|
+
add_load_path(File.join(PLUGIN_BASE), configuration)
|
|
44
|
+
add_load_path(File.join(PLUGIN_BASE, "components"), configuration)
|
|
45
|
+
add_load_path(File.join(PLUGIN_BASE, "lib"), configuration)
|
|
46
|
+
%w{ controllers helpers models views }.each do |dir|
|
|
47
|
+
add_load_path(File.join(PLUGIN_BASE, "app", dir), configuration)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Register TML and RTML MIME types
|
|
52
|
+
Mime::Type.register "text/tml", :tml
|
|
53
|
+
Mime::Type.register "text/tml", :rtml
|
|
54
|
+
|
|
55
|
+
# Add TML params parser
|
|
56
|
+
Mime::TML = Mime::Type.lookup('text/tml')
|
|
57
|
+
ActionController::Base.param_parsers[Mime::TML] = Proc.new { |data| Rtml::TmlParamParser.new(data).params }
|
|
58
|
+
|
|
59
|
+
# May go back to the "old way" (commented, below) if screen inheritence demands a new TemplateHandler
|
|
60
|
+
template_base.register_template_handler :rtml, ActionView::TemplateHandlers::ERB
|
|
61
|
+
#template_base.register_default_template_handler :erb, RtmlTemplateHandler
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
class ActionController::Request
|
|
2
|
+
# Returns true if this request originated from a terminal, irrespective of any debug properties
|
|
3
|
+
# that may or may not have been set. (For example, if a Web browser has been made to emulate a
|
|
4
|
+
# terminal, this method will still return false.)
|
|
5
|
+
def is_terminal?
|
|
6
|
+
# redefined elsewhere
|
|
7
|
+
false
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module ActionController
|
|
2
|
+
module Routing
|
|
3
|
+
class RouteSet
|
|
4
|
+
# To solve for an issue in Rails 2.x (known in 2.1.1 and 2.3.2) causing url_for to
|
|
5
|
+
# return URLs that do not match routing priority. RoR ticket #2510.
|
|
6
|
+
def routes_for_controller_and_action_and_keys(controller, action, keys)
|
|
7
|
+
selected = {}
|
|
8
|
+
routes.each do |route|
|
|
9
|
+
if route.matches_controller_and_action?(controller, action)
|
|
10
|
+
len = (keys - route.significant_keys).length
|
|
11
|
+
selected[route] = len if not selected.values.include? len
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
selected.keys.sort_by { |route| (keys - route.significant_keys).length }
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class Mapper
|
|
18
|
+
# Modifies your route set to produce TML-compatible routes. Also connects the default
|
|
19
|
+
# TML request (/index.tml) to the options you provide, if any.
|
|
20
|
+
#
|
|
21
|
+
# To use, just add the following to your /config/routes.rb file:
|
|
22
|
+
# map.connect_rtml :controller => "start_page"
|
|
23
|
+
#
|
|
24
|
+
def connect_rtml(options = {})
|
|
25
|
+
map = self # just makes it easier for me to copy-paste into routes.rb when debugging these
|
|
26
|
+
map.connect ':controller/:action/:id'
|
|
27
|
+
map.connect ':controller/:action.:format'
|
|
28
|
+
map.connect ':controller/:action.:format.:id'
|
|
29
|
+
map.connect '/index.tml', options.reverse_merge(:format => 'rtml') unless options.empty?
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
module ActionView
|
|
2
|
+
class Base
|
|
3
|
+
# Reimplementation of _pick_partial_template so that view inheritance works as expected
|
|
4
|
+
# in Rails 2.3 (which saw a pretty major overhaul of Templates, and rendered the
|
|
5
|
+
# 2.1 and 2.2 view inheritance ineffective.)
|
|
6
|
+
def _pick_partial_template(partial_path, ctrlr = controller.class)
|
|
7
|
+
### NOTE ###
|
|
8
|
+
#
|
|
9
|
+
# File actionpack-2.3.4\lib\action_view\partials.rb:
|
|
10
|
+
# 227 def _pick_partial_template(partial_path) #:nodoc:
|
|
11
|
+
#
|
|
12
|
+
if controller and not partial_path.include? '/'
|
|
13
|
+
if ctrlr == controller.class
|
|
14
|
+
# if a controller has not been expressly specified,
|
|
15
|
+
# start with nil controller so that [action]/[partial_path] is searched.
|
|
16
|
+
_pick_rtml_partial_template(partial_path)
|
|
17
|
+
else
|
|
18
|
+
_pick_rtml_partial_template(partial_path, ctrlr)
|
|
19
|
+
end
|
|
20
|
+
else
|
|
21
|
+
begin
|
|
22
|
+
super(partial_path, ctrlr)
|
|
23
|
+
rescue ArgumentError
|
|
24
|
+
super(partial_path)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Searches for a partial template in the following order:
|
|
30
|
+
# 1. [controller]/[action]/[partial_path]
|
|
31
|
+
# 2. [controller]/[partial_path]
|
|
32
|
+
# 3. ./[partial_path] (the base of each view path)
|
|
33
|
+
# If the partial is not found in either of these locations, the controller's superclass
|
|
34
|
+
# is searched to enable view inheritence for partials.
|
|
35
|
+
def _pick_rtml_partial_template(partial_path, ctrlr = controller.class)
|
|
36
|
+
# 1. controller/action/partial_path
|
|
37
|
+
path = "#{ctrlr.controller_path}/#{controller.params[:action]}/_#{partial_path}"
|
|
38
|
+
return _attempt_rtml_template(path, partial_path, ctrlr.superclass)
|
|
39
|
+
rescue MissingTemplate => mt
|
|
40
|
+
# 2. controller/partial_path
|
|
41
|
+
begin
|
|
42
|
+
path = "#{ctrlr.controller_path}/_#{partial_path}"
|
|
43
|
+
return _attempt_rtml_template(path, partial_path, ctrlr.superclass)
|
|
44
|
+
rescue MissingTemplate
|
|
45
|
+
# 3. ./partial_path
|
|
46
|
+
begin
|
|
47
|
+
path = partial_path
|
|
48
|
+
return _attempt_rtml_template(path, partial_path, nil)
|
|
49
|
+
rescue MissingTemplate
|
|
50
|
+
begin
|
|
51
|
+
path = "_#{partial_path}"
|
|
52
|
+
return _attempt_rtml_template(path, partial_path, nil)
|
|
53
|
+
rescue MissingTemplate
|
|
54
|
+
raise mt
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Attempts to find a template at the specified path, and then calls
|
|
61
|
+
# _pick_rtml_partial_template(partial_path, ctrlr) if it's not there.
|
|
62
|
+
# If it finds the template, the template is returned.
|
|
63
|
+
def _attempt_rtml_template(path, partial_path, ctrlr)
|
|
64
|
+
self.view_paths.find_template(path, self.template_format)
|
|
65
|
+
rescue MissingTemplate => mt
|
|
66
|
+
raise mt if ctrlr == ApplicationController or ctrlr.nil?
|
|
67
|
+
begin
|
|
68
|
+
_pick_rtml_partial_template(partial_path, ctrlr)
|
|
69
|
+
rescue MissingTemplate
|
|
70
|
+
raise mt
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module ActionView#:nodoc:
|
|
2
|
+
class PartialTemplate < Template#:nodoc:
|
|
3
|
+
# Changes to this class are copied from the patch at
|
|
4
|
+
# http://dev.rubyonrails.org/attachment/ticket/7076/add_partial_inheritance.2.diff
|
|
5
|
+
def partial_pieces(view, partial_path) #:nodoc:
|
|
6
|
+
if partial_path.include?('/')
|
|
7
|
+
return File.dirname(partial_path), File.basename(partial_path)
|
|
8
|
+
else
|
|
9
|
+
return partial_controller_find(view, partial_path)
|
|
10
|
+
end
|
|
11
|
+
end if Rails.version < "2.3"
|
|
12
|
+
|
|
13
|
+
def partial_controller_find(view, partial_path, klass = view.controller.class)#:nodoc:
|
|
14
|
+
if view.finder.file_exists?("#{klass.controller_path}/_#{partial_path}")
|
|
15
|
+
return klass.controller_path, partial_path
|
|
16
|
+
elsif !klass.superclass.method_defined?(:controller_path)
|
|
17
|
+
# End of the inheritance line
|
|
18
|
+
return view.controller.class.controller_path, partial_path
|
|
19
|
+
else
|
|
20
|
+
return partial_controller_find(view, partial_path, klass.superclass)
|
|
21
|
+
end
|
|
22
|
+
end if Rails.version < "2.3"
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module ActiveRecord
|
|
2
|
+
class Base
|
|
3
|
+
# Converts the specified method name for this record into a valid
|
|
4
|
+
# TML variable name.
|
|
5
|
+
def self.tml_name_for(method)
|
|
6
|
+
"#{self.name.gsub(/::/, '.')}.#{method}".downcase##{id}."
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def tml_name_for(method)
|
|
10
|
+
self.class.tml_name_for method
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# to address issue in Rails 2.3.2 with "is not missing constant" errors
|
|
2
|
+
# https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2283-unnecessary-exception-raised-in-asdependenciesload_missing_constant
|
|
3
|
+
=begin
|
|
4
|
+
module ActiveSupport
|
|
5
|
+
module Dependencies
|
|
6
|
+
extend self
|
|
7
|
+
|
|
8
|
+
#def load_missing_constant(from_mod, const_name)
|
|
9
|
+
|
|
10
|
+
def forgiving_load_missing_constant( from_mod, const_name )
|
|
11
|
+
begin
|
|
12
|
+
old_load_missing_constant(from_mod, const_name)
|
|
13
|
+
rescue ArgumentError => arg_err
|
|
14
|
+
if arg_err.message == "#{from_mod} is not missing constant #{const_name}!"
|
|
15
|
+
return from_mod.const_get(const_name)
|
|
16
|
+
else
|
|
17
|
+
raise
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
alias :old_load_missing_constant :load_missing_constant
|
|
22
|
+
alias :load_missing_constant :forgiving_load_missing_constant
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
=end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class Array
|
|
2
|
+
# Iterates through this array and constructs a single string composed
|
|
3
|
+
# of the values returned by calling render_tml, to_tml or to_s on every element in the
|
|
4
|
+
# array.
|
|
5
|
+
def to_tml
|
|
6
|
+
# 1.1.1: to_s now calls render_tml or to_tml as necessary
|
|
7
|
+
self.collect { |c| c.to_s }.join("\n\n")
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# Returns only the elements of this array that match either the specified argument or elements
|
|
11
|
+
# within the specified array.
|
|
12
|
+
def %(arr)
|
|
13
|
+
select { |i| arr.kind_of?(Array) ? arr.include?(i) : arr == i }
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
class Hash
|
|
2
|
+
# Iterates through this Hash and constructs a string
|
|
3
|
+
# in the format of name="value"
|
|
4
|
+
def to_xml_params(*which)
|
|
5
|
+
which = self.keys if which.length == 0
|
|
6
|
+
which.collect! { |a| a.to_s.downcase }
|
|
7
|
+
r = ""
|
|
8
|
+
self.each do |n,v|
|
|
9
|
+
if which.include? n.to_s.downcase
|
|
10
|
+
r.concat " "# unless r.blank?
|
|
11
|
+
r.concat "#{n}=\"#{v}\""
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
r
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def without_values(*values)
|
|
18
|
+
ret = {}
|
|
19
|
+
self.each do |key, value|
|
|
20
|
+
ret[key] = value unless values.include? value
|
|
21
|
+
end
|
|
22
|
+
ret
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def to_s(*which)
|
|
26
|
+
to_xml_params(*which)
|
|
27
|
+
end
|
|
28
|
+
end
|