babosa 1.0.1 → 1.0.2

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: 5f3dfc2a054ed3f64981c0f18a149a9647ef0183
4
- data.tar.gz: 3478c2c422839e82866d828cc77ba3bcf79a5117
3
+ metadata.gz: 63fa1835d7bbc606c85b2c8315e8619c37bc7703
4
+ data.tar.gz: 4b0f3a169ed08de3a1614026e58fbc0dc00e58bc
5
5
  SHA512:
6
- metadata.gz: f7880005ce37bddd4b9780a3b31489eebdfbbb4e8f9b7d6eacd54cc3e33c36b412ec2fd4b5cc4aea87ea64288240002c9006a909e3ba2692161e775f5e43836f
7
- data.tar.gz: c0e7fd6edeb02401dfb34493e5e072de62fdbe3c0333d252ebac5b359830ef966ededc8879077ed00e54a75432db72ec0852c3f4c4edf7e4a2b40c550c3e6245
6
+ metadata.gz: 8581a919789c35ab9fe3c077190dcb93a20da9b0ed5ebf05cb7342fb2c4c9eeb8181e3d93850fd7564f31e95cd0195274f24e2fde938c7e6c9027aa02a4ccd15
7
+ data.tar.gz: 6a86041c30dcd1cdbf5a39b1d2f319425656e57135856aa90a32fffd181fe85748676f74fbb25254294f8d8c6c63f1574b087a32f1d2d112ce84ae40f932c8b4
@@ -1,5 +1,9 @@
1
1
  # Babosa Changelog
2
2
 
3
+ ## 1.0.2
4
+
5
+ * Fix regression in ActiveSupport UTF8 proxy.
6
+
3
7
  ## 1.0.1
4
8
 
5
9
  * Fix error with tidy_bytes on Rubinius.
@@ -1,3 +1,4 @@
1
+ require 'active_support'
1
2
  require 'active_support/multibyte/unicode'
2
3
 
3
4
  module Babosa
@@ -5,10 +6,21 @@ module Babosa
5
6
  # A UTF-8 proxy using Active Support's multibyte support.
6
7
  module ActiveSupportProxy
7
8
  extend ActiveSupport::Multibyte::Unicode
9
+ extend self
8
10
 
9
11
  def self.normalize_utf8(string)
10
12
  normalize(string, :c)
11
13
  end
14
+
15
+ if ActiveSupport::VERSION::MAJOR == 3
16
+ def downcase(string)
17
+ ActiveSupport::Multibyte::Chars.new(string).downcase.to_s
18
+ end
19
+
20
+ def upcase(string)
21
+ ActiveSupport::Multibyte::Chars.new(string).upcase.to_s
22
+ end
23
+ end
12
24
  end
13
25
  end
14
26
  end
@@ -1,5 +1,5 @@
1
1
  module Babosa
2
2
  module Version
3
- STRING = '1.0.1'
3
+ STRING = '1.0.2'
4
4
  end
5
5
  end
@@ -8,6 +8,16 @@ PROXIES.each do |proxy|
8
8
 
9
9
  describe proxy do
10
10
 
11
+ around do |example|
12
+ begin
13
+ old_proxy = Babosa::Identifier.utf8_proxy
14
+ Babosa::Identifier.utf8_proxy = proxy
15
+ example.run
16
+ ensure
17
+ Babosa::Identifier.utf8_proxy = old_proxy
18
+ end
19
+ end
20
+
11
21
  describe "#normalize_utf8" do
12
22
  it "should normalize to canonical composed" do
13
23
  # ÅÉÎØÜ
@@ -21,12 +31,14 @@ PROXIES.each do |proxy|
21
31
  describe "#upcase" do
22
32
  it "should upcase the string" do
23
33
  expect(proxy.upcase("åéîøü")).to eql("ÅÉÎØÜ")
34
+ expect("åéîøü".to_identifier.upcase).to eql("ÅÉÎØÜ")
24
35
  end
25
36
  end
26
37
 
27
38
  describe "#downcase" do
28
39
  it "should downcase the string" do
29
40
  expect(proxy.downcase("ÅÉÎØÜ")).to eql("åéîøü")
41
+ expect("ÅÉÎØÜ".to_identifier.downcase).to eql("åéîøü")
30
42
  end
31
43
  end
32
44
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: babosa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Norman Clarke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-05 00:00:00.000000000 Z
11
+ date: 2015-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  version: '0'
158
158
  requirements: []
159
159
  rubyforge_project:
160
- rubygems_version: 2.4.5
160
+ rubygems_version: 2.4.4
161
161
  signing_key:
162
162
  specification_version: 4
163
163
  summary: A library for creating slugs.