sinatra-r18n 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +4 -24
- data/sinatra-r18n.gemspec +1 -0
- data/spec/sinatra-r18n_spec.rb +9 -9
- metadata +27 -33
- data/.yardopts +0 -3
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1f0fbd68cc59b291b407e515a7fdc30daa0fd5e4
|
4
|
+
data.tar.gz: a87b7fb187fea13dfec18f4eb209e7eb7dec166d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 863cdd54aa63b50358f533b935acc68852dc017701d32bcb96ad38e50e557e16cceb4f32012200f308f7990e9ded025fdc0fda2d107840416d3d9d1bea6b6b0a
|
7
|
+
data.tar.gz: 78f5be90c87e41c21b6fb6bacd442b2d9ba3aeb3c42ec2e277d4081a2ff309872000b10d4fb29fb35081c4be93586833a33fa2c8bfeed0fa143414ad15a7cc6a
|
data/Rakefile
CHANGED
@@ -1,33 +1,13 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
require 'rubygems'
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
Bundler::GemHelper.install_tasks
|
8
|
-
rescue LoadError
|
9
|
-
puts "Bundler not available. Install it with: gem install bundler"
|
10
|
-
end
|
11
|
-
|
12
|
-
PKG_NAME = 'sinatra-r18n'
|
13
|
-
require '../r18n-core/lib/r18n-core/version'
|
3
|
+
require 'bundler/setup'
|
4
|
+
Bundler::GemHelper.install_tasks
|
14
5
|
|
15
6
|
require 'rspec/core/rake_task'
|
16
|
-
|
17
7
|
RSpec::Core::RakeTask.new
|
8
|
+
task :default => :spec
|
18
9
|
|
19
|
-
require 'yard'
|
20
|
-
YARD::Rake::YardocTask.new do |yard|
|
21
|
-
yard.options << "--title='Sinatra R18n #{R18n::VERSION}'"
|
22
|
-
end
|
23
|
-
|
24
|
-
task :clobber_doc do
|
25
|
-
rm_r 'doc' rescue nil
|
26
|
-
rm_r '.yardoc' rescue nil
|
27
|
-
end
|
28
10
|
task :clobber_package do
|
29
11
|
rm_r 'pkg' rescue nil
|
30
12
|
end
|
31
|
-
task :clobber => [:clobber_package
|
32
|
-
|
33
|
-
task :default => :spec
|
13
|
+
task :clobber => [:clobber_package]
|
data/sinatra-r18n.gemspec
CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.author = 'Andrey "A.I." Sitnik'
|
25
25
|
s.email = 'andrey@sitnik.ru'
|
26
26
|
s.homepage = 'https://github.com/ai/r18n/tree/master/sinatra-r18n'
|
27
|
+
s.license = 'LGPL-3'
|
27
28
|
|
28
29
|
s.add_dependency 'sinatra', [">= 1.3"]
|
29
30
|
s.add_dependency 'r18n-core', ["= #{R18n::VERSION}"]
|
data/spec/sinatra-r18n_spec.rb
CHANGED
@@ -11,56 +11,56 @@ describe Sinatra::R18n do
|
|
11
11
|
app.set :environment, :test
|
12
12
|
end
|
13
13
|
|
14
|
-
it "
|
14
|
+
it "translates messages" do
|
15
15
|
get '/en/posts/1'
|
16
16
|
last_response.should be_ok
|
17
17
|
last_response.body.should == "<h1>Post 1</h1>\n"
|
18
18
|
end
|
19
19
|
|
20
|
-
it "
|
20
|
+
it "uses translations from default locale" do
|
21
21
|
get '/ru/posts/1/comments'
|
22
22
|
last_response.should be_ok
|
23
23
|
last_response.body.should == '3 comments'
|
24
24
|
end
|
25
25
|
|
26
|
-
it "
|
26
|
+
it "uses default locale" do
|
27
27
|
app.set :default_locale, 'ru'
|
28
28
|
get '/locale'
|
29
29
|
last_response.should be_ok
|
30
30
|
last_response.body.should == 'Русский'
|
31
31
|
end
|
32
32
|
|
33
|
-
it "
|
33
|
+
it "autodetects user locale" do
|
34
34
|
get '/locale', {}, {'HTTP_ACCEPT_LANGUAGE' => 'ru,en;q=0.9'}
|
35
35
|
last_response.should be_ok
|
36
36
|
last_response.body.should == 'Русский'
|
37
37
|
end
|
38
38
|
|
39
|
-
it "
|
39
|
+
it "uses locale from session" do
|
40
40
|
get '/locale', { }, { 'rack.session' => { :locale => 'ru' } }
|
41
41
|
last_response.should be_ok
|
42
42
|
last_response.body.should == 'Русский'
|
43
43
|
end
|
44
44
|
|
45
|
-
it "
|
45
|
+
it "returns locales list" do
|
46
46
|
get '/locales'
|
47
47
|
last_response.should be_ok
|
48
48
|
last_response.body.should == 'en: English; ru: Русский'
|
49
49
|
end
|
50
50
|
|
51
|
-
it "
|
51
|
+
it "formats untranslated string" do
|
52
52
|
get '/untranslated'
|
53
53
|
last_response.should be_ok
|
54
54
|
last_response.body.should == 'post.<span style="color: red">[no]</span>'
|
55
55
|
end
|
56
56
|
|
57
|
-
it "
|
57
|
+
it "localizes objects" do
|
58
58
|
get '/time'
|
59
59
|
last_response.should be_ok
|
60
60
|
last_response.body.should == "01/01/1970 00:00"
|
61
61
|
end
|
62
62
|
|
63
|
-
it "
|
63
|
+
it "sets default places" do
|
64
64
|
R18n.default_places.should ==
|
65
65
|
Pathname(__FILE__).dirname.expand_path.join('app/i18n/').to_s
|
66
66
|
R18n.set('en')
|
metadata
CHANGED
@@ -1,54 +1,50 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-r18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.7
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Andrey "A.I." Sitnik
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-10-13 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: sinatra
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '1.3'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '1.3'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: r18n-core
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - '='
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: 1.1.
|
33
|
+
version: 1.1.7
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - '='
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.1.
|
46
|
-
description:
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
40
|
+
version: 1.1.7
|
41
|
+
description: |2
|
42
|
+
A Sinatra extension that provides i18n support to translate your web
|
43
|
+
application. It is just a wrapper for R18n core library.
|
44
|
+
It has nice Ruby-style syntax, filters, flexible locales, custom loaders,
|
45
|
+
translation support for any classes, time and number localization, several
|
46
|
+
user language support, agnostic core package with out-of-box support for
|
47
|
+
Rails, Sinatra and desktop applications.
|
52
48
|
email: andrey@sitnik.ru
|
53
49
|
executables: []
|
54
50
|
extensions: []
|
@@ -57,7 +53,6 @@ extra_rdoc_files:
|
|
57
53
|
- LICENSE
|
58
54
|
files:
|
59
55
|
- .rspec
|
60
|
-
- .yardopts
|
61
56
|
- LICENSE
|
62
57
|
- README.md
|
63
58
|
- Rakefile
|
@@ -70,34 +65,33 @@ files:
|
|
70
65
|
- spec/sinatra-r18n_spec.rb
|
71
66
|
- spec/spec_helper.rb
|
72
67
|
homepage: https://github.com/ai/r18n/tree/master/sinatra-r18n
|
73
|
-
licenses:
|
68
|
+
licenses:
|
69
|
+
- LGPL-3
|
70
|
+
metadata: {}
|
74
71
|
post_install_message:
|
75
72
|
rdoc_options: []
|
76
73
|
require_paths:
|
77
74
|
- lib
|
78
75
|
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
-
none: false
|
80
76
|
requirements:
|
81
|
-
- -
|
77
|
+
- - '>='
|
82
78
|
- !ruby/object:Gem::Version
|
83
79
|
version: '0'
|
84
|
-
segments:
|
85
|
-
- 0
|
86
|
-
hash: -3668101867439560857
|
87
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
-
none: false
|
89
81
|
requirements:
|
90
|
-
- -
|
82
|
+
- - '>='
|
91
83
|
- !ruby/object:Gem::Version
|
92
84
|
version: '0'
|
93
|
-
segments:
|
94
|
-
- 0
|
95
|
-
hash: -3668101867439560857
|
96
85
|
requirements: []
|
97
86
|
rubyforge_project:
|
98
|
-
rubygems_version:
|
87
|
+
rubygems_version: 2.0.3
|
99
88
|
signing_key:
|
100
|
-
specification_version:
|
89
|
+
specification_version: 4
|
101
90
|
summary: A Sinatra extension that provides i18n support to translate your web application.
|
102
|
-
test_files:
|
103
|
-
|
91
|
+
test_files:
|
92
|
+
- spec/app/app.rb
|
93
|
+
- spec/app/i18n/en.yml
|
94
|
+
- spec/app/i18n/ru.yml
|
95
|
+
- spec/app/views/post.erb
|
96
|
+
- spec/sinatra-r18n_spec.rb
|
97
|
+
- spec/spec_helper.rb
|
data/.yardopts
DELETED