muck-engine 0.1.27 → 0.1.28

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.27
1
+ 0.1.28
@@ -82,7 +82,13 @@ module MuckEngineHelper
82
82
  def locale_link(name, locale)
83
83
  #link_to name, request.protocol + locale + '.' + request.domain + request.request_uri
84
84
  #link_to name, request.url.gsub(request.protocol, "#{request.protocol}#{locale}.")
85
- link_to name, request.url.sub(request.protocol, "#{request.protocol}#{locale}.").sub('www.','')
85
+ #link_to name, request.url.sub(request.protocol, "#{request.protocol}#{locale}.").sub('www.','')
86
+ if request.domain.count('.') == 1
87
+ new_domain = request.url.sub(protocol, "#{protocol}#{locale}.")
88
+ else
89
+ new_domain = request.url.sub(Regexp.new(protocol + "[^\.]+."), "#{protocol}#{locale}.")
90
+ end
91
+ link_to name, new_domain
86
92
  end
87
93
 
88
94
  # Generate parameters for a url that refer to a given object as parent. Useful
data/muck-engine.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{muck-engine}
8
- s.version = "0.1.27"
8
+ s.version = "0.1.28"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin Ball"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muck-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.27
4
+ version: 0.1.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Ball