r18n-desktop 1.1.11 → 2.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
  SHA1:
3
- metadata.gz: 27ae6a00e38bc532a119352e6d1a2d98a22e11e1
4
- data.tar.gz: 30edd693d7f93f49ea95ee3c6328456543833acf
3
+ metadata.gz: c632c2f116e3e1876767da781d3ca9a876fd4c9a
4
+ data.tar.gz: 3c1368f76219f1c0473eaf2a29fb654314987692
5
5
  SHA512:
6
- metadata.gz: 109bda95691f2a641db59af388f3c457c45b4d5b74d654164acd3555e3e3207e8fd23dbcbc8345497421f8cbcd75d3f8a09eb208db8a2bc8e292bd5ed248b377
7
- data.tar.gz: 8694bc9504543b76e8928202ed772759d166b4773b93a2320e8cf25c6a951b199f3788ff9c3bf54020bb3a48c1b8c085d96c11e0c7da0d252203fbf75190132d
6
+ metadata.gz: c969a98f493c8202e1f9e361d12658b6714dd799e18a5be43ba2df4e46378c13aa3775b3a7f76373b781f34eba9e4241196b05b50e7efece70515272a3d26071
7
+ data.tar.gz: 0fbcac6c81fd603caa01b046c6e454a89ab27d6c0619c8ddcafa461bb0cfe8ac661971728a488b873676a7724ded54e453b3051ecc280bb8eb6ee85a3466533a
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  I18n support for JRuby.
4
3
 
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  I18n support for Mac OS X.
4
3
 
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  I18n support for UNIX-like OS.
4
3
 
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  I18n support for Windows.
4
3
 
@@ -18,31 +17,19 @@ You should have received a copy of the GNU Lesser General Public License
18
17
  along with this program. If not, see <http://www.gnu.org/licenses/>.
19
18
  =end
20
19
 
21
- # Win32API is deprecated as of 1.9.1
22
- if RUBY_VERSION < '1.9'
23
- require 'dl/win32'
24
- else
25
- require 'dl/import'
26
- end
20
+ require 'dl/import'
27
21
 
28
22
  module R18n
29
23
  class I18n
30
- if RUBY_VERSION < '1.9'
31
- def self.system_locale
32
- id = Win32API.new('kernel32.dll', 'GetUserDefaultLangID', nil, 'i').call
33
- WIN32_LOCALES[id]
34
- end
35
- else
36
- module Kernel32
37
- extend DL::Importer
38
- dlload 'Kernel32'
39
- extern 'int GetUserDefaultLangID()'
40
- end
24
+ module Kernel32
25
+ extend DL::Importer
26
+ dlload 'Kernel32'
27
+ extern 'int GetUserDefaultLangID()'
28
+ end
41
29
 
42
- def self.system_locale
43
- id = Kernel32.GetUserDefaultLangID()
44
- WIN32_LOCALES[id]
45
- end
30
+ def self.system_locale
31
+ id = Kernel32.GetUserDefaultLangID()
32
+ WIN32_LOCALES[id]
46
33
  end
47
34
 
48
35
  WIN32_LOCALES = {
data/lib/r18n-desktop.rb CHANGED
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  I18n support for desktop application.
4
3
 
data/r18n-desktop.gemspec CHANGED
@@ -2,10 +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 = 'r18n-desktop'
6
- s.version = R18n::VERSION.dup
7
- s.date = Time.now.strftime('%Y-%m-%d')
8
- s.summary = 'A i18n tool to translate your Ruby desktop application.'
5
+ s.name = 'r18n-desktop'
6
+ s.version = R18n::VERSION.dup
7
+ s.date = Time.now.strftime('%Y-%m-%d')
8
+
9
+ s.summary = 'A i18n tool to translate your Ruby desktop application.'
9
10
  s.description = <<-EOF
10
11
  A i18n tool to translate your desktop application in several languages.
11
12
  It is just a wrapper for R18n core library.
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  require File.expand_path('../spec_helper', __FILE__)
3
2
 
4
3
  describe "r18n-desktop" do
@@ -10,28 +9,27 @@ describe "r18n-desktop" do
10
9
 
11
10
  it "returns array of system locales" do
12
11
  locale = R18n::I18n.system_locale
13
- locale.class.should == String
14
- locale.should_not be_empty
12
+ expect(locale.class).to eq String
13
+ expect(locale).not_to be_empty
15
14
  end
16
15
 
17
16
  it "loads I18n from system environment" do
18
17
  R18n.from_env
19
- r18n.class.should == R18n::I18n
20
- r18n.locale.should_not be_empty if String == r18n.locale.class
21
- R18n.get.should == r18n
18
+ expect(r18n.class).to eq R18n::I18n
19
+ expect(r18n.locale).not_to be_empty if String == r18n.locale.class
20
+ expect(R18n.get).to eq r18n
22
21
  end
23
22
 
24
23
  it "loads i18n from system environment using specified order" do
25
24
  R18n.from_env(nil, 'en')
26
- r18n.locale.should == R18n.locale('en')
27
- R18n.get.should == r18n
25
+ expect(r18n.locale).to eq R18n.locale('en')
26
+ expect(R18n.get).to eq r18n
28
27
  end
29
28
 
30
29
  it "allows to overide autodetect by LANG environment" do
31
- R18n::I18n.stub(:system_locale).and_return('ru')
30
+ allow(R18n::I18n).to receive(:system_locale) { 'ru' }
32
31
  ENV['LANG'] = 'en'
33
32
  R18n.from_env
34
- r18n.locale.should == R18n.locale('en')
33
+ expect(r18n.locale).to eq R18n.locale('en')
35
34
  end
36
-
37
35
  end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  require 'pp'
3
2
 
4
3
  require File.join(File.dirname(__FILE__), '../lib/r18n-desktop')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r18n-desktop
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: r18n-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.1.11
19
+ version: 2.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: 1.1.11
26
+ version: 2.0.0
27
27
  description: |2
28
28
  A i18n tool to translate your desktop application in several languages.
29
29
  It is just a wrapper for R18n core library.