rails_com 1.2.9 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +20 -165
- data/README.md +45 -22
- data/Rakefile +2 -1
- data/app/apis/ali_dns.rb +66 -0
- data/app/assets/images/avatar.png +0 -0
- data/app/channels/com/session_channel.rb +16 -0
- data/app/channels/rails_com/connection.rb +31 -0
- data/app/controllers/admin_controller.rb +4 -0
- data/app/controllers/application_controller.rb +7 -0
- data/app/controllers/base_controller.rb +2 -0
- data/app/controllers/board/base_controller.rb +3 -0
- data/app/controllers/board/home_controller.rb +6 -0
- data/app/controllers/board_controller.rb +3 -0
- data/app/controllers/com/audios_controller.rb +27 -0
- data/app/controllers/com/base_controller.rb +4 -0
- data/app/controllers/com/common_controller.rb +69 -0
- data/app/controllers/com/controller/admin.rb +114 -0
- data/app/controllers/com/controller/err_handler.rb +13 -0
- data/app/controllers/com/direct_uploads_controller.rb +11 -0
- data/app/controllers/com/log_controller.rb +30 -0
- data/app/controllers/com/nodes_controller.rb +22 -0
- data/app/controllers/com/panel/acme_accounts_controller.rb +12 -0
- data/app/controllers/com/panel/acme_identifiers_controller.rb +31 -0
- data/app/controllers/com/panel/acme_orders_controller.rb +64 -0
- data/app/controllers/com/panel/attachments_controller.rb +31 -0
- data/app/controllers/com/panel/base_controller.rb +5 -0
- data/app/controllers/com/panel/blob_defaults_controller.rb +13 -0
- data/app/controllers/com/panel/blobs_controller.rb +52 -0
- data/app/controllers/com/panel/cache_lists_controller.rb +5 -0
- data/app/controllers/com/panel/csps_controller.rb +18 -0
- data/app/controllers/com/panel/errs_controller.rb +18 -0
- data/app/controllers/com/panel/inbound_emails_controller.rb +15 -0
- data/app/controllers/com/panel/infos_controller.rb +9 -0
- data/app/controllers/com/panel/meta_actions_controller.rb +46 -0
- data/app/controllers/com/panel/meta_businesses_controller.rb +21 -0
- data/app/controllers/com/panel/meta_columns_controller.rb +47 -0
- data/app/controllers/com/panel/meta_controllers_controller.rb +46 -0
- data/app/controllers/com/panel/meta_models_controller.rb +32 -0
- data/app/controllers/com/panel/meta_namespaces_controller.rb +29 -0
- data/app/controllers/com/pdfs_controller.rb +37 -0
- data/app/controllers/com/videos_controller.rb +28 -0
- data/app/controllers/home_controller.rb +6 -0
- data/app/controllers/my/base_controller.rb +4 -0
- data/app/controllers/my/home_controller.rb +8 -0
- data/app/controllers/my_controller.rb +3 -0
- data/app/controllers/panel/base_controller.rb +4 -0
- data/app/controllers/panel/home_controller.rb +8 -0
- data/app/controllers/panel_controller.rb +5 -0
- data/app/controllers/rails_com/application.rb +113 -0
- data/app/helpers/rails_com/active_helper.rb +35 -39
- data/app/helpers/rails_com/form_helper.rb +21 -0
- data/app/helpers/rails_com/format_helper.rb +13 -0
- data/app/helpers/rails_com/frame_helper.rb +13 -0
- data/app/helpers/rails_com/kaminari_helper.rb +9 -0
- data/app/helpers/rails_com/time_helper.rb +23 -0
- data/app/helpers/rails_com/url_helper.rb +12 -0
- data/app/jobs/active_storage/identify_job.rb +9 -0
- data/app/jobs/application_job.rb +2 -0
- data/app/jobs/com/acme_job.rb +9 -0
- data/app/jobs/com/err_job.rb +10 -0
- data/app/mailboxes/application_mailbox.rb +2 -0
- data/app/mailers/application_mailer.rb +3 -0
- data/app/models/com/acme_account.rb +5 -0
- data/app/models/com/acme_identifier.rb +5 -0
- data/app/models/com/acme_order.rb +5 -0
- data/app/models/com/application_record.rb +5 -0
- data/app/models/com/blob_default.rb +5 -0
- data/app/models/com/cache_list.rb +5 -0
- data/app/models/com/csp.rb +5 -0
- data/app/models/com/err.rb +5 -0
- data/app/models/com/ext/debug.rb +71 -0
- data/app/models/com/ext/extra.rb +20 -0
- data/app/models/com/ext/parameter.rb +19 -0
- data/app/models/com/ext/sequence.rb +36 -0
- data/app/models/com/ext/state_machine.rb +82 -0
- data/app/models/com/ext/taxon.rb +81 -0
- data/app/models/com/ext/taxon_prepend.rb +21 -0
- data/app/models/com/info.rb +5 -0
- data/app/models/com/meta_action.rb +5 -0
- data/app/models/com/meta_business.rb +5 -0
- data/app/models/com/meta_column.rb +5 -0
- data/app/models/com/meta_controller.rb +5 -0
- data/app/models/com/meta_model.rb +5 -0
- data/app/models/com/meta_namespace.rb +5 -0
- data/app/models/com/meta_operation.rb +5 -0
- data/app/models/com/meta_route.rb +5 -0
- data/app/models/com/model/acme_account.rb +70 -0
- data/app/models/com/model/acme_identifier.rb +132 -0
- data/app/models/com/model/acme_order.rb +139 -0
- data/app/models/com/model/blob_default.rb +36 -0
- data/app/models/com/model/cache_list.rb +15 -0
- data/app/models/com/model/csp.rb +23 -0
- data/app/models/com/model/err.rb +108 -0
- data/app/models/com/model/info.rb +31 -0
- data/app/models/com/model/meta_action.rb +70 -0
- data/app/models/com/model/meta_business.rb +66 -0
- data/app/models/com/model/meta_column.rb +36 -0
- data/app/models/com/model/meta_controller.rb +115 -0
- data/app/models/com/model/meta_model.rb +58 -0
- data/app/models/com/model/meta_namespace.rb +61 -0
- data/app/models/com/model/meta_operation.rb +18 -0
- data/app/models/com/model/meta_permission.rb +10 -0
- data/app/models/com/model/meta_relation.rb +6 -0
- data/app/models/com/model/meta_route.rb +10 -0
- data/app/models/com.rb +11 -0
- data/app/models/concerns/feishu_bot.rb +15 -0
- data/app/models/concerns/log_record_bot.rb +40 -0
- data/app/models/concerns/work_wechat_bot.rb +18 -0
- data/app/stores/com/env_yaml.rb +96 -0
- data/app/stores/com/yaml.rb +89 -0
- data/app/views/admin/_breadcrumb.html.erb +5 -0
- data/app/views/application/_actionsheet.html.erb +20 -0
- data/app/views/application/_alert.html+phone.erb +6 -0
- data/app/views/application/_alert.html.erb +9 -0
- data/app/views/application/_auth_navbar.html.erb +18 -0
- data/app/views/application/_breadcrumb.html.erb +0 -0
- data/app/views/application/_button.html+phone.erb +3 -0
- data/app/views/application/_button.html.erb +3 -0
- data/app/views/application/_edit_form.html+phone.erb +10 -0
- data/app/views/application/_edit_form.html.erb +4 -0
- data/app/views/application/_error_messages.html.erb +11 -0
- data/app/views/application/_filter_form.html+phone.erb +14 -0
- data/app/views/application/_filter_form.html.erb +9 -0
- data/app/views/application/_filter_table.html.erb +0 -0
- data/app/views/application/_footer.html.erb +8 -0
- data/app/views/application/_form.html.erb +4 -0
- data/app/views/application/_index_sortable_table.html.erb +22 -0
- data/app/views/application/_index_table.html+phone.erb +13 -0
- data/app/views/application/_index_table.html.erb +22 -0
- data/app/views/application/_index_tbody.html.erb +3 -0
- data/app/views/application/_index_thead.html.erb +4 -0
- data/app/views/application/_index_tr.html+phone.erb +4 -0
- data/app/views/application/_index_tr.html.erb +16 -0
- data/app/views/application/_index_tree_table.html.erb +18 -0
- data/app/views/application/_locales.html.erb +11 -0
- data/app/views/application/_modal.html+phone.erb +14 -0
- data/app/views/application/_modal.html.erb +14 -0
- data/app/views/application/_nav.html.erb +0 -0
- data/app/views/application/_nav_bar.html+phone.erb +0 -0
- data/app/views/application/_nav_bar.html.erb +25 -0
- data/app/views/application/_nav_brand.html.erb +3 -0
- data/app/views/application/_nav_with_login.html.erb +0 -0
- data/app/views/application/_nav_without_login.html.erb +0 -0
- data/app/views/application/_new_form.html+phone.erb +10 -0
- data/app/views/application/_new_form.html.erb +4 -0
- data/app/views/application/_pagination.json.jbuilder +7 -0
- data/app/views/application/_show.html+phone.erb +20 -0
- data/app/views/application/_show.html.erb +13 -0
- data/app/views/application/_show_table.html.erb +0 -0
- data/app/views/application/_tab_bar.html.erb +3 -0
- data/app/views/application/_tab_bar_item.erb +4 -0
- data/app/views/application/alert.turbo_stream.erb +1 -0
- data/app/views/application/controller_not_found.json.jbuilder +4 -0
- data/app/views/application/create.json.jbuilder +1 -0
- data/app/views/application/create.turbo_stream.erb +3 -0
- data/app/views/application/destroy.json.jbuilder +0 -0
- data/app/views/application/destroy.turbo_stream.erb +3 -0
- data/app/views/application/edit.html.erb +7 -0
- data/app/views/application/edit.json.jbuilder +2 -0
- data/app/views/{shared/_error_messages.html.erb → application/err.turbo_stream.erb} +4 -4
- data/app/views/application/index.html.erb +5 -0
- data/app/views/application/index.json.jbuilder +1 -0
- data/app/views/application/move_higher.turbo_stream.erb +3 -0
- data/app/views/application/move_lower.turbo_stream.erb +3 -0
- data/app/views/application/new.html.erb +7 -0
- data/app/views/application/new.json.jbuilder +2 -0
- data/app/views/application/show.html.erb +3 -0
- data/app/views/application/show.json.jbuilder +1 -0
- data/app/views/application/update.json.jbuilder +1 -0
- data/app/views/application/update.turbo_stream.erb +3 -0
- data/app/views/board/home/index.html.erb +0 -0
- data/app/views/com/attachments/_file_upload.html.erb +19 -0
- data/app/views/com/attachments/_image_preview.html.erb +9 -0
- data/app/views/com/attachments/_list.html.erb +31 -0
- data/app/views/com/attachments/_list_edit.html.erb +28 -0
- data/app/views/com/attachments/_list_field.html.erb +6 -0
- data/app/views/com/attachments/_list_many.html.erb +17 -0
- data/app/views/com/attachments/_video_item.html.erb +6 -0
- data/app/views/com/audios/show.html.erb +3 -0
- data/app/views/com/common/deploy.html.erb +0 -0
- data/app/views/com/common/info.json.jbuilder +1 -0
- data/app/views/com/extra/_extra_form.html.erb +5 -0
- data/app/views/com/extra/_item.html.erb +15 -0
- data/app/views/com/nodes/_children_options.html.erb +4 -0
- data/app/views/com/nodes/_children_select.html.erb +15 -0
- data/app/views/com/nodes/_outer_children_options.html.erb +4 -0
- data/app/views/com/nodes/_outer_options.html+phone.erb +2 -0
- data/app/views/com/nodes/_outer_options.html.erb +4 -0
- data/app/views/com/nodes/_outer_select.html.erb +12 -0
- data/app/views/com/nodes/_self_and_siblings_options.html.erb +4 -0
- data/app/views/com/nodes/_siblings_options.html.erb +4 -0
- data/app/views/com/nodes/_siblings_select.html.erb +14 -0
- data/app/views/com/nodes/children.turbo_stream.erb +3 -0
- data/app/views/com/nodes/outer.turbo_stream.erb +3 -0
- data/app/views/com/panel/acme_accounts/_filter_form.html.erb +9 -0
- data/app/views/com/panel/acme_accounts/_index_tbody.html.erb +7 -0
- data/app/views/com/panel/acme_accounts/_index_thead.html.erb +4 -0
- data/app/views/com/panel/acme_accounts/_index_tr.html.erb +16 -0
- data/app/views/com/panel/acme_identifiers/_breadcrumb.html.erb +7 -0
- data/app/views/com/panel/acme_identifiers/_button.html.erb +0 -0
- data/app/views/com/panel/acme_identifiers/_filter_form.html.erb +9 -0
- data/app/views/com/panel/acme_identifiers/_form.html.erb +2 -0
- data/app/views/com/panel/acme_identifiers/_index_tbody.html.erb +16 -0
- data/app/views/com/panel/acme_identifiers/_index_thead.html.erb +17 -0
- data/app/views/com/panel/acme_identifiers/_show_table.html.erb +24 -0
- data/app/views/com/panel/acme_identifiers/index.html.erb +3 -0
- data/app/views/com/panel/acme_orders/_breadcrumb.html.erb +6 -0
- data/app/views/com/panel/acme_orders/_filter_form.html.erb +9 -0
- data/app/views/com/panel/acme_orders/_form.html.erb +4 -0
- data/app/views/com/panel/acme_orders/_index_tbody.html.erb +11 -0
- data/app/views/com/panel/acme_orders/_index_thead.html.erb +8 -0
- data/app/views/com/panel/acme_orders/_index_tr.html.erb +25 -0
- data/app/views/com/panel/acme_orders/_item_form.html.erb +14 -0
- data/app/views/com/panel/acme_orders/_new_form.html.erb +7 -0
- data/app/views/com/panel/acme_orders/_show_table.html.erb +4 -0
- data/app/views/com/panel/attachments/_breadcrumb.html.erb +10 -0
- data/app/views/com/panel/attachments/_button.html.erb +0 -0
- data/app/views/com/panel/attachments/_filter_form.html.erb +13 -0
- data/app/views/com/panel/attachments/_index_tbody.html.erb +6 -0
- data/app/views/com/panel/attachments/_index_thead.html.erb +7 -0
- data/app/views/com/panel/attachments/_index_tr.html.erb +10 -0
- data/app/views/com/panel/attachments/index.html.erb +5 -0
- data/app/views/com/panel/base/_index_meta_action.html.erb +14 -0
- data/app/views/com/panel/base/_nav.html.erb +3 -0
- data/app/views/com/panel/blob_defaults/_add_form.html.erb +7 -0
- data/app/views/com/panel/blob_defaults/_filter_form.html.erb +10 -0
- data/app/views/com/panel/blob_defaults/_form.html.erb +4 -0
- data/app/views/com/panel/blob_defaults/_index_tbody.html.erb +7 -0
- data/app/views/com/panel/blob_defaults/_index_thead.html.erb +5 -0
- data/app/views/com/panel/blob_defaults/_index_tr.html.erb +13 -0
- data/app/views/com/panel/blob_defaults/add.turbo_stream.erb +1 -0
- data/app/views/com/panel/blobs/_breadcrumb.html.erb +6 -0
- data/app/views/com/panel/blobs/_filter_form.html.erb +13 -0
- data/app/views/com/panel/blobs/_index_tbody.html.erb +22 -0
- data/app/views/com/panel/blobs/_index_thead.html.erb +12 -0
- data/app/views/com/panel/blobs/_index_tr.html.erb +13 -0
- data/app/views/com/panel/blobs/_new_form.html.erb +5 -0
- data/app/views/com/panel/blobs/index.html.erb +5 -0
- data/app/views/com/panel/cache_lists/_index_tbody.html.erb +4 -0
- data/app/views/com/panel/cache_lists/_index_thead.html.erb +5 -0
- data/app/views/com/panel/cache_lists/_show_table.html.erb +8 -0
- data/app/views/com/panel/csps/_button.html.erb +0 -0
- data/app/views/com/panel/csps/_filter_form.html.erb +8 -0
- data/app/views/com/panel/csps/_index_tbody.html.erb +11 -0
- data/app/views/com/panel/csps/_index_thead.html.erb +12 -0
- data/app/views/com/panel/csps/_index_tr.html.erb +13 -0
- data/app/views/com/panel/csps/_show/_breadcrumb.html.erb +6 -0
- data/app/views/com/panel/csps/_show_table.html.erb +48 -0
- data/app/views/com/panel/csps/show.html.erb +7 -0
- data/app/views/com/panel/errs/_button.html.erb +0 -0
- data/app/views/com/panel/errs/_filter_form.html.erb +11 -0
- data/app/views/com/panel/errs/_index_tbody.html.erb +16 -0
- data/app/views/com/panel/errs/_index_thead.html.erb +11 -0
- data/app/views/com/panel/errs/_index_tr.html.erb +13 -0
- data/app/views/com/panel/errs/_show/_breadcrumb.html.erb +6 -0
- data/app/views/com/panel/errs/_show_table.html.erb +44 -0
- data/app/views/com/panel/errs/show.html.erb +7 -0
- data/app/views/com/panel/inbound_emails/_button.html.erb +0 -0
- data/app/views/com/panel/inbound_emails/_filter_form.html.erb +9 -0
- data/app/views/com/panel/inbound_emails/_index_tbody.html.erb +5 -0
- data/app/views/com/panel/inbound_emails/_index_thead.html.erb +6 -0
- data/app/views/com/panel/inbound_emails/_show_table.html.erb +10 -0
- data/app/views/com/panel/inbound_emails/index.html.erb +5 -0
- data/app/views/com/panel/infos/_filter_form.html.erb +9 -0
- data/app/views/com/panel/infos/_index_tbody.html.erb +4 -0
- data/app/views/com/panel/infos/_index_thead.html.erb +5 -0
- data/app/views/com/panel/infos/index.json.jbuilder +1 -0
- data/app/views/com/panel/meta_actions/_breadcrumb.html.erb +6 -0
- data/app/views/com/panel/meta_actions/_form.html.erb +1 -0
- data/app/views/com/panel/meta_actions/_index_tbody.html.erb +4 -0
- data/app/views/com/panel/meta_actions/_index_thead.html.erb +5 -0
- data/app/views/com/panel/meta_actions/_roles.html.erb +9 -0
- data/app/views/com/panel/meta_actions/index.html.erb +3 -0
- data/app/views/com/panel/meta_actions/roles.js.erb +6 -0
- data/app/views/com/panel/meta_actions/update.turbo_stream.erb +1 -0
- data/app/views/com/panel/meta_businesses/_breadcrumb.html.erb +10 -0
- data/app/views/com/panel/meta_businesses/_button.html.erb +3 -0
- data/app/views/com/panel/meta_businesses/_form.html.erb +3 -0
- data/app/views/com/panel/meta_businesses/_index_tbody.html.erb +12 -0
- data/app/views/com/panel/meta_businesses/_index_thead.html.erb +2 -0
- data/app/views/com/panel/meta_businesses/_index_tr.html.erb +16 -0
- data/app/views/com/panel/meta_businesses/_show_table.html.erb +8 -0
- data/app/views/com/panel/meta_businesses/sync.turbo_stream.erb +3 -0
- data/app/views/com/panel/meta_columns/_breadcrumb.html.erb +6 -0
- data/app/views/com/panel/meta_columns/_form.html.erb +6 -0
- data/app/views/com/panel/meta_columns/_index_tbody.html.erb +20 -0
- data/app/views/com/panel/meta_columns/_index_thead.html.erb +12 -0
- data/app/views/com/panel/meta_columns/_index_tr.html.erb +22 -0
- data/app/views/com/panel/meta_columns/_show_table.html.erb +20 -0
- data/app/views/com/panel/meta_columns/sync.turbo_stream.erb +3 -0
- data/app/views/com/panel/meta_columns/test.turbo_stream.erb +3 -0
- data/app/views/com/panel/meta_controllers/_button.html.erb +3 -0
- data/app/views/com/panel/meta_controllers/_filter_form.html.erb +8 -0
- data/app/views/com/panel/meta_controllers/_filter_tablex.html.erb +8 -0
- data/app/views/com/panel/meta_controllers/_form.html.erb +2 -0
- data/app/views/com/panel/meta_controllers/_index_meta_business.html.erb +10 -0
- data/app/views/com/panel/meta_controllers/_index_meta_controller.html.erb +15 -0
- data/app/views/com/panel/meta_controllers/_index_meta_namespace.html.erb +12 -0
- data/app/views/com/panel/meta_controllers/_index_tbody.html.erb +28 -0
- data/app/views/com/panel/meta_controllers/_index_thead.html.erb +2 -0
- data/app/views/com/panel/meta_controllers/index.html.erb +3 -0
- data/app/views/com/panel/meta_controllers/meta_actions.turbo_stream.erb +1 -0
- data/app/views/com/panel/meta_controllers/meta_controllers.turbo_stream.erb +1 -0
- data/app/views/com/panel/meta_controllers/meta_namespaces.turbo_stream.erb +1 -0
- data/app/views/com/panel/meta_controllers/sync.turbo_stream.erb +3 -0
- data/app/views/com/panel/meta_models/_button.html.erb +6 -0
- data/app/views/com/panel/meta_models/_form.html.erb +4 -0
- data/app/views/com/panel/meta_models/_index_tbody.html.erb +3 -0
- data/app/views/com/panel/meta_models/_index_thead.html.erb +4 -0
- data/app/views/com/panel/meta_models/_index_tr.html.erb +19 -0
- data/app/views/com/panel/meta_models/_show_table.html.erb +12 -0
- data/app/views/com/panel/meta_models/sync.turbo_stream.erb +3 -0
- data/app/views/com/panel/meta_namespaces/_breadcrumb.html.erb +10 -0
- data/app/views/com/panel/meta_namespaces/_button.html.erb +3 -0
- data/app/views/com/panel/meta_namespaces/_form.html.erb +5 -0
- data/app/views/com/panel/meta_namespaces/_index_tbody.html.erb +20 -0
- data/app/views/com/panel/meta_namespaces/_index_thead.html.erb +6 -0
- data/app/views/com/panel/meta_namespaces/_show_table.html.erb +20 -0
- data/app/views/com/panel/meta_namespaces/sync.turbo_stream.erb +3 -0
- data/app/views/com/videos/show.html.erb +9 -0
- data/app/{assets/javascripts/controllers/active_storage_ext/videos/show.ready.js → views/com/videos/show.js} +0 -0
- data/app/views/default_form/_date_field.html.erb +1 -0
- data/app/views/default_form/_datetime_field.html.erb +1 -0
- data/app/views/default_form/_number_field.html.erb +1 -0
- data/app/views/default_form/_outer_select.html.erb +14 -0
- data/app/views/default_form/_select_enum.html.erb +1 -0
- data/app/views/default_form/_text_field.html.erb +1 -0
- data/app/views/default_form/_time_field.html.erb +1 -0
- data/app/views/extra_form/_number_field.html.erb +1 -0
- data/app/views/extra_form/_outer_select.html.erb +14 -0
- data/app/views/extra_form/_text_field.html.erb +1 -0
- data/app/views/home/index.html.erb +0 -0
- data/app/views/kaminari/com/_first_page.html.erb +3 -0
- data/app/views/kaminari/{_gap.html.erb → com/_gap.html.erb} +1 -1
- data/app/views/kaminari/com/_last_page.html.erb +3 -0
- data/app/views/kaminari/com/_next_page.html.erb +3 -0
- data/app/views/kaminari/com/_page.html.erb +1 -0
- data/app/views/kaminari/{_paginator.html.erb → com/_paginator.html+phone.erb} +3 -3
- data/app/views/kaminari/com/_paginator.html.erb +17 -0
- data/app/views/kaminari/com/_prev_page.html.erb +3 -0
- data/app/views/layouts/_admin_head.html.erb +22 -0
- data/app/views/layouts/_application_head.html.erb +26 -0
- data/app/views/layouts/_phone_head.html.erb +28 -0
- data/app/views/layouts/admin.html.erb +12 -0
- data/app/views/layouts/application.html+phone.erb +12 -0
- data/app/views/layouts/application.html.erb +11 -0
- data/app/views/layouts/application.json.jbuilder +2 -0
- data/app/views/layouts/board.html+phone.erb +10 -0
- data/app/views/layouts/board.html.erb +12 -0
- data/app/views/layouts/mailer.html.erb +14 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/app/views/layouts/my.html+phone.erb +11 -0
- data/app/views/layouts/my.html.erb +13 -0
- data/app/views/layouts/panel.html.erb +12 -0
- data/app/views/my/home/index.html.erb +0 -0
- data/app/views/panel/_breadcrumb.html.erb +0 -0
- data/app/views/panel/_com_nav.html.erb +19 -0
- data/app/views/panel/_nav.html.erb +6 -0
- data/app/views/panel/_nav_without_login.html.erb +3 -0
- data/app/views/panel/destroy.turbo_stream.erb +1 -0
- data/app/views/panel/home/index.html.erb +0 -0
- data/config/default_form.yml +74 -0
- data/config/locales/en.controller.yml +46 -0
- data/config/locales/en.yml +2 -2
- data/config/locales/zh.attributes.yml +9 -0
- data/config/locales/zh.controller.yml +65 -0
- data/config/locales/zh.enum.yml +11 -0
- data/config/locales/zh.helper.yml +10 -0
- data/config/locales/zh.rb +34 -0
- data/config/locales/zh.yml +66 -10
- data/config/routes.rb +140 -8
- data/lib/active_storage/service/disc_service.rb +41 -0
- data/lib/default_form/active_record/extend.rb +38 -0
- data/lib/default_form/builder/default.rb +88 -0
- data/lib/default_form/builder/helper.rb +212 -0
- data/lib/default_form/builder/wrap.rb +58 -0
- data/lib/default_form/config.rb +50 -0
- data/lib/default_form/controller_helper.rb +14 -0
- data/lib/default_form/form_builder.rb +61 -0
- data/lib/default_form/override/action_view/helpers/tags/collection_check_boxes.rb +23 -0
- data/lib/default_form/override/action_view/helpers/tags/collection_radio_buttons.rb +23 -0
- data/lib/default_form/view_helper.rb +39 -0
- data/lib/generators/jbuilder_generator.rb +22 -0
- data/lib/generators/scaffold_generator.rb +27 -0
- data/lib/generators/templates/jbuilder/_show.json.jbuilder.tt +1 -0
- data/lib/generators/templates/jbuilder/index.json.jbuilder.tt +1 -0
- data/lib/generators/templates/jbuilder/partial.json.jbuilder.tt +17 -0
- data/lib/generators/templates/scaffold_erb/_edit_form.html.erb.tt +4 -0
- data/lib/generators/templates/scaffold_erb/_filter_form.html.erb.tt +9 -0
- data/lib/generators/templates/scaffold_erb/_form.html.erb.tt +4 -0
- data/lib/generators/templates/scaffold_erb/_index_tbody.html.erb.tt +3 -0
- data/lib/generators/templates/scaffold_erb/_index_thead.html.erb.tt +4 -0
- data/lib/generators/templates/scaffold_erb/_new_form.html.erb.tt +4 -0
- data/lib/generators/templates/scaffold_erb/_show_table.html.erb.tt +6 -0
- data/lib/generators/templates/scaffold_erb/index.html.erb.tt +5 -0
- data/lib/rails_com/action_controller/errors.rb +9 -2
- data/lib/rails_com/action_controller/extend.rb +20 -0
- data/lib/rails_com/action_controller/include.rb +31 -0
- data/lib/rails_com/action_controller/parameters.rb +3 -0
- data/lib/rails_com/action_controller/public_exceptions.rb +31 -0
- data/lib/rails_com/action_controller/subscriber.rb +32 -0
- data/lib/rails_com/action_controller.rb +9 -3
- data/lib/rails_com/action_mailbox/inbound_email.rb +23 -0
- data/lib/rails_com/action_mailbox/mail_ext.rb +34 -0
- data/lib/rails_com/action_mailbox.rb +4 -0
- data/lib/rails_com/action_text/rich_text.rb +16 -0
- data/lib/rails_com/action_text.rb +3 -0
- data/lib/rails_com/action_view/partial_renderer.rb +22 -0
- data/lib/rails_com/action_view/template_renderer.rb +27 -28
- data/lib/rails_com/action_view/translation_helper.rb +7 -4
- data/lib/rails_com/action_view.rb +5 -2
- data/lib/rails_com/active_storage/activestorage_attached.rb +7 -4
- data/lib/rails_com/active_storage/attached_macros.rb +17 -5
- data/lib/rails_com/active_storage/attachment_prepend.rb +14 -0
- data/lib/rails_com/active_storage/attachment_transfer.rb +12 -5
- data/lib/rails_com/active_storage/video_response.rb +5 -1
- data/lib/rails_com/active_storage.rb +9 -4
- data/lib/rails_com/all.rb +23 -0
- data/lib/rails_com/api.rb +24 -0
- data/lib/rails_com/config.rb +22 -14
- data/lib/rails_com/engine.rb +41 -25
- data/lib/rails_com/utils/hex_helper.rb +12 -0
- data/lib/rails_com/utils/jobber.rb +3 -1
- data/lib/rails_com/utils/num_helper.rb +7 -5
- data/lib/rails_com/utils/qrcode_helper.rb +35 -0
- data/lib/rails_com/utils/setting.rb +5 -5
- data/lib/rails_com/utils/time_helper.rb +2 -0
- data/lib/rails_com/utils/uid_helper.rb +18 -15
- data/lib/rails_com.rb +25 -17
- data/lib/templates/rails/scaffold_controller/api_controller.rb.tt +20 -19
- data/lib/templates/rails/scaffold_controller/controller.rb.tt +1 -52
- data/lib/templates/test_unit/scaffold/functional_test.rb.tt +64 -0
- metadata +511 -120
- data/app/assets/config/rails_com_manifest.js +0 -6
- data/app/assets/images/image-square.png +0 -0
- data/app/assets/images/verification.jpg +0 -0
- data/app/assets/javascripts/rails_com/application.js +0 -29
- data/app/assets/javascripts/rails_com/attachment.js +0 -421
- data/app/assets/javascripts/rails_com/checkbox.js +0 -59
- data/app/assets/javascripts/rails_com/fetch_xhr_script.js +0 -31
- data/app/assets/javascripts/rails_com/footer.js +0 -9
- data/app/assets/javascripts/rails_com/picture.js +0 -18
- data/app/assets/javascripts/rails_com/sidebar.js +0 -40
- data/app/assets/javascripts/rails_com/time_local.js +0 -9
- data/app/assets/stylesheets/controllers/active_storage_ext/videos/show.css +0 -7
- data/app/assets/stylesheets/controllers/active_storage_ext/videos/transfer.css +0 -4
- data/app/assets/stylesheets/rails_com/application.css +0 -3
- data/app/controllers/active_storage_ext/admin/attachments_controller.rb +0 -13
- data/app/controllers/active_storage_ext/admin/base_controller.rb +0 -4
- data/app/controllers/active_storage_ext/admin/blob_defaults_controller.rb +0 -55
- data/app/controllers/active_storage_ext/admin/blobs_controller.rb +0 -48
- data/app/controllers/active_storage_ext/audios_controller.rb +0 -24
- data/app/controllers/active_storage_ext/videos_controller.rb +0 -25
- data/app/controllers/concerns/rails_common_api.rb +0 -60
- data/app/controllers/concerns/rails_common_controller.rb +0 -46
- data/app/controllers/concerns/rails_common_xhr.rb +0 -15
- data/app/helpers/rails_com/assets_helper.rb +0 -109
- data/app/models/active_storage/blob_default.rb +0 -24
- data/app/models/concerns/state_machine.rb +0 -79
- data/app/views/active_storage_ext/admin/attachments/destroy.js.erb +0 -1
- data/app/views/active_storage_ext/admin/blob_defaults/_form.html.erb +0 -8
- data/app/views/active_storage_ext/admin/blob_defaults/_search_form.html.erb +0 -7
- data/app/views/active_storage_ext/admin/blob_defaults/edit.html.erb +0 -9
- data/app/views/active_storage_ext/admin/blob_defaults/index.html.erb +0 -49
- data/app/views/active_storage_ext/admin/blob_defaults/new.html.erb +0 -9
- data/app/views/active_storage_ext/admin/blob_defaults/show.html.erb +0 -10
- data/app/views/active_storage_ext/admin/blobs/_search_form.html.erb +0 -9
- data/app/views/active_storage_ext/admin/blobs/destroy.js.erb +0 -1
- data/app/views/active_storage_ext/admin/blobs/index.html.erb +0 -51
- data/app/views/active_storage_ext/admin/blobs/new.html.erb +0 -13
- data/app/views/active_storage_ext/admin/blobs/show.html.erb +0 -10
- data/app/views/active_storage_ext/attachments/_default_image_item.html.erb +0 -14
- data/app/views/active_storage_ext/attachments/_image_item.html.erb +0 -6
- data/app/views/active_storage_ext/attachments/_list.html.erb +0 -25
- data/app/views/active_storage_ext/attachments/_list_edit.html.erb +0 -27
- data/app/views/active_storage_ext/attachments/_list_field.html.erb +0 -6
- data/app/views/active_storage_ext/attachments/_video_item.html.erb +0 -6
- data/app/views/active_storage_ext/audios/show.html.erb +0 -5
- data/app/views/active_storage_ext/videos/show.html.erb +0 -6
- data/app/views/kaminari/_first_page.html.erb +0 -3
- data/app/views/kaminari/_last_page.html.erb +0 -3
- data/app/views/kaminari/_next_page.html.erb +0 -3
- data/app/views/kaminari/_page.html.erb +0 -1
- data/app/views/kaminari/_prev_page.html.erb +0 -3
- data/app/views/layouts/rails_com/application.html.erb +0 -17
- data/app/views/shared/_alert.html.erb +0 -8
- data/app/views/shared/_locales.html.erb +0 -8
- data/config/locales/zh.datetime.yml +0 -44
- data/db/migrate/20181012025833_rails_com_init.rb +0 -14
- data/lib/active_record/type/i18n.rb +0 -19
- data/lib/generators/doc_model_generator.rb +0 -37
- data/lib/generators/doc_models_generator.rb +0 -11
- data/lib/generators/templates/model.erb +0 -6
- data/lib/mina/git2.rb +0 -59
- data/lib/mina/puma.rb +0 -64
- data/lib/mina/sidekiq.rb +0 -67
- data/lib/mina/whenever.rb +0 -27
- data/lib/rails_com/action_controller/controller_helper.rb +0 -29
- data/lib/rails_com/active_record/model_helper.rb +0 -107
- data/lib/rails_com/active_record/persistence_sneakily.rb +0 -11
- data/lib/rails_com/active_record/translation.rb +0 -66
- data/lib/rails_com/active_record.rb +0 -3
- data/lib/rails_com/active_storage/blob_ext.rb +0 -34
- data/lib/rails_com/core/array.rb +0 -72
- data/lib/rails_com/core/date.rb +0 -25
- data/lib/rails_com/core/hash.rb +0 -38
- data/lib/rails_com/core/nil.rb +0 -7
- data/lib/rails_com/core/numeric.rb +0 -11
- data/lib/rails_com/core/string.rb +0 -15
- data/lib/rails_com/core.rb +0 -7
- data/lib/rails_com/generators/named_base.rb +0 -10
- data/lib/rails_com/generators/scaffold_generator.rb +0 -15
- data/lib/rails_com/meta/controllers.rb +0 -8
- data/lib/rails_com/meta/models.rb +0 -21
- data/lib/rails_com/meta/routes.rb +0 -53
- data/lib/rails_com/sprockets/non_digest_assets.rb +0 -16
- data/lib/rails_com/utils/babel.rb +0 -38
- data/lib/rails_com/version.rb +0 -3
- data/lib/tasks/rails_com_tasks.rake +0 -4
- data/lib/templates/erb/scaffold/_filter.html.erb.tt +0 -10
- data/lib/templates/erb/scaffold/_form.html.erb.tt +0 -12
- data/lib/templates/erb/scaffold/edit.html.erb.tt +0 -9
- data/lib/templates/erb/scaffold/index.html.erb.tt +0 -45
- data/lib/templates/erb/scaffold/new.html.erb.tt +0 -9
- data/lib/templates/erb/scaffold/show.html.erb.tt +0 -16
@@ -1,14 +0,0 @@
|
|
1
|
-
<div class="ui image attached">
|
2
|
-
<div class="ui placeholder">
|
3
|
-
<div class="image" style="text-align: center;line-height: 100px;">
|
4
|
-
<i class="plus icon"></i>
|
5
|
-
</div>
|
6
|
-
</div>
|
7
|
-
</div>
|
8
|
-
|
9
|
-
<div class="ui image" id="file_template" style="display: none;">
|
10
|
-
<a href="javascript:void(0);" onclick="this.parentNode.remove()" class="ui grey right corner mini label">
|
11
|
-
<i class="times icon"></i>
|
12
|
-
</a>
|
13
|
-
<%= image_tag 'image-square.png', data: { target: 'picture.src' }, style: 'max-width: 100%' %>
|
14
|
-
</div>
|
@@ -1,6 +0,0 @@
|
|
1
|
-
<div class="ui image">
|
2
|
-
<%= link_to rails_ext_attachment_path(image.id), method: :delete, data: {confirm: 'Are you sure?'}, remote: true, class: 'ui grey right corner mini label' do %>
|
3
|
-
<i class="times icon"></i>
|
4
|
-
<% end %>
|
5
|
-
<%= image_tag image, id: "attachment_#{image.id}", data: { target: 'picture.src' }, style: 'max-width: 100%' %>
|
6
|
-
</div>
|
@@ -1,25 +0,0 @@
|
|
1
|
-
<% if target.is_a?(ActiveStorage::Attached::One) && target.attachment.present? %>
|
2
|
-
<% if target.content_type.to_s.start_with?('image') %>
|
3
|
-
<%= image_tag target, style: 'max-width: 100%', class: 'ui small image' %>
|
4
|
-
<% elsif target.content_type.to_s.start_with?('video') %>
|
5
|
-
<%= link_to target.filename, rails_video_path(video), target: '_blank' %>
|
6
|
-
<% else %>
|
7
|
-
<p id="attachment_<%= target.id %>">
|
8
|
-
<%= link_to target.filename, rails_blob_path(target) %>
|
9
|
-
</p>
|
10
|
-
<% end %>
|
11
|
-
<% elsif target.is_a?(ActiveStorage::Attached::Many) %>
|
12
|
-
<% target.each do |file| %>
|
13
|
-
<% if file.content_type.to_s.start_with?('image') %>
|
14
|
-
<%= image_tag file, style: 'max-width: 100%', class: 'ui small image' %>
|
15
|
-
<% elsif file.content_type.to_s.start_with?('video') %>
|
16
|
-
<p id="attachment_<%= file.id %>">
|
17
|
-
<%= link_to file.filename, rails_video_path(file), target: '_blank' %>
|
18
|
-
</p>
|
19
|
-
<% else %>
|
20
|
-
<p id="attachment_<%= file.id %>">
|
21
|
-
<%= link_to file.filename, rails_blob_path(file) %>
|
22
|
-
</p>
|
23
|
-
<% end %>
|
24
|
-
<% end %>
|
25
|
-
<% end %>
|
@@ -1,27 +0,0 @@
|
|
1
|
-
<% if target.is_a?(ActiveStorage::Attached::One) && target.attached? %>
|
2
|
-
<% if target.content_type.to_s.start_with?('image') %>
|
3
|
-
<%= render partial: 'active_storage_ext/attachments/image_item', locals: { image: target } %>
|
4
|
-
<% elsif target.content_type.to_s.start_with?('video') %>
|
5
|
-
<%= render partial: 'active_storage_ext/attachments/video_item', locals: { video: target } %>
|
6
|
-
<% else %>
|
7
|
-
<p id="attachment_<%= target.id %>">
|
8
|
-
<%= link_to target.filename, rails_ext_blob_path(target) %>
|
9
|
-
<%= link_to 'x', rails_ext_attachment_path(target.id), method: :delete, data: { confirm: 'Are you sure?' }, remote: true %>
|
10
|
-
</p>
|
11
|
-
<% end %>
|
12
|
-
<% elsif target.is_a?(ActiveStorage::Attached::Many) && target.attached? %>
|
13
|
-
<% target.each do |file| %>
|
14
|
-
<% if file.content_type.to_s.start_with?('image') %>
|
15
|
-
<%= render partial: 'active_storage_ext/attachments/image_item', locals: { image: file } %>
|
16
|
-
<% elsif file.content_type.to_s.start_with?('video') %>
|
17
|
-
<%= render partial: 'active_storage_ext/attachments/video_item', locals: { video: file } %>
|
18
|
-
<% else %>
|
19
|
-
<p id="attachment_<%= file.id %>">
|
20
|
-
<%= link_to file.filename, rails_ext_blob_path(file) %>
|
21
|
-
<%= link_to 'x', rails_ext_attachment_path(file.id), method: :delete, data: { confirm: 'Are you sure?' }, remote: true %>
|
22
|
-
</p>
|
23
|
-
<% end %>
|
24
|
-
<% end %>
|
25
|
-
<% else %>
|
26
|
-
<%= render partial: 'active_storage_ext/attachments/default_image_item' %>
|
27
|
-
<% end %>
|
@@ -1,6 +0,0 @@
|
|
1
|
-
<div class="top attached inline fields" id="<%= "#{target.record.class.name.underscore}_attachments_#{target.record.id}" %>">
|
2
|
-
<div class="six wide field"></div>
|
3
|
-
<div class="field ui tiny images" id="file_preview" data-controller="picture">
|
4
|
-
<%= render partial: 'active_storage_ext/attachments/list_edit', locals: { target: target } %>
|
5
|
-
</div>
|
6
|
-
</div>
|
@@ -1,6 +0,0 @@
|
|
1
|
-
<p id="attachment_<%= video.id %>">
|
2
|
-
<%= link_to video.filename, rails_video_path(video), target: '_blank' %>
|
3
|
-
<%= link_to 'transfer', transfer_rails_video_path(video.id), method: :put, data: { confirm: 'are you sure?' }, class: 'ui label' %>
|
4
|
-
<%= link_to 'x', rails_attachment_path(video.id), method: :delete, data: {confirm: 'Are you sure?'}, remote: true %>
|
5
|
-
</p>
|
6
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= link_to page, url, remote: remote, class: active_assert(page.current?) %>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
|
4
|
-
<head>
|
5
|
-
<title></title>
|
6
|
-
<%= stylesheet_link_tag 'rails_com/application', media: 'all', 'data-turbolinks-track': true %>
|
7
|
-
<%= javascript_include_tag 'rails_com/application', 'data-turbolinks-track': true %>
|
8
|
-
<%= csrf_meta_tags %>
|
9
|
-
</head>
|
10
|
-
|
11
|
-
<body>
|
12
|
-
|
13
|
-
<%= yield %>
|
14
|
-
|
15
|
-
</body>
|
16
|
-
|
17
|
-
</html>
|
@@ -1,44 +0,0 @@
|
|
1
|
-
zh:
|
2
|
-
datetime:
|
3
|
-
distance_in_words:
|
4
|
-
half_a_minute: 半分钟
|
5
|
-
less_than_x_seconds:
|
6
|
-
one: 不到1秒
|
7
|
-
other: '不到%{count}秒'
|
8
|
-
x_seconds:
|
9
|
-
one: 1秒
|
10
|
-
other: '%{count}秒'
|
11
|
-
less_than_x_minutes:
|
12
|
-
one: 不到1分钟
|
13
|
-
other: '不到%{count}分钟'
|
14
|
-
x_minutes:
|
15
|
-
one: 1分钟
|
16
|
-
other: '%{count}分钟'
|
17
|
-
about_x_hours:
|
18
|
-
one: 1小时
|
19
|
-
other: '%{count}小时'
|
20
|
-
x_days:
|
21
|
-
one: 1天
|
22
|
-
other: '%{count}天'
|
23
|
-
about_x_months:
|
24
|
-
one: 1个月
|
25
|
-
other: '%{count}个月'
|
26
|
-
x_months:
|
27
|
-
one: 1个月
|
28
|
-
other: '%{count} months'
|
29
|
-
about_x_years:
|
30
|
-
one: 1年
|
31
|
-
other: '%{count} years'
|
32
|
-
over_x_years:
|
33
|
-
one: '超过1年'
|
34
|
-
other: '%{count} 年'
|
35
|
-
almost_x_years:
|
36
|
-
one: 'almost 1 year'
|
37
|
-
other: 'almost %{count} years'
|
38
|
-
prompts:
|
39
|
-
year: 年
|
40
|
-
month: 月
|
41
|
-
day: 日
|
42
|
-
hour: 小时
|
43
|
-
minute: 分钟
|
44
|
-
second: 秒
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class RailsComInit < ActiveRecord::Migration[5.2]
|
2
|
-
def change
|
3
|
-
|
4
|
-
create_table :active_storage_blob_defaults do |t|
|
5
|
-
t.string :record_class
|
6
|
-
t.string :name
|
7
|
-
t.boolean :private
|
8
|
-
t.timestamps
|
9
|
-
end
|
10
|
-
|
11
|
-
change_column_null :active_storage_blobs, :checksum, true
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module ActiveRecord::Type
|
2
|
-
class I18n < Json
|
3
|
-
|
4
|
-
def type
|
5
|
-
:i18n
|
6
|
-
end
|
7
|
-
|
8
|
-
def deserialize(value)
|
9
|
-
if super && super.respond_to?(:[])
|
10
|
-
super[::I18n.locale.to_s]
|
11
|
-
else
|
12
|
-
value
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
ActiveRecord::Type.register(:i18n, ActiveRecord::Type::I18n)
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# 生成模型
|
2
|
-
#require 'rails/generators'
|
3
|
-
module Doc
|
4
|
-
class DocModelGenerator < Rails::Generators::NamedBase
|
5
|
-
source_root File.expand_path('../templates', __FILE__)
|
6
|
-
|
7
|
-
def create_controller_files
|
8
|
-
check_model_exist?
|
9
|
-
|
10
|
-
template 'model.erb', File.join('doc/api', "#{file_name}_model.md")
|
11
|
-
end
|
12
|
-
|
13
|
-
def check_model_exist?
|
14
|
-
Rails.application.eager_load! # 主动require 模型的定义
|
15
|
-
unless self.class.const_defined? model_name
|
16
|
-
abort "模型:#{model_name}没有定义"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def model_name
|
21
|
-
@model_name = file_name.classify
|
22
|
-
end
|
23
|
-
|
24
|
-
def model_class
|
25
|
-
@model_class = model_name.constantize
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
protected
|
30
|
-
|
31
|
-
|
32
|
-
def assign_model_name!(name)
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
end
|
data/lib/mina/git2.rb
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'mina/default'
|
2
|
-
|
3
|
-
set :branch, 'master'
|
4
|
-
set :remove_git_dir, true
|
5
|
-
set :remote, 'origin'
|
6
|
-
set :git_not_pushed_message, -> { "Your branch #{fetch(:branch)} needs to be pushed to #{fetch(:remote)} before deploying" }
|
7
|
-
|
8
|
-
namespace :git do
|
9
|
-
desc 'Clones the Git repository to the current path.'
|
10
|
-
task :clone do
|
11
|
-
ensure!(:repository)
|
12
|
-
ensure!(:deploy_to)
|
13
|
-
if set?(:commit)
|
14
|
-
comment %{Using git commit \\"#{fetch(:commit)}\\"}
|
15
|
-
command %{git clone "#{fetch(:repository)}" . --recursive}
|
16
|
-
command %{git checkout -b current_release "#{fetch(:commit)}" --force}
|
17
|
-
else
|
18
|
-
command %{
|
19
|
-
if [ ! -d "#{fetch(:deploy_to)}/scm" ]; then
|
20
|
-
echo "-----> Cloning the Git repository"
|
21
|
-
#{echo_cmd %[git clone --recurse-submodules --separate-git-dir #{fetch(:deploy_to)}/scm #{fetch(:repository)} #{fetch(:deploy_to)}/repo]}
|
22
|
-
else
|
23
|
-
echo "-----> Fetching new git commits"
|
24
|
-
#{echo_cmd %[(cd #{fetch(:deploy_to)}/repo && git pull --force #{fetch(:repository)} #{fetch(:branch)}:#{fetch(:branch)})]}
|
25
|
-
fi &&
|
26
|
-
echo "-----> Using git branch '#{fetch(:branch)}'" &&
|
27
|
-
#{echo_cmd %[echo 'gitdir: #{fetch(:deploy_to)}/scm' >> .git]}
|
28
|
-
#{echo_cmd %[git checkout --force]}
|
29
|
-
#{echo_cmd %[git submodule deinit -all]}
|
30
|
-
#{echo_cmd %[git submodule update --init]}
|
31
|
-
}, quiet: true
|
32
|
-
end
|
33
|
-
comment %{Using this git commit}
|
34
|
-
command %{git rev-parse HEAD > .mina_git_revision}
|
35
|
-
command %{git --no-pager log --format="%aN (%h):%n> %s" -n 1}
|
36
|
-
if fetch(:remove_git_dir)
|
37
|
-
command %{rm -rf .git}
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
desc 'Prints out current revision'
|
42
|
-
task :revision do
|
43
|
-
ensure!(:deploy_to)
|
44
|
-
command %{cat #{fetch(:current_path)}/.mina_git_revision}
|
45
|
-
end
|
46
|
-
|
47
|
-
desc 'Ensures local repository is pushed to remote'
|
48
|
-
task :ensure_pushed do
|
49
|
-
run :local do
|
50
|
-
comment %{Ensuring everything is pushed to git}
|
51
|
-
command %{
|
52
|
-
if [ $(git log #{fetch(:remote)}/#{fetch(:branch)}..#{fetch(:branch)} | wc -l) -ne 0 ]; then
|
53
|
-
echo "! #{fetch(:git_not_pushed_message)}"
|
54
|
-
exit 1
|
55
|
-
fi
|
56
|
-
}
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
data/lib/mina/puma.rb
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
set :bundle_more_prefix, -> { "BUNDLE_GEMFILE=#{fetch(:current_path) + '/Gemfile'} #{fetch :bundle_prefix}" }
|
2
|
-
set :puma_cmd, -> { "#{fetch :bundle_more_prefix} puma -e #{fetch :rails_env}" }
|
3
|
-
set :pumactl_cmd, -> { "#{fetch :bundle_more_prefix} pumactl" }
|
4
|
-
set :puma_socket, -> { "#{fetch :current_path}/tmp/pids/puma.pid" }
|
5
|
-
|
6
|
-
namespace :puma do
|
7
|
-
|
8
|
-
desc 'Start puma'
|
9
|
-
task start: :remote_environment do
|
10
|
-
in_path(fetch(:current_path)) do
|
11
|
-
command %{
|
12
|
-
if [[ -e #{fetch :puma_socket} ]]
|
13
|
-
then
|
14
|
-
echo 'Puma is already running!'
|
15
|
-
else
|
16
|
-
#{fetch :puma_cmd}
|
17
|
-
fi
|
18
|
-
}
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
desc 'Stop puma'
|
23
|
-
task stop: :remote_environment do
|
24
|
-
in_path(fetch(:current_path)) do
|
25
|
-
command %{
|
26
|
-
if [[ -e #{fetch :puma_socket} ]]
|
27
|
-
then
|
28
|
-
#{fetch :pumactl_cmd} stop
|
29
|
-
else
|
30
|
-
echo 'Puma is not running!'
|
31
|
-
fi
|
32
|
-
}
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
desc 'Restart puma'
|
37
|
-
task restart: :remote_environment do
|
38
|
-
in_path(fetch(:current_path)) do
|
39
|
-
command %{
|
40
|
-
if [[ -e #{fetch :puma_socket} ]]
|
41
|
-
then
|
42
|
-
#{fetch :pumactl_cmd} restart
|
43
|
-
else
|
44
|
-
echo 'Puma is not running! Start Now!' && #{fetch :puma_cmd}
|
45
|
-
fi
|
46
|
-
}
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
desc 'Restart puma (phased restart)'
|
51
|
-
task phased_restart: :remote_environment do
|
52
|
-
in_path(fetch(:current_path)) do
|
53
|
-
command %{
|
54
|
-
if [[ -e #{fetch :puma_socket} ]]
|
55
|
-
then
|
56
|
-
#{fetch :pumactl_cmd} phased-restart
|
57
|
-
else
|
58
|
-
echo 'Puma is not running! Start Now!' && #{fetch :puma_cmd}
|
59
|
-
fi
|
60
|
-
}
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
data/lib/mina/sidekiq.rb
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
|
2
|
-
#:nodoc:
|
3
|
-
set :sidekiq, -> { "#{fetch :bundle_prefix} sidekiq -d" }
|
4
|
-
set :sidekiqctl, -> { "#{fetch :bundle_prefix} sidekiqctl" }
|
5
|
-
set :sidekiq_config, -> { "#{fetch :current_path}/config/sidekiq.yml" }
|
6
|
-
set :sidekiq_pid, -> { "#{fetch :current_path}/tmp/pids/sidekiq.pid" }
|
7
|
-
set :sidekiq_processes, 2
|
8
|
-
set :sidekiq_timeout, 10
|
9
|
-
|
10
|
-
namespace :sidekiq do
|
11
|
-
|
12
|
-
def for_each_process(&block)
|
13
|
-
fetch(:sidekiq_processes).times do |idx|
|
14
|
-
if idx == 0
|
15
|
-
pid_file = fetch :sidekiq_pid
|
16
|
-
else
|
17
|
-
pid_file = "#{fetch :sidekiq_pid}-#{idx}"
|
18
|
-
end
|
19
|
-
|
20
|
-
yield(pid_file, idx)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
desc 'Quiet sidekiq (stop accepting new work)'
|
25
|
-
task quiet: :remote_environment do
|
26
|
-
comment 'Quiet sidekiq (stop accepting new work)'
|
27
|
-
for_each_process do |pid_file, idx|
|
28
|
-
command %{
|
29
|
-
if [ -f #{pid_file} ] && kill -0 `cat #{pid_file}`> /dev/null 2>&1; then
|
30
|
-
cd "#{deploy_to}/#{current_path}"
|
31
|
-
#{echo_cmd %{#{sidekiqctl} quiet #{pid_file}} }
|
32
|
-
else
|
33
|
-
echo 'Skip quiet command (no pid file found)'
|
34
|
-
fi
|
35
|
-
}
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
desc 'Stop sidekiq'
|
40
|
-
task stop: :remote_environment do
|
41
|
-
comment 'Stop sidekiq!'
|
42
|
-
|
43
|
-
for_each_process do |pid_file, _|
|
44
|
-
in_path fetch(:current_path) do
|
45
|
-
command %{ #{fetch :sidekiqctl} stop #{pid_file} #{fetch :sidekiq_timeout}}
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
desc 'Start sidekiq'
|
51
|
-
task start: :remote_environment do
|
52
|
-
comment 'Start sidekiq!'
|
53
|
-
|
54
|
-
for_each_process do |pid_file, idx|
|
55
|
-
in_path fetch(:current_path) do
|
56
|
-
command %{ #{fetch :sidekiq} -d -i #{idx} -P #{pid_file} }
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
desc 'Restart sidekiq'
|
62
|
-
task :restart do
|
63
|
-
invoke :'sidekiq:stop'
|
64
|
-
invoke :'sidekiq:start'
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
data/lib/mina/whenever.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
set :whenever_name, -> { "#{fetch(:domain)}_#{fetch(:rails_env)}" }
|
2
|
-
|
3
|
-
namespace :whenever do
|
4
|
-
desc 'Clear crontab'
|
5
|
-
task clear: :remote_environment do
|
6
|
-
comment "Clear crontab for #{fetch(:whenever_name)}"
|
7
|
-
in_path fetch(:current_path) do
|
8
|
-
command "#{fetch(:bundle_bin)} exec whenever --clear-crontab #{fetch(:whenever_name)} --set 'environment=#{fetch(:rails_env)}&path=#{fetch(:current_path)}'"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
desc 'Update crontab'
|
13
|
-
task update: :remote_environment do
|
14
|
-
comment "Update crontab for #{fetch(:whenever_name)}"
|
15
|
-
in_path fetch(:current_path) do
|
16
|
-
command "#{fetch(:bundle_bin)} exec whenever --update-crontab #{fetch(:whenever_name)} --set 'environment=#{fetch(:rails_env)}&path=#{fetch(:current_path)}'"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
desc 'Write crontab'
|
21
|
-
task write: :remote_environment do
|
22
|
-
comment "Write crontab for #{fetch(:whenever_name)}"
|
23
|
-
in_path fetch(:current_path) do
|
24
|
-
command "#{fetch(:bundle_bin)} exec whenever --write-crontab #{fetch(:whenever_name)} --set 'environment=#{fetch(:rails_env)}&path=#{fetch(:current_path)}'"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module RailsCom::ControllerHelper
|
2
|
-
|
3
|
-
def detect_filter(filter)
|
4
|
-
callback = self.__callbacks[:process_action].find { |i| i.filter == filter.to_sym }
|
5
|
-
return false unless callback
|
6
|
-
|
7
|
-
_if = callback.instance_variable_get(:@if).map do |c|
|
8
|
-
c.call(self)
|
9
|
-
end
|
10
|
-
|
11
|
-
_unless = callback.instance_variable_get(:@unless).map do |c|
|
12
|
-
!c.call(self)
|
13
|
-
end
|
14
|
-
|
15
|
-
!(_if + _unless).uniq.include?(false)
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
module RailsCom::FilterHelper
|
21
|
-
def whether_filter(filter)
|
22
|
-
self.get_callbacks(:process_action).map(&:filter).include?(filter.to_sym)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
ActiveSupport.on_load :action_controller do
|
27
|
-
include RailsCom::ControllerHelper
|
28
|
-
extend RailsCom::FilterHelper
|
29
|
-
end
|