simple-navigation 3.3.2 → 3.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ *3.3.3
2
+
3
+ * Bugfix in Adapters::Sinatra#current_url? (compares unencoded URIs). Thanks to Matthew Gast.
4
+
1
5
  *3.3.2
2
6
 
3
7
  * The patch listed in 3.3.1 somehow did not make it into the gem... sorry. Re-releasing...
data/Rakefile CHANGED
@@ -38,7 +38,7 @@ begin
38
38
  gemspec.description = "With the simple-navigation gem installed you can easily create multilevel navigations for your Rails, Sinatra or Padrino applications. The navigation is defined in a single configuration file. It supports automatic as well as explicit highlighting of the currently active navigation through regular expressions."
39
39
  gemspec.add_development_dependency('rspec', '>= 2.0.1')
40
40
  gemspec.add_dependency('activesupport', '>= 2.3.2')
41
- gemspec.authors = ["Andi Schacke"]
41
+ gemspec.authors = ["Andi Schacke", "Mark J. Titorenko"]
42
42
  gemspec.rdoc_options = ["--inline-source", "--charset=UTF-8"]
43
43
  gemspec.files = FileList["[A-Z]*", "{lib,spec,rails,generators}/**/*"] - FileList["**/*.log"]
44
44
  gemspec.rubyforge_project = 'andi'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.2
1
+ 3.3.3
@@ -34,6 +34,7 @@ module SimpleNavigation
34
34
  else
35
35
  uri = request_uri.split('?').first
36
36
  end
37
+ uri = CGI.unescape(uri)
37
38
  if url_string =~ /^\w+:\/\//
38
39
  url_string == "#{request.scheme}://#{request.host_with_port}#{uri}"
39
40
  else
@@ -35,15 +35,34 @@ describe SimpleNavigation::Adapters::Sinatra do
35
35
  before(:each) do
36
36
  @request.stub!(:scheme => 'http', :host_with_port => 'my_host:5000')
37
37
  end
38
- it {@adapter.current_page?('/full?param=true').should be_true}
39
- it {@adapter.current_page?('/full?param3=true').should be_false}
40
- it {@adapter.current_page?('/full').should be_true}
41
- it {@adapter.current_page?('http://my_host:5000/full?param=true').should be_true}
42
- it {@adapter.current_page?('http://my_host:5000/full?param3=true').should be_false}
43
- it {@adapter.current_page?('http://my_host:5000/full').should be_true}
44
- it {@adapter.current_page?('https://my_host:5000/full').should be_false}
45
- it {@adapter.current_page?('http://my_host:6000/full').should be_false}
46
- it {@adapter.current_page?('http://my_other_host:5000/full').should be_false}
38
+
39
+ describe 'when URL is not encoded' do
40
+ it {@adapter.current_page?('/full?param=true').should be_true}
41
+ it {@adapter.current_page?('/full?param3=true').should be_false}
42
+ it {@adapter.current_page?('/full').should be_true}
43
+ it {@adapter.current_page?('http://my_host:5000/full?param=true').should be_true}
44
+ it {@adapter.current_page?('http://my_host:5000/full?param3=true').should be_false}
45
+ it {@adapter.current_page?('http://my_host:5000/full').should be_true}
46
+ it {@adapter.current_page?('https://my_host:5000/full').should be_false}
47
+ it {@adapter.current_page?('http://my_host:6000/full').should be_false}
48
+ it {@adapter.current_page?('http://my_other_host:5000/full').should be_false}
49
+ end
50
+
51
+ describe 'when URL is encoded' do
52
+ before(:each) do
53
+ @request.stub!(:fullpath => '/full%20with%20spaces?param=true', :path => '/full%20with%20spaces')
54
+ end
55
+
56
+ it {@adapter.current_page?('/full%20with%20spaces?param=true').should be_true}
57
+ it {@adapter.current_page?('/full%20with%20spaces?param3=true').should be_false}
58
+ it {@adapter.current_page?('/full%20with%20spaces').should be_true}
59
+ it {@adapter.current_page?('http://my_host:5000/full%20with%20spaces?param=true').should be_true}
60
+ it {@adapter.current_page?('http://my_host:5000/full%20with%20spaces?param3=true').should be_false}
61
+ it {@adapter.current_page?('http://my_host:5000/full%20with%20spaces').should be_true}
62
+ it {@adapter.current_page?('https://my_host:5000/full%20with%20spaces').should be_false}
63
+ it {@adapter.current_page?('http://my_host:6000/full%20with%20spaces').should be_false}
64
+ it {@adapter.current_page?('http://my_other_host:5000/full%20with%20spaces').should be_false}
65
+ end
47
66
  end
48
67
 
49
68
  describe 'link_to' do
metadata CHANGED
@@ -2,15 +2,16 @@
2
2
  name: simple-navigation
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 3.3.2
5
+ version: 3.3.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Andi Schacke
9
+ - Mark J. Titorenko
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
13
 
13
- date: 2011-06-20 00:00:00 Z
14
+ date: 2011-06-29 00:00:00 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: rspec