geo_locale 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 2810f63b7da90f39c9449254810fc4a53c89185c
4
- data.tar.gz: c89638f968f4ec925c6b6e9263e1b8600164c839
3
+ metadata.gz: 6e0767be5acbb167c117d6961f8303e5c0a1cdb2
4
+ data.tar.gz: 509a7a2923e39c2e1eb74c0bfefc0b0adfbeaf02
5
5
  SHA512:
6
- metadata.gz: 3de8168f9d7121b3eaa847246a53095687edb278a1212620c5de2941097184aedbc06a1d680b9dfc8104ffdfc2b114d47fe53d4218d23e4e0ad28587d48e934b
7
- data.tar.gz: 3eec2c6def2b37bc874d77255cf95ea6db5a05fd905b33d563c75a7a293e594de6ea104905772309570a8643200d327d38bc4d9053eb51eedee6a9eeb607e360
6
+ metadata.gz: 80245a9cda71f8dd2eebffc8dccb238182bcb432c3be3da5602b346b9dbe1b007bed5d08bbad75f76724efbe71d5b4a57df2e526325ad5ca3d8ef8cae047044e
7
+ data.tar.gz: 660301084ed8d3d4494263abf54ac6629264b1bfa0699da5ba5022c48f613cede567e1ec3117fe689928099a1b9a430c83a30cf2f85b5c0e632812c5e09d1f1c
data/README.md CHANGED
@@ -26,22 +26,25 @@ Configure default locales
26
26
  # in /config/initializers/geo_locale.rb
27
27
  GeoLocale.configure do |config|
28
28
  config.default_country = "de" # set to nil or false if you want to catch fails in geolocation
29
- config.default_locale = "en" # country->locale conversion is minimal for now, set this explicitly to ensure GeoLocale.locale
29
+ config.default_locale = "en" # country->locale conversion is minimal for now, set this explicitly to ensure GeoLocale.locale returns useful value
30
30
  config.default_lcid = "en-us"
31
31
  config.overrides["ee"] = "en" # hash used to override standard country codes
32
32
  end
33
33
  ```
34
34
 
35
35
  To get country code:
36
- GeoLocale.country_code(ip: "")
36
+
37
+ def self.country_code (ip: "")
38
+
37
39
  Use in controller like so:
38
40
  ```ruby
39
- GeoLocale.country_code(request.remote_ip)
41
+ GeoLocale.country_code(ip: request.remote_ip)
40
42
  => "en"
41
43
  ```
42
44
 
43
45
  To get locale:
44
- GeoLocale.locale(country_code: "", ip: "", lcid: false)
46
+
47
+ def self.locale (ip: "", country_code: "", lcid: false)
45
48
  ```ruby
46
49
  GeoLocale.locale(country_code: "gb")
47
50
  => "en"
@@ -60,6 +63,8 @@ GeoLocale.locale(ip: "97.77.25.20", country_code: "lv")
60
63
 
61
64
  ## Contributing
62
65
 
66
+ Main priority is extending the country_code => locale hash in lib/geo_locale/locale.rb
67
+
63
68
  1. Fork it ( https://github.com/Epigene/geo_locale/fork )
64
69
  2. Create your feature branch (`git checkout -b my-new-feature`)
65
70
  3. Commit your changes (`git commit -am 'Add some feature'`)
@@ -1,3 +1,3 @@
1
1
  module GeoLocale
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geo_locale
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Epigene