refinerycms-i18n 3.0.1 → 3.0.2

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: 5e568863fc1a251f2f3dba2c58ec772ad9c0d1b4
4
- data.tar.gz: 023f5d1b6c909b7ce0052a60dd6b94fae0747d48
3
+ metadata.gz: ac37504ad8f7f3a48dd97a244f5a9d064c4eabb7
4
+ data.tar.gz: 68f1b485fa2104ed15c8adf58751e9310796130b
5
5
  SHA512:
6
- metadata.gz: 40a9198618c4556c2cae7bbcf0c66c1de5d7e97008bbd72a7c5e7f4dcaedcbcdc4e84b965087af93d54dfe3cefb6c8e64f7b3b9dd0f13bc0ad99ba76b3db43bb
7
- data.tar.gz: cb0205d835ce818d24690f468c9f363012c197a35d3f88f6bfc75d886f9ea8c45f482d75bb24e526d718a04c170a5d570402d8a92e3719dfbf6f654baec71221
6
+ metadata.gz: 709f5b24238d70b604c95a0ba690154aced4a66036d4a67b44ef6f6430eacbd9ab91ca829e4812d8bea34f7df37b6bdcba67085507bb683508cbb5ae4d7ba92e
7
+ data.tar.gz: b5baabbb16b7ad7dc288b098f258999cdf0b55873a3cf024f967bfcc8c41f4b849c603fbb1b37a543459c9c59a0d15bc746d218f0d4d8ae17071f8b49ce382cb
data/.travis.yml CHANGED
@@ -26,6 +26,6 @@ env:
26
26
  - DB=postgresql
27
27
  - DB=mysql
28
28
  rvm:
29
+ - 2.4
30
+ - 2.3
29
31
  - 2.2
30
- - 2.1
31
- - 2.0.0
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- git "https://github.com/refinery/refinerycms", branch: "master" do
5
+ git "https://github.com/refinery/refinerycms", branch: "3-0-stable" do
6
6
  gem "refinerycms"
7
7
 
8
8
  group :test do
@@ -57,10 +57,10 @@ module Refinery
57
57
  Globalize.locale = params[:switch_locale].to_sym
58
58
  elsif ::I18n.locale != ::Refinery::I18n.default_frontend_locale
59
59
  Globalize.locale = ::Refinery::I18n.default_frontend_locale
60
+ else
61
+ Globalize.locale = ::I18n.locale
60
62
  end
61
63
  end
62
-
63
- Globalize.locale = ::I18n.locale if Globalize.locale.nil?
64
64
  end
65
65
  # globalize! should be prepended first so that it runs after find_or_set_locale
66
66
  prepend_before_filter :globalize!, :find_or_set_locale
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{refinerycms-i18n}
5
- s.version = %q{3.0.1}
5
+ s.version = %q{3.0.2}
6
6
  s.description = %q{i18n logic extracted from Refinery CMS, for Refinery CMS.}
7
7
  s.summary = %q{i18n logic for Refinery CMS.}
8
8
  s.email = %q{info@refinerycms.com}
@@ -0,0 +1,36 @@
1
+ require "spec_helper"
2
+
3
+ module Refinery
4
+ module Admin
5
+ describe ResourcesController, type: :controller do
6
+ before do
7
+ Globalize.locale = :en
8
+ @resource = FactoryGirl.create(:resource, :resource_title => "My resource in English")
9
+
10
+ # Add a translation
11
+ Globalize.locale = :es
12
+ @resource.resource_title = 'Mi recurso en español'
13
+ @resource.save
14
+ end
15
+
16
+ it 'reset Globalize as expected' do
17
+ get :index
18
+ expect(Globalize.locale).to eql(:en)
19
+ expect(::I18n.locale).to eql(:en)
20
+ expect(assigns(:resources).first.resource_title).to eql('My resource in English')
21
+
22
+ # Switch globalized content to ES
23
+ get :index, switch_locale: :es
24
+ expect(Globalize.locale).to eql(:es)
25
+ expect(::I18n.locale).to eql(:en)
26
+ expect(assigns(:resources).first.resource_title).to eql('Mi recurso en español')
27
+
28
+ # Should return to default locale for globalized content on next request
29
+ get :index
30
+ expect(Globalize.locale).to eql(:en)
31
+ expect(::I18n.locale).to eql(:en)
32
+ expect(assigns(:resources).first.resource_title).to eql('My resource in English')
33
+ end
34
+ end
35
+ end
36
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Arndt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-18 00:00:00.000000000 Z
12
+ date: 2017-08-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: routing-filter
@@ -313,6 +313,7 @@ files:
313
313
  - lib/translate/storage.rb
314
314
  - refinerycms-i18n.gemspec
315
315
  - script/rails
316
+ - spec/controllers/refinery/admin/resources_controller_spec.rb
316
317
  - spec/features/set_locale_spec.rb
317
318
  - spec/spec_helper.rb
318
319
  - spec/support/refinery/i18n/set_defaults.rb
@@ -338,11 +339,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
338
339
  version: '0'
339
340
  requirements: []
340
341
  rubyforge_project:
341
- rubygems_version: 2.4.6
342
+ rubygems_version: 2.6.13
342
343
  signing_key:
343
344
  specification_version: 4
344
345
  summary: i18n logic for Refinery CMS.
345
346
  test_files:
347
+ - spec/controllers/refinery/admin/resources_controller_spec.rb
346
348
  - spec/features/set_locale_spec.rb
347
349
  - spec/spec_helper.rb
348
350
  - spec/support/refinery/i18n/set_defaults.rb