sinatra-r18n 1.1.11 → 2.0.0

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: 4cd70925203e2c6b2b10cbbc6bcff70890b6f56d
4
- data.tar.gz: a90d76c71d62d143f979bdca6d05216e73861b6b
3
+ metadata.gz: ec4e1325d8290c79eed4af34379b6e3722f393e2
4
+ data.tar.gz: 8c3896235edb6f362e789e63076759ef7f368049
5
5
  SHA512:
6
- metadata.gz: 6e2ba669373fbe065639c5489b7b9f73bee5b8dfbc73f63a52a33380c245593f0690957fea80b2c6545240d7f507399066e405160b676b061315f168b311088c
7
- data.tar.gz: 8253c27d59c23242c1d331115ba7a8f66d036df808043aa790ab7d666812c6cfcbadd0ad04b83c215f5feddc3760189a5accaa4f9c541814661362b5da0f71d4
6
+ metadata.gz: 800d2320d72f9a7d395b8171b0e987b4ab93ab786989a32c561a8fb91c2ff5924fc0c92747332527c281e8d6f6f3c99ab7396ebb2c0eba1c2be98644156ead67
7
+ data.tar.gz: 8665c0bbf9206fa58fae3f8e2d5630c0d75823b8c4ec7f29a4fefe7a0dc466f0f9676705922efd9a1eb1ef381872c86816f5fbd457314bff328ce3a1d7505408
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Sinatra extension to i18n support.
4
3
 
@@ -46,7 +45,7 @@ module Sinatra
46
45
  end
47
46
 
48
47
  ::R18n::I18n.new(locales, ::R18n.default_places,
49
- :off_filters => :untranslated, :on_filters => :untranslated_html)
48
+ off_filters: :untranslated, on_filters: :untranslated_html)
50
49
  end
51
50
  end
52
51
  end
@@ -2,11 +2,11 @@ require File.expand_path('../../r18n-core/lib/r18n-core/version', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.platform = Gem::Platform::RUBY
5
- s.name = 'sinatra-r18n'
6
- s.version = R18n::VERSION.dup
7
- s.date = Time.now.strftime('%Y-%m-%d')
8
- s.summary = 'A Sinatra extension that provides i18n support to translate your
9
- web application.'
5
+ s.name = 'sinatra-r18n'
6
+ s.version = R18n::VERSION.dup
7
+ s.date = Time.now.strftime('%Y-%m-%d')
8
+
9
+ s.summary = 'A Sinatra extension that provides i18n support'
10
10
  s.description = <<-EOF
11
11
  A Sinatra extension that provides i18n support to translate your web
12
12
  application. It is just a wrapper for R18n core library.
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  require File.join(File.dirname(__FILE__), '../../lib/sinatra/r18n')
3
2
  require 'sinatra'
4
3
 
@@ -1,10 +1,9 @@
1
- # encoding: utf-8
2
1
  require File.expand_path('../spec_helper', __FILE__)
3
2
 
4
3
  describe Sinatra::R18n do
5
4
  before(:all) do
6
5
  Sinatra::R18n.registered(app)
7
- end
6
+ end
8
7
 
9
8
  after do
10
9
  app.set :default_locale, 'en'
@@ -13,58 +12,57 @@ describe Sinatra::R18n do
13
12
 
14
13
  it "translates messages" do
15
14
  get '/en/posts/1'
16
- last_response.should be_ok
17
- last_response.body.should == "<h1>Post 1</h1>\n"
15
+ expect(last_response).to be_ok
16
+ expect(last_response.body).to eq "<h1>Post 1</h1>\n"
18
17
  end
19
18
 
20
19
  it "uses translations from default locale" do
21
20
  get '/ru/posts/1/comments'
22
- last_response.should be_ok
23
- last_response.body.should == '3 comments'
21
+ expect(last_response).to be_ok
22
+ expect(last_response.body).to eq '3 comments'
24
23
  end
25
24
 
26
25
  it "uses default locale" do
27
26
  app.set :default_locale, 'ru'
28
27
  get '/locale'
29
- last_response.should be_ok
30
- last_response.body.should == 'Русский'
28
+ expect(last_response).to be_ok
29
+ expect(last_response.body).to eq 'Русский'
31
30
  end
32
31
 
33
32
  it "autodetects user locale" do
34
33
  get '/locale', {}, {'HTTP_ACCEPT_LANGUAGE' => 'ru,en;q=0.9'}
35
- last_response.should be_ok
36
- last_response.body.should == 'Русский'
34
+ expect(last_response).to be_ok
35
+ expect(last_response.body).to eq 'Русский'
37
36
  end
38
37
 
39
38
  it "uses locale from session" do
40
- get '/locale', { }, { 'rack.session' => { :locale => 'ru' } }
41
- last_response.should be_ok
42
- last_response.body.should == 'Русский'
39
+ get '/locale', { }, { 'rack.session' => { locale: 'ru' } }
40
+ expect(last_response).to be_ok
41
+ expect(last_response.body).to eq 'Русский'
43
42
  end
44
43
 
45
44
  it "returns locales list" do
46
45
  get '/locales'
47
- last_response.should be_ok
48
- last_response.body.should == 'en: English; ru: Русский'
46
+ expect(last_response).to be_ok
47
+ expect(last_response.body).to eq 'en: English; ru: Русский'
49
48
  end
50
49
 
51
50
  it "formats untranslated string" do
52
51
  get '/untranslated'
53
- last_response.should be_ok
54
- last_response.body.should == 'post.<span style="color: red">[no]</span>'
52
+ expect(last_response).to be_ok
53
+ expect(last_response.body).to eq 'post.<span style="color: red">[no]</span>'
55
54
  end
56
55
 
57
56
  it "localizes objects" do
58
57
  get '/time'
59
- last_response.should be_ok
60
- last_response.body.should == "01/01/1970 00:00"
58
+ expect(last_response).to be_ok
59
+ expect(last_response.body).to eq "01/01/1970 00:00"
61
60
  end
62
61
 
63
62
  it "sets default places" do
64
- R18n.default_places.should ==
65
- Pathname(__FILE__).dirname.expand_path.join('app/i18n/').to_s
63
+ path = Pathname(__FILE__).dirname.expand_path.join('app/i18n/').to_s
64
+ expect(R18n.default_places).to eq path
66
65
  R18n.set('en')
67
- R18n.get.post.title(1).should == 'Post 1'
66
+ expect(R18n.get.post.title(1)).to eq 'Post 1'
68
67
  end
69
-
70
68
  end
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  require 'pp'
3
2
 
4
3
  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: 1.1.11
4
+ version: 2.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: 2014-05-20 00:00:00.000000000 Z
11
+ date: 2014-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.1.11
33
+ version: 2.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.1.11
40
+ version: 2.0.0
41
41
  description: |2
42
42
  A Sinatra extension that provides i18n support to translate your web
43
43
  application. It is just a wrapper for R18n core library.
@@ -87,7 +87,7 @@ rubyforge_project:
87
87
  rubygems_version: 2.2.2
88
88
  signing_key:
89
89
  specification_version: 4
90
- summary: A Sinatra extension that provides i18n support to translate your web application.
90
+ summary: A Sinatra extension that provides i18n support
91
91
  test_files:
92
92
  - spec/app/app.rb
93
93
  - spec/app/i18n/en.yml