canonical-rails 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,13 +8,17 @@ module CanonicalRails
8
8
  def trailing_slash_if_needed
9
9
  "/" if trailing_slash_needed? and request.path != '/'
10
10
  end
11
+
12
+ def path_without_html_extension
13
+ request.path.sub(/\.html$/, '')
14
+ end
11
15
 
12
16
  def canonical_host
13
17
  CanonicalRails.host || request.host
14
18
  end
15
19
 
16
20
  def canonical_href
17
- "#{request.protocol}#{canonical_host}#{request.path}#{trailing_slash_if_needed}#{whitelisted_query_string}"
21
+ "#{request.protocol}#{canonical_host}#{path_without_html_extension}#{trailing_slash_if_needed}#{whitelisted_query_string}"
18
22
  end
19
23
 
20
24
  def canonical_tag
@@ -1,3 +1,3 @@
1
1
  module CanonicalRails
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canonical-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-02 00:00:00.000000000 Z
12
+ date: 2013-02-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -72,8 +72,8 @@ files:
72
72
  - config/routes.rb
73
73
  - lib/canonical-rails/version.rb
74
74
  - lib/canonical-rails/engine.rb
75
- - lib/tasks/canonical-rails_tasks.rake
76
75
  - lib/canonical-rails.rb
76
+ - lib/tasks/canonical-rails_tasks.rake
77
77
  - lib/generators/canonical_rails/install/install_generator.rb
78
78
  - lib/generators/canonical_rails/install/templates/canonical_rails.rb
79
79
  - MIT-LICENSE