rails-footnotes 3.7.3 → 3.7.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,6 +26,7 @@ module Footnotes
26
26
 
27
27
  def self.run!
28
28
  require 'rails-footnotes/footnotes'
29
+ require 'rails-footnotes/backtracer'
29
30
  require 'rails-footnotes/abstract_note'
30
31
  require 'rails-footnotes/notes/all'
31
32
 
@@ -0,0 +1,32 @@
1
+ require 'rails/backtrace_cleaner'
2
+ class Rails::BacktraceCleaner
3
+ def replace_filter(index, &block)
4
+ @filters[index] = block
5
+ end
6
+
7
+ def clean(backtrace, kind = :silent)
8
+ safe = super.map {|l| l.html_safe}
9
+ def safe.join(*args)
10
+ (joined = super).html_safe
11
+ end
12
+ safe
13
+ end
14
+ end
15
+
16
+ backtrace_cleaner = Rails.backtrace_cleaner
17
+ backtrace_cleaner.replace_filter(0) do |line|
18
+ if match = line.match(/^(.+):(\d+):in/) || match = line.match(/^(.+):(\d+)\s*$/)
19
+ file, line_number = match[1], match[2]
20
+ %[<a href="#{Footnotes::Filter.prefix(file, line_number, 1).html_safe}">#{line.sub("#{Rails.root.to_s}/",'').html_safe}</a>].html_safe
21
+ else
22
+ line
23
+ end
24
+ end
25
+
26
+ gems_paths = (Gem.path + [Gem.default_dir]).uniq.map!{ |p| Regexp.escape(p) }
27
+ unless gems_paths.empty?
28
+ gems_regexp = %r{\>#{gems_paths.join('|')}/gems/}
29
+ backtrace_cleaner.replace_filter(3) {|line| line.sub(gems_regexp, '>') }
30
+ end
31
+ backtrace_cleaner.remove_silencers!
32
+ backtrace_cleaner.add_silencer { |line| line !~ /\>\/?(app|config|lib|test)/ }
@@ -1,3 +1,5 @@
1
+ require "rails-footnotes/notes/files_note"
2
+
1
3
  module Footnotes
2
4
  module Notes
3
5
  class JavascriptsNote < FilesNote
@@ -1,3 +1,5 @@
1
+ require 'rails-footnotes/notes/log_note'
2
+
1
3
  module Footnotes
2
4
  module Notes
3
5
  class PartialsNote < LogNote
@@ -1,3 +1,5 @@
1
+ require "rails-footnotes/notes/files_note"
2
+
1
3
  module Footnotes
2
4
  module Notes
3
5
  class StylesheetsNote < FilesNote
@@ -1,3 +1,3 @@
1
1
  module Footnotes
2
- VERSION = "3.7.3"
2
+ VERSION = "3.7.4"
3
3
  end
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+ require "rails-footnotes/notes/javascripts_note"
3
+
4
+ describe Footnotes::Notes::JavascriptsNote do
5
+ pending
6
+ end
@@ -0,0 +1,6 @@
1
+ require "spec_helper"
2
+ require "rails-footnotes/notes/partials_note"
3
+
4
+ describe Footnotes::Notes::PartialsNote do
5
+ pending
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+ require "rails-footnotes/notes/stylesheets_note"
3
+
4
+ describe Footnotes::Notes::StylesheetsNote do
5
+ pending
6
+ end
data/spec/spec_helper.rb CHANGED
@@ -11,5 +11,9 @@ require 'rails-footnotes/footnotes'
11
11
  require 'rails-footnotes/abstract_note'
12
12
  require "rails-footnotes"
13
13
 
14
+ class Rails
15
+ def self.logger; end
16
+ end
17
+
14
18
  RSpec.configure do |config|
15
19
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rails-footnotes
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 3.7.3
5
+ version: 3.7.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Keenan Brock
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-18 00:00:00 Z
13
+ date: 2011-05-26 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -77,6 +77,7 @@ files:
77
77
  - Rakefile
78
78
  - lib/rails-footnotes.rb
79
79
  - lib/rails-footnotes/abstract_note.rb
80
+ - lib/rails-footnotes/backtracer.rb
80
81
  - lib/rails-footnotes/footnotes.rb
81
82
  - lib/rails-footnotes/notes/all.rb
82
83
  - lib/rails-footnotes/notes/assigns_note.rb
@@ -100,6 +101,9 @@ files:
100
101
  - rails-footnotes.gemspec
101
102
  - spec/abstract_note_spec.rb
102
103
  - spec/footnotes_spec.rb
104
+ - spec/notes/javascripts_note_spec.rb
105
+ - spec/notes/partials_notes_spec.rb
106
+ - spec/notes/stylesheets_note_spec.rb
103
107
  - spec/spec_helper.rb
104
108
  homepage: http://github.com/josevalim/rails-footnotes
105
109
  licenses: []
@@ -131,4 +135,7 @@ summary: Every Rails page has footnotes that gives information about your applic
131
135
  test_files:
132
136
  - spec/abstract_note_spec.rb
133
137
  - spec/footnotes_spec.rb
138
+ - spec/notes/javascripts_note_spec.rb
139
+ - spec/notes/partials_notes_spec.rb
140
+ - spec/notes/stylesheets_note_spec.rb
134
141
  - spec/spec_helper.rb