canonical-rails 0.2.4 → 0.2.5

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
  SHA256:
3
- metadata.gz: f0d9ef773da11596654f1a0c5417e77410bcbac6594dc1adccb544edef085d66
4
- data.tar.gz: f900d781c65c89cab82b65885ab0b07bcc7bab959929d2b91508ed5295579c4e
3
+ metadata.gz: 0dec5645d51ed0ad35587260417f914f20d4ec3b4a10a082e29aa6a824b5f4a6
4
+ data.tar.gz: 1d6bf6bd72105ab1790b1afb4383b27048f49aae8efaab50f5ef2fa4c07ef90e
5
5
  SHA512:
6
- metadata.gz: 78ab25beac66412f2437f19aa34309e0374a1d115ccfffb7b0d1dffb42cc9a9a73f5cc7f3d44a35ae1ce62ca989197bafec3f1f11590a7ef7dd0b27b46141b7a
7
- data.tar.gz: d360b87780f9e2c663a18a553961b658f3defade38f7c4724c6b1c838bec7e9d9c91680030eae8016cd87145814d8a495a2cdda60b85cb3f1f521b89a8b48a1d
6
+ metadata.gz: 33a696b21575481f8c2a1d8303200f9ab576605f02c7fa65ef43a02febce9937b0843a2c6b5fcb20ddc9a19f17e63784462aabd9805c12d883d489dd7eb52b38
7
+ data.tar.gz: 96884877d1a604b141d492477ab3bca7feb78c934961c6d03f10a4f31742aa271c9b9832893cb742edfd0ec5552d6fae8a5e3eecb243822646f89edde8b91740
@@ -5,10 +5,12 @@ module CanonicalRails
5
5
  end
6
6
 
7
7
  def trailing_slash_if_needed
8
- "/" if trailing_slash_needed? && request.path != '/'
8
+ "/" if trailing_slash_needed?
9
9
  end
10
10
 
11
11
  def path_without_html_extension
12
+ return '' if request.path == '/'
13
+
12
14
  request.path.sub(/\.html$/, '')
13
15
  end
14
16
 
@@ -29,7 +31,7 @@ module CanonicalRails
29
31
  port = port.present? && port.to_i != default_ports[canonical_protocol] ? ":#{port}" : ''
30
32
  raw "#{canonical_protocol}#{host}#{port}#{path_without_html_extension}#{trailing_slash_if_needed}#{whitelisted_query_string}".downcase
31
33
  end
32
-
34
+
33
35
  def canonical_path
34
36
  raw "#{path_without_html_extension}#{trailing_slash_if_needed}#{whitelisted_query_string}"
35
37
  end
@@ -1,3 +1,3 @@
1
1
  module CanonicalRails
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canonical-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Ivanov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-07 00:00:00.000000000 Z
11
+ date: 2019-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '4.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5.3'
22
+ version: '6.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '4.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.3'
32
+ version: '6.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: appraisal
35
35
  requirement: !ruby/object:Gem::Requirement