sinatra-r18n 3.2.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c413bd3554663db727c2da9a2c2842b29384c14291a24a57249961a3ba46a57
4
- data.tar.gz: 367e7b689dadb091c8863f834b9bad135e400566b40c3d37e770e65fc625d598
3
+ metadata.gz: 7358e3bfc46da5f9f15e6d3663ca8b496c6100f5283f1f2aa24bf23ef7d32672
4
+ data.tar.gz: ae3dd8a8748aff652ff16f02b340bf1d42780da0abdcd2fb173e01a18367909b
5
5
  SHA512:
6
- metadata.gz: 7ad4aa09402c461f0310d4da9e2a59f8c61f31eaf6e960f0b29301a70e732fa2b3f87b026c80f8e74e09dd893fcf936be8b1f461153991d04118258b43c9933f
7
- data.tar.gz: 7628ec1c9a189a974a9e6695a9ef0a1f07c46b792f7083954383a38e3b6b5bec9632af7ab37d660676453f2d3e4aea4ba800ef14b074e64aa4e5b1c367fde559
6
+ metadata.gz: 3b65bce01688a86729354ce43c0d16593a58cc79f618036981f374baead9925f88bd32afbf7a8ed0ee0e7eae45ec5260b97808784374659fce02bb9f4c7b2e18
7
+ data.tar.gz: fba147d2329880e2a2bcacea0a26e189d82f48c8a60cbf3ad6624b4327301164f8b7694d5a3b572b245ffcb41629b83dafa41d86db64a169a2e53499a4347945
data/README.md CHANGED
@@ -101,8 +101,8 @@ R18n.default_places { './translations' }
101
101
  # License
102
102
 
103
103
  R18n is licensed under the GNU Lesser General Public License version 3.
104
- You can read it in LICENSE file or in http://www.gnu.org/licenses/lgpl.html.
104
+ You can read it in LICENSE file or in [www.gnu.org/licenses/lgpl-3.0.html](https://www.gnu.org/licenses/lgpl-3.0.html).
105
105
 
106
106
  # Author
107
107
 
108
- Andrey “A.I.” Sitnik <andrey@sitnik.ru>
108
+ Andrey “A.I.” Sitnik [andrey@sitnik.ru](mailto:andrey@sitnik.ru)
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
 
26
26
  s.author = 'Andrey Sitnik'
27
27
  s.email = 'andrey@sitnik.ru'
28
- s.homepage = 'https://github.com/ai/r18n/tree/master/sinatra-r18n'
28
+ s.homepage = 'https://github.com/r18n/r18n/tree/master/sinatra-r18n'
29
29
  s.license = 'LGPL-3.0'
30
30
 
31
31
  s.add_dependency 'r18n-core', "= #{R18n::VERSION}"
@@ -29,10 +29,30 @@ describe Sinatra::R18n do
29
29
  expect(last_response.body).to eq 'Русский'
30
30
  end
31
31
 
32
- it 'autodetects user locale' do
33
- get '/locale', {}, 'HTTP_ACCEPT_LANGUAGE' => 'ru,en;q=0.9'
34
- expect(last_response).to be_ok
35
- expect(last_response.body).to eq 'Русский'
32
+ describe 'autodetect user locale' do
33
+ it 'works with regular' do
34
+ get '/locale', {}, 'HTTP_ACCEPT_LANGUAGE' => 'ru,en;q=0.9'
35
+ expect(last_response).to be_ok
36
+ expect(last_response.body).to eq 'Русский'
37
+ end
38
+
39
+ it 'works with only wildcard' do
40
+ get '/locale', {}, 'HTTP_ACCEPT_LANGUAGE' => '*'
41
+ expect(last_response).to be_ok
42
+ expect(last_response.body).to eq 'English'
43
+ end
44
+
45
+ it 'works with only regular and wildcard' do
46
+ get '/locale', {}, 'HTTP_ACCEPT_LANGUAGE' => 'ru, en;q=0.9, *;q=0.5'
47
+ expect(last_response).to be_ok
48
+ expect(last_response.body).to eq 'Русский'
49
+ end
50
+
51
+ it 'works with non-ISO code' do
52
+ get '/locale', {}, 'HTTP_ACCEPT_LANGUAGE' => 'Русский'
53
+ expect(last_response).to be_ok
54
+ expect(last_response.body).to eq 'English'
55
+ end
36
56
  end
37
57
 
38
58
  it 'uses locale from param' do
@@ -1,9 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ## https://github.com/stevekinney/pizza/issues/103#issuecomment-136052789
4
- ## https://github.com/docker-library/ruby/issues/45
5
- Encoding.default_external = 'UTF-8'
6
-
7
3
  require 'pp'
8
4
 
9
5
  ENV['RACK_ENV'] = 'test'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-r18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Sitnik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-08 00:00:00.000000000 Z
11
+ date: 2020-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: r18n-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.0
19
+ version: 4.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.2.0
26
+ version: 4.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sinatra
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -70,7 +70,7 @@ files:
70
70
  - spec/app/views/post.erb
71
71
  - spec/sinatra-r18n_spec.rb
72
72
  - spec/spec_helper.rb
73
- homepage: https://github.com/ai/r18n/tree/master/sinatra-r18n
73
+ homepage: https://github.com/r18n/r18n/tree/master/sinatra-r18n
74
74
  licenses:
75
75
  - LGPL-3.0
76
76
  metadata: {}
@@ -89,8 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubyforge_project:
93
- rubygems_version: 2.7.6
92
+ rubygems_version: 3.1.2
94
93
  signing_key:
95
94
  specification_version: 4
96
95
  summary: A Sinatra extension that provides i18n support