diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
| commit | e0a7e0fec760ba12c8067a37e10c96f1f05876e2 (patch) | |
| tree | d0cf745592a46aee4d4913911fd34c7c24515220 /vendor/plugins/exception_notification/lib/exception_notifier_helper.rb | |
| parent | 6424e10be5a89f175a74c71c55660412a169b8b8 (diff) | |
Stage 1 complete: Rails 2.3.5 to Rails 3.2.22.5 upgrade
- Converted plugins to gems (Gemfile)
- Updated config structure (application.rb, boot.rb, environment.rb)
- Converted routes to Rails 3 DSL
- Converted named_scope to scope throughout models
- Converted find(:all, :conditions) to where() chains
- Fixed has_many :order to use ordering scope
- Updated session store and secret token configuration
- Fixed exception_notification middleware configuration
- Patched Ruby 2.4 / Rails 3.2 incompatibilities:
- Integer/Float duration arithmetic (ActiveSupport)
- Arel visit_Integer for PostgreSQL adapter
- create_database String/Integer coercion
- ActionController consider_all_requests_local
- Migrated taggings schema for acts-as-taggable-on
- Replaced dynamic_form gem with custom form_error_messages helper
- Fixed Rails 3 block helper syntax (form_for, form_tag, fields_for)
- Fixed admin layout yield
- Updated test suite for Rails 3 APIs
Diffstat (limited to 'vendor/plugins/exception_notification/lib/exception_notifier_helper.rb')
| -rw-r--r-- | vendor/plugins/exception_notification/lib/exception_notifier_helper.rb | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/vendor/plugins/exception_notification/lib/exception_notifier_helper.rb b/vendor/plugins/exception_notification/lib/exception_notifier_helper.rb deleted file mode 100644 index d3dc63ab..00000000 --- a/vendor/plugins/exception_notification/lib/exception_notifier_helper.rb +++ /dev/null | |||
| @@ -1,78 +0,0 @@ | |||
| 1 | require 'pp' | ||
| 2 | |||
| 3 | # Copyright (c) 2005 Jamis Buck | ||
| 4 | # | ||
| 5 | # Permission is hereby granted, free of charge, to any person obtaining | ||
| 6 | # a copy of this software and associated documentation files (the | ||
| 7 | # "Software"), to deal in the Software without restriction, including | ||
| 8 | # without limitation the rights to use, copy, modify, merge, publish, | ||
| 9 | # distribute, sublicense, and/or sell copies of the Software, and to | ||
| 10 | # permit persons to whom the Software is furnished to do so, subject to | ||
| 11 | # the following conditions: | ||
| 12 | # | ||
| 13 | # The above copyright notice and this permission notice shall be | ||
| 14 | # included in all copies or substantial portions of the Software. | ||
| 15 | # | ||
| 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| 19 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
| 20 | # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
| 21 | # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
| 22 | # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 23 | module ExceptionNotifierHelper | ||
| 24 | VIEW_PATH = "views/exception_notifier" | ||
| 25 | APP_PATH = "#{RAILS_ROOT}/app/#{VIEW_PATH}" | ||
| 26 | PARAM_FILTER_REPLACEMENT = "[FILTERED]" | ||
| 27 | |||
| 28 | def render_section(section) | ||
| 29 | RAILS_DEFAULT_LOGGER.info("rendering section #{section.inspect}") | ||
| 30 | summary = render_overridable(section).strip | ||
| 31 | unless summary.blank? | ||
| 32 | title = render_overridable(:title, :locals => { :title => section }).strip | ||
| 33 | "#{title}\n\n#{summary.gsub(/^/, " ")}\n\n" | ||
| 34 | end | ||
| 35 | end | ||
| 36 | |||
| 37 | def render_overridable(partial, options={}) | ||
| 38 | if File.exist?(path = "#{APP_PATH}/_#{partial}.rhtml") | ||
| 39 | render(options.merge(:file => path, :use_full_path => false)) | ||
| 40 | elsif File.exist?(path = "#{File.dirname(__FILE__)}/../#{VIEW_PATH}/_#{partial}.rhtml") | ||
| 41 | render(options.merge(:file => path, :use_full_path => false)) | ||
| 42 | else | ||
| 43 | "" | ||
| 44 | end | ||
| 45 | end | ||
| 46 | |||
| 47 | def inspect_model_object(model, locals={}) | ||
| 48 | render_overridable(:inspect_model, | ||
| 49 | :locals => { :inspect_model => model, | ||
| 50 | :show_instance_variables => true, | ||
| 51 | :show_attributes => true }.merge(locals)) | ||
| 52 | end | ||
| 53 | |||
| 54 | def inspect_value(value) | ||
| 55 | len = 512 | ||
| 56 | result = object_to_yaml(value).gsub(/\n/, "\n ").strip | ||
| 57 | result = result[0,len] + "... (#{result.length-len} bytes more)" if result.length > len+20 | ||
| 58 | result | ||
| 59 | end | ||
| 60 | |||
| 61 | def object_to_yaml(object) | ||
| 62 | object.to_yaml.sub(/^---\s*/m, "") | ||
| 63 | end | ||
| 64 | |||
| 65 | def exclude_raw_post_parameters? | ||
| 66 | @controller && @controller.respond_to?(:filter_parameters) | ||
| 67 | end | ||
| 68 | |||
| 69 | def filter_sensitive_post_data_parameters(parameters) | ||
| 70 | exclude_raw_post_parameters? ? @controller.__send__(:filter_parameters, parameters) : parameters | ||
| 71 | end | ||
| 72 | |||
| 73 | def filter_sensitive_post_data_from_env(env_key, env_value) | ||
| 74 | return env_value unless exclude_raw_post_parameters? | ||
| 75 | return PARAM_FILTER_REPLACEMENT if (env_key =~ /RAW_POST_DATA/i) | ||
| 76 | return @controller.__send__(:filter_parameters, {env_key => env_value}).values[0] | ||
| 77 | end | ||
| 78 | end | ||
