rails-footnotes 4.1.3 → 4.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30f78c7266a4f4e1ec31ead76bdfa0df95f83759
4
- data.tar.gz: 87c90a35321e12cb18fcc551450038d2e2c83de2
3
+ metadata.gz: 803d3d85a6d449ddde04bfe4d17245c7dfb7a2e5
4
+ data.tar.gz: 40c0a64bf8f12a66a2354c13d887d72e5299e6ec
5
5
  SHA512:
6
- metadata.gz: 676ba9d1a928b9abc18a5eba12d3fd58aba70793120659944b39e3fc10db6cb88749a8b0e2eb85d10c736c5b8ccdb646ebae26d844b1e9c77627d35d39ae377c
7
- data.tar.gz: 8d88e8d16638d10a8610adcd5e40d3e647664be877cbc0745da8f9b752a330d1ef1e39b62453d175a452e346d355fb765f316accb074948c04d45e898e3ab268
6
+ metadata.gz: d12c0a1fbf3126730c738ecd3da4cc4051c8af71c6da82b78523d55f7ddab3680e80ec54dc48a62b8642cf1322e16b575543e7210929f23dfc69623a4c871027
7
+ data.tar.gz: 6e791ef289186ce48faaa7f4d4c821c2dbb0f766ae1cfb12862cc04d0f38cd9c82cd00b949ee92db0f0ed39d4c9e725edadf5b13d35fc0134430b0ab00694adb
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ == Footnotes v4.1.4 ==
2
+ * Allow to click on links if filenames contain special chars
1
3
  == Footnotes v4.1.3 ==
2
4
  * Improve fix done in 4.1.2 that broke support with rails 3 (thanks kirikiriyamama)
3
5
  == Footnotes v4.1.2 ==
@@ -47,6 +47,8 @@ module Footnotes
47
47
  if args.empty?
48
48
  @@prefix
49
49
  else
50
+ args.map! { |arg| URI.escape(arg.to_s) }
51
+
50
52
  if @@prefix.respond_to? :call
51
53
  @@prefix.call *args
52
54
  else
@@ -1,3 +1,3 @@
1
1
  module Footnotes
2
- VERSION = "4.1.3"
2
+ VERSION = "4.1.4"
3
3
  end
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require "spec_helper"
2
4
  require 'action_controller'
3
5
  require 'action_controller/test_case'
@@ -16,6 +18,12 @@ module Footnotes::Notes
16
18
  class NoteXNote < TestNote; end
17
19
  class NoteYNote < TestNote; end
18
20
  class NoteZNote < TestNote; end
21
+
22
+ class FileURINote < TestNote
23
+ def link
24
+ "/example/local file path/with-special-chars/öäü/file"
25
+ end
26
+ end
19
27
  end
20
28
 
21
29
  describe "Footnotes" do
@@ -61,6 +69,12 @@ describe "Footnotes" do
61
69
  @controller.response_body.should_not == HTML_DOCUMENT
62
70
  end
63
71
 
72
+ it "should escape links with special chars" do
73
+ note_with_link = Footnotes::Notes::FileURINote.new
74
+ link = Footnotes::Filter.prefix(note_with_link.link, 1, 1, 1)
75
+ link.should eql "txmt://open?url=file:///example/local%20file%20path/with-special-chars/%C3%B6%C3%A4%C3%BC/file&amp;line=1&amp;column=1"
76
+ end
77
+
64
78
  specify "footnotes_not_included_when_request_is_xhr" do
65
79
  @controller.request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'
66
80
  @controller.request.env['HTTP_ACCEPT'] = 'text/javascript, text/html, application/xml, text/xml, */*'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-footnotes
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.3
4
+ version: 4.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman V. Babenko
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-11-06 00:00:00.000000000 Z
15
+ date: 2014-11-07 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rails