preciousss 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,6 +9,8 @@ View Helpers
9
9
  errors_for
10
10
  flash_messages
11
11
  is_bot?
12
+ bot_id
13
+ years_range
12
14
 
13
15
  Validators
14
16
  ----------
@@ -58,6 +58,28 @@ module Preciousss
58
58
  end
59
59
  end
60
60
 
61
+ private ########################################################################################################
62
+
63
+ # Get locale from top-level domain or return nil if such locale is not available
64
+ # You have to put something like:
65
+ # 127.0.0.1 application.com
66
+ # 127.0.0.1 application.it
67
+ # 127.0.0.1 application.pl
68
+ # in your /etc/hosts file to try this out locally
69
+ def extract_locale_from_tld
70
+ locale = request.host.split('.').last
71
+ !locale.blank? && I18n.available_locales.include?(locale.to_sym) ? locale : nil
72
+ end
73
+
74
+ # Get locale code from request subdomain (like http://it.application.local:3000)
75
+ # You have to put something like:
76
+ # 127.0.0.1 gr.application.local
77
+ # in your /etc/hosts file to try this out locally
78
+ def extract_locale_from_subdomain
79
+ locale = request.subdomains.first
80
+ !locale.blank? && I18n.available_locales.include?(locale.to_sym) ? locale : nil
81
+ end
82
+
61
83
  end
62
84
 
63
85
  end
@@ -1,3 +1,3 @@
1
1
  module Preciousss
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: preciousss
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 9
10
- version: 0.0.9
9
+ - 10
10
+ version: 0.0.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - sodercober
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-23 00:00:00 +00:00
18
+ date: 2011-03-30 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies: []
21
21