stringex 2.5.1 → 2.5.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: 66b139aab9ec7f3b0f1cbec1f474f3f6307df83b
4
- data.tar.gz: 960c862cd978bdcfce385b45f0d51df7f08bb16d
3
+ metadata.gz: f38aa370c45410b7dddca83f8415b394128fbef0
4
+ data.tar.gz: c31065a92e88609aab0d0177df0d55d00a3153e9
5
5
  SHA512:
6
- metadata.gz: a6823ed7e9f8fbd25cf3d175bece789e43f9d75b9483561511c812dcce41770ed28a8766405ec777180c7904c48593634ac67581fe09b26609c045d0687f7dd6
7
- data.tar.gz: ae397076658784254012e5c2772634d52527f3c3d3bed869e0f807ada7bf9e3fddb93f915bfd0fab802d41a83eddc162b61098cf7e248a459ef8ba27eaf55fd8
6
+ metadata.gz: 549f5d2ae387791d12242a70135f852c295a4bc30bf0d39a9abbd669569bd9d762a408b18bac9c069a813a984c26e943cc52984cc158ef723da875dc3cdf27f2
7
+ data.tar.gz: faa753229e05c6feddcf2d028d4678de8400e703d1ac5397193fff571f8f5648846cd94bad92cd82a8f1e03b66c99ad6b757261c9549540cb72c099f95aeda41
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.5.1
1
+ 2.5.2
@@ -59,7 +59,8 @@ module Stringex
59
59
  def ensure_locales_enforced_or_not
60
60
  return unless ::I18n.respond_to?(:enforce_available_locales)
61
61
  # Allow users to have set this to false manually but default to true
62
- ::I18n.enforce_available_locales ||= ::I18n.available_locales != []
62
+ return if ::I18n.enforce_available_locales != nil
63
+ ::I18n.enforce_available_locales = ::I18n.available_locales != []
63
64
  end
64
65
  end
65
66
  end
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: stringex 2.5.1 ruby lib
5
+ # stub: stringex 2.5.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "stringex"
9
- s.version = "2.5.1"
9
+ s.version = "2.5.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Russell Norris"]
14
- s.date = "2014-04-04"
14
+ s.date = "2014-04-09"
15
15
  s.description = "Some [hopefully] useful extensions to Ruby's String class. Stringex is made up of three libraries: ActsAsUrl [permalink solution with better character translation], Unidecoder [Unicode to ASCII transliteration], and StringExtensions [miscellaneous helper methods for the String class]."
16
16
  s.email = "rsl@luckysneaks.com"
17
17
  s.extra_rdoc_files = [
@@ -143,4 +143,17 @@ class LocalizationTest < Test::Unit::TestCase
143
143
  flunk "No I18n locales are available except :de and :en so test will not work"
144
144
  end
145
145
  end
146
+
147
+ def test_defaults_enforce_available_locales_to_true
148
+ Stringex::Localization.backend = :i18n
149
+ 'Some String'.to_url
150
+ assert_equal true, I18n.enforce_available_locales
151
+ end
152
+
153
+ def test_respects_user_enforce_available_locales_setting
154
+ Stringex::Localization.backend = :i18n
155
+ I18n.enforce_available_locales = false
156
+ 'Some String'.to_url
157
+ assert_equal false, I18n.enforce_available_locales
158
+ end
146
159
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stringex
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Norris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-04 00:00:00.000000000 Z
11
+ date: 2014-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jeweler