public this repo is viewable by everyone
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/insoshi/insoshi.git
Removed old textmate footnotes (non-working) files
Michael Hartl (author)
13 days ago
commit  d6690c5caae7b1ec575b924c4b2e55f36e9e5dbf
tree    2606168c1edd0affbf9213583607759c5dfd3bc3
parent  11d51bcea514ab0dbe34c8fa0053c4106a991060
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,24 +0,0 @@
0
-
0
-
0
-The MIT license:
0
-Copyright (c) 2008 Less Everything, Inc.
0
-
0
-Permission is hereby granted, free of charge, to any person obtaining a copy
0
-of this software and associated documentation files (the "Software"), to deal
0
-in the Software without restriction, including without limitation the rights
0
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
0
-copies of the Software, and to permit persons to whom the Software is
0
-furnished to do so, subject to the following conditions:
0
-
0
-The above copyright notice and this permission notice shall be included in
0
-all copies or substantial portions of the Software.
0
-
0
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
0
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
0
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
0
-THE SOFTWARE.
0
-
0
-
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
0
@@ -1,20 +0,0 @@
0
-# Copyright:
0
-# (c) 2006 InquiryLabs, Inc.
0
-# Visit us at http://inquirylabs.com/
0
-# Version: 2.0
0
-# License: MIT
0
-# Author: Duane Johnson (duane.johnson@gmail.com)
0
-# Description:
0
-# Creates clickable footnotes on each rendered page, as well as clickable
0
-# links in the backtrace should an error occur in your Rails app. Links take
0
-# you to the right place inside TextMate.
0
-
0
-# Enable only the TextMate on Macs in development mode
0
-if (ENV['RAILS_ENV'] == 'development')
0
- # Windows doesn't have 'uname', so rescue false
0
- ::MAC_OS_X = (`uname`.chomp == "Darwin") rescue false
0
- require 'textmate_footnotes'
0
- require 'textmate_initialize'
0
-
0
- require 'textmate_backtracer' if ::MAC_OS_X
0
-end
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
9
10
11
12
...
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,12 +0,0 @@
0
-module ActionView::Helpers::UrlHelper
0
-
0
-
0
- #alias_method :link_to_original, :link_to
0
- #def link_to name, options = {}, html_options = nil, *parameters_for_method_reference
0
- # replace = html_options && html_options.has_key?(:method) ? true : false
0
- # s = link_to_original name, options, html_options, parameters_for_method_reference
0
- # s = s.gsub(/href=\".*?\"/,'href="#"') if replace
0
- # s
0
- #end
0
-
0
-end
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,50 +0,0 @@
0
-
0
-
0
-class ActionMailer::Base
0
-
0
- helper ActionView::Helpers::UrlHelper
0
-
0
- def generic_mailer(options)
0
- @recipients = options[:recipients] || MAILER_TO_ADDRESS
0
- @from = options[:from] || MAILER_FROM_ADDRESS
0
- @cc = options[:cc] || ""
0
- @bcc = options[:bcc] || ""
0
- @subject = options[:subject] || ""
0
- @body = options[:body] || {}
0
- @headers = options[:headers] || {}
0
- @charset = options[:charset] || "utf-8"
0
- @content_type = options[:content_type] || "text/plain"
0
- end
0
-
0
-
0
- def self.add_recipients(addresses, address)
0
- if addresses.blank?
0
- address
0
- else
0
- addresses << ";#{address}"
0
- end
0
- end
0
-
0
-=begin
0
-#add blocks like this to controlers
0
-class ContactMailer < ActionMailer::Base
0
- def contact_us(options)
0
- self.generic_mailer(options)
0
- end
0
-end
0
-
0
-
0
-#call like this
0
- ContactMailer.deliver_contact_us(
0
- :recipients => "x@x.com",
0
- :body => {
0
- :name => params[:name],
0
- :phone => params[:phone],
0
- :email => params[:email],
0
- :message => params[:message]
0
- },
0
- :from => "y@y.com"
0
-)
0
-=end
0
-
0
-end
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,69 +0,0 @@
0
-
0
-
0
-class <<ActiveRecord::Base
0
- alias_method :[], :find
0
-
0
-
0
- def each options = :all, params = {}
0
- find(options, params).each{|i| yield i}
0
- end
0
-
0
-
0
- def find_with_defaults options = :all, params = {}
0
- find_without_defaults options, params
0
- end
0
- alias_method_chain :find, :defaults
0
-
0
-end
0
-
0
-
0
-
0
-class ActiveRecord::Base
0
-
0
-
0
-
0
-
0
- def self.per_page
0
- $left_items_per_page
0
- end
0
-
0
- def dom_id(prefix='')
0
- display_id = new_record? ? "new" : id.to_s
0
- prefix.to_s <<( '_') unless prefix.blank?
0
- prefix.to_s << "#{self.class.name.underscore}"
0
- prefix != :bare ? "#{prefix.to_s.underscore}_#{display_id}" : display_id
0
- end
0
-
0
-
0
-
0
- def to_controller
0
- self.class.to_s.underscore.downcase
0
- end
0
-
0
- def self.to_proper_noun
0
- self.class_name.underscore.titleize
0
- end
0
-
0
- def fix_numbers *attr_names
0
- attr_names.each do |attr_name|
0
- fixed = self.send("#{attr_name}_before_type_cast").to_s.gsub(/[\$,]/,'')
0
- self.attributes = {attr_name => fixed}
0
- end
0
- end
0
-
0
-
0
- def errors_combine other_errors
0
- other_errors.each do |at, msg|
0
- errors.add at, msg
0
- end
0
- end
0
-
0
-
0
-
0
- def errors_to_s
0
- errors.map do |e, m|
0
- "#{e.humanize unless e == "base"} #{m}\n"
0
- end.to_s.chomp
0
- end
0
-
0
-end
...
1
2
3
4
5
6
7
...
 
 
 
 
 
 
0
0
@@ -1,6 +0,0 @@
0
-class ActiveRecord::Errors
0
-
0
- def to_s
0
- full_messages.join("\n")
0
- end
0
-end
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
0
@@ -1,59 +0,0 @@
0
-
0
-
0
-
0
-module ActionView::Helpers::ActiveRecordHelper
0
-
0
-
0
-
0
- # Returns a string with a div containing all of the error messages for the object and method located as instance variables by the names
0
- # given. This method mimics the output of +error_messages_for+, and is meant to be used in leau of +error_message_on+.
0
- #
0
- # This div can be tailored by the following options:
0
- #
0
- # * <tt>id</tt> - The id of the error div (default: errorExplanation)
0
- # * <tt>class</tt> - The class of the error div (default: errorExplanation)
0
- # * <tt>method_name</tt> - The object name to use in the header, or
0
- # any text that you prefer. If <tt>method_name</tt> is not set, the name of
0
- # the method will be used.
0
- #
0
- # Specifying one object:
0
- #
0
- # error_messages_on 'user', 'login'
0
- #
0
- #
0
- # NOTE: This is a pre-packaged presentation of the errors with embedded strings and a certain HTML structure. If what
0
- # you need is significantly different from the default presentation, it makes plenty of sense to access the object.errors
0
- # instance yourself and set it up. View the source of this method to see how easy it is.
0
- def error_messages_on(object, method, options = {})
0
- html = {}
0
- options.stringify_keys!
0
- ['id', 'class'].each do |key|
0
- if options.include?(key)
0
- value = options[key]
0
- html[key] = value unless value.blank?
0
- else
0
- html[key] = 'errorExplanation'
0
- end
0
- end
0
- name = options['method_name'] ||= method.to_s.humanize.capitalize
0
- if (obj = instance_variable_get("@#{object}")) && (errors = obj.errors.on(method))
0
- [errors].flatten!
0
- content_tag(:div,
0
- content_tag(:ul, errors.map {|msg| content_tag(:li, "#{name} #{msg}") }),
0
- html
0
- )
0
- else
0
- ''
0
- end
0
- end
0
-
0
-
0
-
0
- def errors_to_s(errors)
0
- errors.map do |e, m|
0
- "#{e.humanize unless e == "base"} #{m}\n"
0
- end.to_s.chomp
0
- end
0
-
0
-
0
-end
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,72 +0,0 @@
0
-class Array
0
-
0
-
0
-
0
- def to_options(options = {})
0
- id = options[:id] || :id
0
- name = options[:name] || :name
0
- selected = options[:selected] || nil
0
- s = ''
0
- s << '<option></option>' if options[:include_blank]
0
- s << options[:extras] if options[:extras]
0
- each do |a|
0
- case a.class.to_s
0
- when 'Array'
0
- s << "<option value=\"#{a[1]}\"#{' selected="selected"' if a[1] == selected}>#{a[0]}</option>\n"
0
- when 'String'
0
- s << "<option value=\"#{a}\"#{' selected="selected"' if a == selected}>#{a}</option>\n"
0
- else
0
- if a.is_a? ActiveRecord::Base
0
- s << "<option value=\"#{a.send id}\"#{' selected="selected"' if a.send(id) == selected}>#{a.send(name)}</option>\n"
0
- else
0
- raise "Type not supported: #{a.class}"
0
- end
0
- end
0
- end
0
- s
0
- end
0
-
0
-
0
- def to_select(object, method, options = {})
0
- s = ''
0
- clas = options[:class] || ''
0
- options.symbolize_keys!
0
- options[:html].each_pair{|k,v| s << " #{k}=\"#{v}\""} if options[:html]
0
- <<-SEL
0
-<select name="#{object}[#{method}]" id="#{object}_#{method}"#{s} class="#{clas}">
0
- #{self.to_options(options)}
0
-</select>
0
-SEL
0
- end
0
-
0
-
0
- def to_csv
0
- s = ''
0
- self.each do |a|
0
- next unless a.is_a? Array
0
- s << a.map{|i| i.to_s.gsub(',', '')}.join(',') << "\n"
0
- end
0
- s
0
- end
0
-
0
-
0
-
0
- def rand
0
- self[Object.send('rand', size)]
0
- end
0
-
0
-
0
-
0
-
0
- def else_each zero, &proc
0
- if size > 0
0
- each &proc
0
- else
0
- zero.call
0
- end
0
- end
0
-
0
-
0
-
0
-
0
-end
...
1
2
3
4
5
6
7
8
9
10
...
 
 
 
 
 
 
 
 
 
0
0
@@ -1,9 +0,0 @@
0
-
0
-class BigDecimal
0
- def c(unit = '')
0
- number_to_currency(self, :unit=>unit)
0
- end
0
- def delim
0
- number_with_delimiter(self)
0
- end
0
-end
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,64 +0,0 @@
0
-class Date
0
- def d(format = '%m/%d/%y')
0
- self.strftime(format)
0
- end
0
-
0
-#duplication of rails' time calculation methods
0
- def months_since(months)
0
- year, month, mday = self.year, self.month, self.mday
0
-
0
- month += months
0
-
0
- # in case months is negative
0
- while month < 1
0
- month += 12
0
- year -= 1
0
- end
0
-
0
- # in case months is positive
0
- while month > 12
0
- month -= 12
0
- year += 1
0
- end
0
-
0
- max = ::Time.days_in_month(month, year)
0
- mday = max if mday > max
0
-
0
- change(:year => year, :month => month, :mday => mday)
0
- end
0
-
0
- def next_month
0
- months_since(1)
0
- end
0
-
0
- def last_month
0
- months_ago(1)
0
- end
0
-
0
- def months_ago(months)
0
- months_since(-months)
0
- end
0
-
0
- def change(options)
0
- Date.new(
0
- options[:year] || self.year,
0
- options[:month] || self.month,
0
- options[:mday] || self.mday
0
- )
0
- end
0
-#end duplication of rails' time calculation methods
0
-
0
-
0
-
0
- def last_week
0
- self - 7
0
- end
0
-
0
- def next_week
0
- self + 7
0
- end
0
-
0
- def to_formatted_date(format=nil)
0
- self
0
- end
0
-end
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,26 +0,0 @@
0
-module Less
0
- module Dates
0
- module Methods
0
- def self.included(base)
0
- base.extend ClassMethods
0
- end
0
-
0
- module ClassMethods
0
- def less_dates(*attr_names)
0
- validates_each(attr_names) do |record, attr_name, value|
0
- if value.nil?
0
- record.errors.add(attr_name, "is not a valid date")
0
- else
0
- converted_value = value.to_formatted_date(yield(record))
0
- if converted_value.nil?
0
- record.errors.add(attr_name, "is not a valid date")
0
- else
0
- record.attributes[attr_name.to_s] = converted_value
0
- end
0
- end
0
- end
0
- end
0
- end
0
- end
0
- end
0
-end
...
1
2
3
4
5
6
7
8
9
10
11
...
 
 
 
 
 
 
 
 
 
 
0
0
@@ -1,10 +0,0 @@
0
-class NilClass
0
-
0
- def each
0
- nil
0
- end
0
-
0
- def dup
0
- nil
0
- end
0
-end
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,39 +0,0 @@
0
-
0
-
0
-class Numeric
0
- def c(unit = '')
0
- number_to_currency(self, :unit=>unit)
0
- end
0
- def delim
0
- number_with_delimiter(self)
0
- end
0
-
0
-
0
- def to_clock
0
- ret = ''
0
- total = self.to_s.to_i #so we don't change self
0
- if total >= 1.hour
0
- num = (total / 1.hour.to_f).floor
0
- total -= num * 1.hour
0
- ret += num.to_s
0
- else
0
- ret = '00'
0
- end
0
- if total >= 1.minute
0
- num = (total / 1.minute.to_f).floor
0
- total -= num * 1.minute
0
- ret += ':' + num.to_s.rjust(2, '0')
0
- else
0
- ret += ':00'
0
- end
0
- if total < 1.minute
0
- num = total
0
- ret += ':' + num.to_s.rjust(2, '0')
0
- else
0
- ret += ':00'
0
- end
0
-
0
- ret
0
- end
0
-
0
-end
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,39 +0,0 @@
0
-class Object
0
-
0
-
0
-
0
- def in?(*args)
0
- collection = (args.length == 1 ? args.first : args)
0
- collection.include?(self)
0
- end
0
-
0
-
0
-
0
-
0
- def not_in?(*args)
0
- collection = (args.length == 1 ? args.first : args)
0
- !collection.include?(self)
0
- end
0
-
0
-
0
-
0
-
0
- def if_nil out = nil
0
- return out if nil?
0
- self
0
- end
0
-
0
- def if_method_nil method, out = nil
0
- return out if nil?
0
- return send(method) if out.nil?
0
- return out if respond_to?(method) && send(method).nil?
0
- send method
0
- end
0
-
0
-
0
-
0
- def valid_email?
0
- false
0
- end
0
-end
0
-
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,46 +0,0 @@
0
-class String
0
- def strip_xml
0
- self.gsub(/<(.*?)>/, '')
0
- end
0
-
0
- def strip_tag_and_contents tag
0
- self.gsub(/<style.*>.*?<\/style>/mi, '')
0
- end
0
-
0
- def to_safe_uri
0
- self.strip.downcase.gsub('&', 'and').gsub(' ', '-').gsub(/[^\w-]/,'')
0
- end
0
-
0
- def from_safe_uri
0
- self.gsub('-', ' ')
0
- end
0
-
0
- def add_param args = {}
0
- self.strip + (self.include?('?') ? '&' : '?') + args.map { |k,v| "#{k}=#{URI.escape(v.to_s)}" }.join('&')
0
- end
0
-
0
- def truncate len = 30
0
- return self if size <= len
0
- s = self[0, len - 3].strip
0
- s << '...'
0
- end
0
-
0
- def to_formatted_date(format=nil)
0
- begin
0
- converted_date_value = Date.strptime(self.gsub(/\D/, '-').gsub(/-\d\d(\d\d)$/,'-\1'), format.gsub(/[\.\/]/, '-'))
0
-
0
-      if converted_date_value.year < 1000
0
-        converted_date_value = Date.strptime(self.gsub(/\D/, '-'), format.gsub(/[\.\/]/, '-').gsub('%Y', '%y'))
0
- end
0
- rescue
0
- converted_date_value = Chronic.parse(self)
0
- converted_date_value = converted_date_value.to_date unless converted_date_value.blank?
0
- end
0
- return converted_date_value
0
- end
0
-
0
-
0
- def valid_email?
0
- !(self =~ /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i).nil?
0
- end
0
-end
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
0
@@ -1,24 +0,0 @@
0
-
0
-
0
-module ActionView::Helpers::TextHelper
0
-
0
- def truncate_words(text, nubmer_of_words = 30, truncate_string = "..." )
0
- return '' if text.blank?
0
- words = text.split
0
- words.length > nubmer_of_words ? close_open_html_tags(words[0...nubmer_of_words].join(" ") + truncate_string) : close_open_html_tags(text)
0
- end
0
-
0
- # If +html_text+ contains open html tags, they will be closed.
0
- #
0
- # close_open_html_tags("<p>Hello, world.")
0
- # => <p>Hello, world.</p>
0
- def close_open_html_tags(html_text)
0
- h1 = {}
0
- h2 = {}
0
- html_text.scan(/\<([^\>\s\/]+)[^\>\/]*?\>/).each { |t| h1[t[0]] ? h1[t[0]] += 1 : h1[t[0]] = 1 }
0
- html_text.scan(/\<\/([^\>\s\/]+)[^\>]*?\>/).each { |t| h2[t[0]] ? h2[t[0]] += 1 : h2[t[0]] = 1 }
0
- h1.each {|k,v| html_text += "</#{k}>" * (h1[k] - h2[k].to_i) if h2[k].to_i < v }
0
- return html_text
0
- end
0
-
0
-end
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
0
@@ -1,44 +0,0 @@
0
-class Exception
0
- alias :original_clean_backtrace :clean_backtrace
0
-
0
- def add_links_to_backtrace(lines)
0
-# logger.debug lines.to_s.red
0
- lines.collect do |line|
0
- expanded = line.gsub '#{RAILS_ROOT}', RAILS_ROOT
0
- if match = expanded.match(/^(.+):(\d+):in/) or match = expanded.match(/^(.+):(\d+)\s*$/)
0
- file = File.expand_path(match[1])
0
- line_number = match[2]
0
- html = "<a href='txmt://open?url=file://#{file}&line=#{line_number}'>#{line}</a>"
0
- else
0
- line
0
- end
0
- end
0
- end
0
-
0
- def clean_backtrace
0
- add_links_to_backtrace(original_clean_backtrace)
0
- end
0
-end
0
-
0
-module ActionView
0
- class TemplateError < ActionViewError
0
- def line_number_link
0
- file = File.expand_path(@file_path)
0
- "<a href='txmt://open?url=file://#{file}&line=#{line_number}'>#{line_number}</a>"
0
- end
0
- end
0
-end
0
-
0
-class ActionController::Base
0
-protected
0
- alias backtracer_original_template_path_for_local_rescue template_path_for_local_rescue
0
- def template_path_for_local_rescue(exception)
0
- if ActionView::TemplateError === exception
0
- File.dirname(__FILE__) + "/../templates/rescues/template_error.rhtml"
0
- else
0
- backtracer_original_template_path_for_local_rescue(exception)
0
- end
0
- end
0
-
0
-end
0
-
0
\ No newline at end of file