cloudflare_localizable 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7d39c3be36591f5cf59b7bd0ec5744f4313b9cd4
4
+ data.tar.gz: 2b2dcc0c64c7c359a6f7f71e4211a160f80ff51c
5
+ SHA512:
6
+ metadata.gz: 7a8d7405719b275221a2e765c737f6df9b90390f9bf3cfecf331619834baf507a265a19bb16623ea3975cffc62e24032cb3a790905254391b30316be1c278b01
7
+ data.tar.gz: 911068764308d62232e42925a6d465fef537f9a91041030f69f0fc414ee4b6f19b5d5226d42903ddc6ebc2e3ff8237e73a7db02bba319911ce5e28b10788a906
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ *.gem
2
+ /.bundle/
3
+ /.yardoc
4
+ /Gemfile.lock
5
+ /_yardoc/
6
+ /coverage/
7
+ /doc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.3
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.2.2
6
+ - 2.2.3
7
+ before_install: gem install bundler -v 1.10.6
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cloudflare_localizable.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Ricardo Otero
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,75 @@
1
+ [![Build Status](https://travis-ci.org/rikas/cloudflare_localizable.svg?branch=master)](https://travis-ci.org/rikas/cloudflare_localizable)
2
+
3
+ # CloudFlareLocalizable
4
+
5
+ If you're using [CloudFlare](https://www.cloudflare.com/) you can easily get the country
6
+ of users requesting your pages. This is a very basic gem to help you get the country information in
7
+ your Rails applications when you're using CloudFlare services.
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'cloudflare_localizable'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install cloudflare_localizable
24
+
25
+ ## Usage
26
+
27
+ You should include `CloudFlareLocalizable` in any Rails controller that needs country information.
28
+ You get a helper method called `cf_country` to be used whenever you need to know the country of the
29
+ user.
30
+
31
+ ```ruby
32
+ class ExampleController < ApplicationController
33
+ include CloudFlareLocalizable
34
+
35
+ def index
36
+ cf_country.code # => "BB"
37
+ cf_country.name # => "Barbados"
38
+ end
39
+ end
40
+ ```
41
+
42
+ Because it is a helper method you can use it in the views if you want.
43
+
44
+ ```html
45
+ <ul>
46
+ <li>Code: <%= cf_country.code %></li>
47
+ <li>Name: <%= cf_country.name %></li>
48
+ </ul>
49
+ ```
50
+
51
+ ### What happens if we can't get the country information?
52
+
53
+ If something goes wrong, or the client is trying to spoof an unknown location, or CloufFlare can't
54
+ get the country information for a given IP address then you get code `XX` and name `Unknown`.
55
+
56
+ ## Development
57
+
58
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run
59
+ the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
60
+
61
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new
62
+ version, update the version number in `version.rb`, and then run `bundle exec rake release`, which
63
+ will create a git tag for the version, push git commits and tags, and push the `.gem` file to
64
+ [rubygems.org](https://rubygems.org).
65
+
66
+ ## Contributing
67
+
68
+ Bug reports and pull requests are welcome on GitHub at
69
+ https://github.com/rikas/cloudflare_localizable.
70
+
71
+
72
+ ## License
73
+
74
+ The gem is available as open source under the terms of the
75
+ [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/bin/console ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'cloudflare_localizable'
5
+
6
+ require 'irb'
7
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ require 'cloudflare_localizable/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'cloudflare_localizable'
9
+ spec.version = CloudFlareLocalizable::VERSION
10
+ spec.authors = ['Ricardo Otero']
11
+ spec.email = ['oterosantos@gmail.com']
12
+
13
+ spec.summary = 'Localize your requests with CloudFlare.'
14
+ spec.description = "If you're using CloudFlare you can easily get the location of your requests
15
+ based on a special header that CloudFlare attaches to every request."
16
+ spec.homepage = 'https://github.com/rikas/cloudflare_localizable'
17
+ spec.license = 'MIT'
18
+
19
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
20
+ spec.bindir = 'exe'
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ['lib']
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.10'
25
+ spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rspec', '~> 3.4', '>= 3.4.0'
27
+ spec.add_development_dependency 'actionpack', '~> 4.2', '>= 4.2.5'
28
+ end
@@ -0,0 +1,29 @@
1
+ require 'cloudflare_localizable/version'
2
+ require 'cloudflare_localizable/country'
3
+
4
+ # This module can be included in any Rails controller that needs country
5
+ # information. You get a helper method called cf_country to be used whenever you
6
+ # need to know the country of the user.
7
+ #
8
+ # === Example
9
+ #
10
+ # class ExampleController < ApplicationController
11
+ # include CloudFlareLocalizable
12
+ #
13
+ # def index
14
+ # cf_country.code # => "BB"
15
+ # cf_country.name # => "Barbados"
16
+ # end
17
+ # end
18
+ module CloudFlareLocalizable
19
+ CF_HEADER = 'HTTP_CF_IPCOUNTRY'.freeze
20
+
21
+ def self.included(base)
22
+ base.send(:helper_method, :cf_country)
23
+ end
24
+
25
+ # Returns the real name of the country, based on the country code.
26
+ def cf_country
27
+ @_cf_country ||= Country.find(request.headers[CF_HEADER] || 'XX')
28
+ end
29
+ end
@@ -0,0 +1,18 @@
1
+ require 'cloudflare_localizable/country_list'
2
+
3
+ module CloudFlareLocalizable
4
+ class Country
5
+ attr_accessor :name, :code
6
+
7
+ def self.find(code)
8
+ record = CF_COUNTRIES.find { |country| country[:code] == code }
9
+
10
+ new(record[:code], record[:name])
11
+ end
12
+
13
+ def initialize(code, name)
14
+ self.code = code
15
+ self.name = name
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,256 @@
1
+ # coding: utf-8
2
+ module CloudFlareLocalizable
3
+ # Countries
4
+ CF_COUNTRIES = [
5
+ { code: 'AD', name: 'Andorra' },
6
+ { code: 'AE', name: 'United Arab Emirates' },
7
+ { code: 'AF', name: 'Afghanistan' },
8
+ { code: 'AG', name: 'Antigua and Barbuda' },
9
+ { code: 'AI', name: 'Anguilla' },
10
+ { code: 'AL', name: 'Albania' },
11
+ { code: 'AM', name: 'Armenia' },
12
+ { code: 'AO', name: 'Angola' },
13
+ { code: 'AQ', name: 'Antarctica' },
14
+ { code: 'AR', name: 'Argentina' },
15
+ { code: 'AS', name: 'American Samoa' },
16
+ { code: 'AT', name: 'Austria' },
17
+ { code: 'AU', name: 'Australia' },
18
+ { code: 'AW', name: 'Aruba' },
19
+ { code: 'AX', name: 'Aland Islands' },
20
+ { code: 'AZ', name: 'Azerbaijan' },
21
+ { code: 'BA', name: 'Bosnia and Herzegovina' },
22
+ { code: 'BB', name: 'Barbados' },
23
+ { code: 'BD', name: 'Bangladesh' },
24
+ { code: 'BE', name: 'Belgium' },
25
+ { code: 'BF', name: 'Burkina Faso' },
26
+ { code: 'BG', name: 'Bulgaria' },
27
+ { code: 'BH', name: 'Bahrain' },
28
+ { code: 'BI', name: 'Burundi' },
29
+ { code: 'BJ', name: 'Benin' },
30
+ { code: 'BL', name: 'Saint Barthélemy' },
31
+ { code: 'BM', name: 'Bermuda' },
32
+ { code: 'BN', name: 'Brunei' },
33
+ { code: 'BO', name: 'Bolivia' },
34
+ { code: 'BQ', name: 'Caribbean Netherlands' },
35
+ { code: 'BR', name: 'Brazil' },
36
+ { code: 'BS', name: 'The Bahamas' },
37
+ { code: 'BT', name: 'Bhutan' },
38
+ { code: 'BV', name: 'Bouvet Island' },
39
+ { code: 'BW', name: 'Botswana' },
40
+ { code: 'BY', name: 'Belarus' },
41
+ { code: 'BZ', name: 'Belize' },
42
+ { code: 'CA', name: 'Canada' },
43
+ { code: 'CC', name: 'Cocos (Keeling) Islands' },
44
+ { code: 'CD', name: 'Democratic Republic of the Congo' },
45
+ { code: 'CF', name: 'Central African Republic' },
46
+ { code: 'CG', name: 'Republic of the Congo' },
47
+ { code: 'CH', name: 'Switzerland' },
48
+ { code: 'CI', name: "Cote d'Ivoire" },
49
+ { code: 'CK', name: 'Cook Islands' },
50
+ { code: 'CL', name: 'Chile' },
51
+ { code: 'CM', name: 'Cameroon' },
52
+ { code: 'CN', name: 'China' },
53
+ { code: 'CO', name: 'Colombia' },
54
+ { code: 'CR', name: 'Costa Rica' },
55
+ { code: 'CU', name: 'Cuba' },
56
+ { code: 'CV', name: 'Cape Verde' },
57
+ { code: 'CW', name: 'Curaçao' },
58
+ { code: 'CX', name: 'Christmas Island' },
59
+ { code: 'CY', name: 'Cyprus' },
60
+ { code: 'CZ', name: 'Czech Republic' },
61
+ { code: 'DE', name: 'Germany' },
62
+ { code: 'DJ', name: 'Djibouti' },
63
+ { code: 'DK', name: 'Denmark' },
64
+ { code: 'DM', name: 'Dominica' },
65
+ { code: 'DO', name: 'Dominican Republic' },
66
+ { code: 'DZ', name: 'Algeria' },
67
+ { code: 'EC', name: 'Ecuador' },
68
+ { code: 'EE', name: 'Estonia' },
69
+ { code: 'EG', name: 'Egypt' },
70
+ { code: 'EH', name: 'Western Sahara' },
71
+ { code: 'ER', name: 'Eritrea' },
72
+ { code: 'ES', name: 'Spain' },
73
+ { code: 'ET', name: 'Ethiopia' },
74
+ { code: 'FI', name: 'Finland' },
75
+ { code: 'FJ', name: 'Fiji' },
76
+ { code: 'FK', name: 'Falkland Islands' },
77
+ { code: 'FM', name: 'Federated States of Micronesia' },
78
+ { code: 'FO', name: 'Faroe Islands' },
79
+ { code: 'FR', name: 'France' },
80
+ { code: 'GA', name: 'Gabon' },
81
+ { code: 'GB', name: 'United Kingdom' },
82
+ { code: 'GD', name: 'Grenada' },
83
+ { code: 'GE', name: 'Georgia' },
84
+ { code: 'GF', name: 'French Guiana' },
85
+ { code: 'GG', name: 'Guernsey' },
86
+ { code: 'GH', name: 'Ghana' },
87
+ { code: 'GI', name: 'Gibraltar' },
88
+ { code: 'GL', name: 'Greenland' },
89
+ { code: 'GM', name: 'The Gambia' },
90
+ { code: 'GN', name: 'Guinea' },
91
+ { code: 'GP', name: 'Guadeloupe' },
92
+ { code: 'GQ', name: 'Equatorial Guinea' },
93
+ { code: 'GR', name: 'Greece' },
94
+ { code: 'GS', name: 'South Georgia and the South Sandwich Islands' },
95
+ { code: 'GT', name: 'Guatemala' },
96
+ { code: 'GU', name: 'Guam' },
97
+ { code: 'GW', name: 'Guinea-Bissau' },
98
+ { code: 'GY', name: 'Guyana' },
99
+ { code: 'HK', name: 'Hong Kong' },
100
+ { code: 'HM', name: 'Heard Island and McDonald Islands' },
101
+ { code: 'HN', name: 'Honduras' },
102
+ { code: 'HR', name: 'Croatia' },
103
+ { code: 'HT', name: 'Haiti' },
104
+ { code: 'HU', name: 'Hungary' },
105
+ { code: 'ID', name: 'Indonesia' },
106
+ { code: 'IE', name: 'Republic of Ireland' },
107
+ { code: 'IL', name: 'Israel' },
108
+ { code: 'IM', name: 'Isle of Man' },
109
+ { code: 'IN', name: 'India' },
110
+ { code: 'IO', name: 'British Indian Ocean Territory' },
111
+ { code: 'IQ', name: 'Iraq' },
112
+ { code: 'IR', name: 'Iran' },
113
+ { code: 'IS', name: 'Iceland' },
114
+ { code: 'IT', name: 'Italy' },
115
+ { code: 'JE', name: 'Jersey' },
116
+ { code: 'JM', name: 'Jamaica' },
117
+ { code: 'JO', name: 'Jordan' },
118
+ { code: 'JP', name: 'Japan' },
119
+ { code: 'KE', name: 'Kenya' },
120
+ { code: 'KG', name: 'Kyrgyzstan' },
121
+ { code: 'KH', name: 'Cambodia' },
122
+ { code: 'KI', name: 'Kiribati' },
123
+ { code: 'KM', name: 'Comoros' },
124
+ { code: 'KN', name: 'Saint Kitts and Nevis' },
125
+ { code: 'KP', name: 'North Korea' },
126
+ { code: 'KR', name: 'South Korea' },
127
+ { code: 'KW', name: 'Kuwait' },
128
+ { code: 'KY', name: 'Cayman Islands' },
129
+ { code: 'KZ', name: 'Kazakhstan' },
130
+ { code: 'LA', name: 'Laos' },
131
+ { code: 'LB', name: 'Lebanon' },
132
+ { code: 'LC', name: 'Saint Lucia' },
133
+ { code: 'LI', name: 'Liechtenstein' },
134
+ { code: 'LK', name: 'Sri Lanka' },
135
+ { code: 'LR', name: 'Liberia' },
136
+ { code: 'LS', name: 'Lesotho' },
137
+ { code: 'LT', name: 'Lithuania' },
138
+ { code: 'LU', name: 'Luxembourg' },
139
+ { code: 'LV', name: 'Latvia' },
140
+ { code: 'LY', name: 'Libya' },
141
+ { code: 'MA', name: 'Morocco' },
142
+ { code: 'MC', name: 'Monaco' },
143
+ { code: 'MD', name: 'Moldova' },
144
+ { code: 'ME', name: 'Montenegro' },
145
+ { code: 'MF', name: 'Collectivity of Saint Martin' },
146
+ { code: 'MG', name: 'Madagascar' },
147
+ { code: 'MH', name: 'Marshall Islands' },
148
+ { code: 'MK', name: 'Republic of Macedonia' },
149
+ { code: 'ML', name: 'Mali' },
150
+ { code: 'MM', name: 'Myanmar' },
151
+ { code: 'MN', name: 'Mongolia' },
152
+ { code: 'MO', name: 'Macau' },
153
+ { code: 'MP', name: 'Northern Mariana Islands' },
154
+ { code: 'MQ', name: 'Martinique' },
155
+ { code: 'MR', name: 'Mauritania' },
156
+ { code: 'MS', name: 'Montserrat' },
157
+ { code: 'MT', name: 'Malta' },
158
+ { code: 'MU', name: 'Mauritius' },
159
+ { code: 'MV', name: 'Maldives' },
160
+ { code: 'MW', name: 'Malawi' },
161
+ { code: 'MX', name: 'Mexico' },
162
+ { code: 'MY', name: 'Malaysia' },
163
+ { code: 'MZ', name: 'Mozambique' },
164
+ { code: 'NA', name: 'Namibia' },
165
+ { code: 'NC', name: 'New Caledonia' },
166
+ { code: 'NE', name: 'Niger' },
167
+ { code: 'NF', name: 'Norfolk Island' },
168
+ { code: 'NG', name: 'Nigeria' },
169
+ { code: 'NI', name: 'Nicaragua' },
170
+ { code: 'NL', name: 'Netherlands' },
171
+ { code: 'NO', name: 'Norway' },
172
+ { code: 'NP', name: 'Nepal' },
173
+ { code: 'NR', name: 'Nauru' },
174
+ { code: 'NU', name: 'Niue' },
175
+ { code: 'NZ', name: 'New Zealand' },
176
+ { code: 'OM', name: 'Oman' },
177
+ { code: 'PA', name: 'Panama' },
178
+ { code: 'PE', name: 'Peru' },
179
+ { code: 'PF', name: 'French Polynesia' },
180
+ { code: 'PG', name: 'Papua New Guinea' },
181
+ { code: 'PH', name: 'Philippines' },
182
+ { code: 'PK', name: 'Pakistan' },
183
+ { code: 'PL', name: 'Poland' },
184
+ { code: 'PM', name: 'Saint Pierre and Miquelon' },
185
+ { code: 'PN', name: 'Pitcairn Islands' },
186
+ { code: 'PR', name: 'Puerto Rico' },
187
+ { code: 'PS', name: 'State of Palestine' },
188
+ { code: 'PT', name: 'Portugal' },
189
+ { code: 'PW', name: 'Palau' },
190
+ { code: 'PY', name: 'Paraguay' },
191
+ { code: 'QA', name: 'Qatar' },
192
+ { code: 'RE', name: 'Reunion' },
193
+ { code: 'RO', name: 'Romania' },
194
+ { code: 'RS', name: 'Serbia' },
195
+ { code: 'RU', name: 'Russia' },
196
+ { code: 'RW', name: 'Rwanda' },
197
+ { code: 'SA', name: 'Saudi Arabia' },
198
+ { code: 'SB', name: 'Solomon Islands' },
199
+ { code: 'SC', name: 'Seychelles' },
200
+ { code: 'SD', name: 'Sudan' },
201
+ { code: 'SE', name: 'Sweden' },
202
+ { code: 'SG', name: 'Singapore' },
203
+ { code: 'SH', name: 'Saint Helena, Ascension and Tristan da Cunha' },
204
+ { code: 'SI', name: 'Slovenia' },
205
+ { code: 'SJ', name: 'Svalbard and Jan Mayen' },
206
+ { code: 'SK', name: 'Slovakia' },
207
+ { code: 'SL', name: 'Sierra Leone' },
208
+ { code: 'SM', name: 'San Marino' },
209
+ { code: 'SN', name: 'Senegal' },
210
+ { code: 'SO', name: 'Somalia' },
211
+ { code: 'SR', name: 'Suriname' },
212
+ { code: 'SS', name: 'South Sudan' },
213
+ { code: 'ST', name: 'São Tomé and Príncipe' },
214
+ { code: 'SV', name: 'El Salvador' },
215
+ { code: 'SX', name: 'Sint Maarten' },
216
+ { code: 'SY', name: 'Syria' },
217
+ { code: 'SZ', name: 'Swaziland' },
218
+ { code: 'TC', name: 'Turks and Caicos Islands' },
219
+ { code: 'TD', name: 'Chad' },
220
+ { code: 'TF', name: 'French Southern and Antarctic Lands' },
221
+ { code: 'TG', name: 'Togo' },
222
+ { code: 'TH', name: 'Thailand' },
223
+ { code: 'TJ', name: 'Tajikistan' },
224
+ { code: 'TK', name: 'Tokelau' },
225
+ { code: 'TL', name: 'East Timor' },
226
+ { code: 'TM', name: 'Turkmenistan' },
227
+ { code: 'TN', name: 'Tunisia' },
228
+ { code: 'TO', name: 'Tonga' },
229
+ { code: 'TR', name: 'Turkey' },
230
+ { code: 'TT', name: 'Trinidad and Tobago' },
231
+ { code: 'TV', name: 'Tuvalu' },
232
+ { code: 'TW', name: 'Taiwan' },
233
+ { code: 'TZ', name: 'Tanzania' },
234
+ { code: 'UA', name: 'Ukraine' },
235
+ { code: 'UG', name: 'Uganda' },
236
+ { code: 'UM', name: 'United States Minor Outlying Islands' },
237
+ { code: 'US', name: 'United States' },
238
+ { code: 'UY', name: 'Uruguay' },
239
+ { code: 'UZ', name: 'Uzbekistan' },
240
+ { code: 'VA', name: 'Vatican City' },
241
+ { code: 'VC', name: 'Saint Vincent and the Grenadines' },
242
+ { code: 'VE', name: 'Venezuela' },
243
+ { code: 'VG', name: 'British Virgin Islands' },
244
+ { code: 'VI', name: 'United States Virgin Islands' },
245
+ { code: 'VN', name: 'Vietnam' },
246
+ { code: 'VU', name: 'Vanuatu' },
247
+ { code: 'WF', name: 'Wallis and Futuna' },
248
+ { code: 'WS', name: 'Samoa' },
249
+ { code: 'YE', name: 'Yemen' },
250
+ { code: 'YT', name: 'Mayotte' },
251
+ { code: 'ZA', name: 'South Africa' },
252
+ { code: 'ZM', name: 'Zambia' },
253
+ { code: 'ZW', name: 'Zimbabwe' },
254
+ { code: 'XX', name: 'Unknown' }
255
+ ]
256
+ end
@@ -0,0 +1,3 @@
1
+ module CloudFlareLocalizable
2
+ VERSION = '0.1.1'
3
+ end
metadata ADDED
@@ -0,0 +1,130 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cloudflare_localizable
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Ricardo Otero
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-11-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.4'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 3.4.0
51
+ type: :development
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: '3.4'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 3.4.0
61
+ - !ruby/object:Gem::Dependency
62
+ name: actionpack
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '4.2'
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 4.2.5
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '4.2'
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 4.2.5
81
+ description: |-
82
+ If you're using CloudFlare you can easily get the location of your requests
83
+ based on a special header that CloudFlare attaches to every request.
84
+ email:
85
+ - oterosantos@gmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".ruby-version"
93
+ - ".travis.yml"
94
+ - Gemfile
95
+ - LICENSE.txt
96
+ - README.md
97
+ - Rakefile
98
+ - bin/console
99
+ - bin/setup
100
+ - cloudflare_localizable.gemspec
101
+ - lib/cloudflare_localizable.rb
102
+ - lib/cloudflare_localizable/country.rb
103
+ - lib/cloudflare_localizable/country_list.rb
104
+ - lib/cloudflare_localizable/version.rb
105
+ homepage: https://github.com/rikas/cloudflare_localizable
106
+ licenses:
107
+ - MIT
108
+ metadata: {}
109
+ post_install_message:
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubyforge_project:
125
+ rubygems_version: 2.4.5.1
126
+ signing_key:
127
+ specification_version: 4
128
+ summary: Localize your requests with CloudFlare.
129
+ test_files: []
130
+ has_rdoc: