unf 0.1.0 → 0.1.1

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: e9b7e220d02e830aec1ca0722e144a18ed972796
4
- data.tar.gz: b1338b92b4e0b739e7bbd5701058af2265df9e5b
3
+ metadata.gz: 11e5901eead9bcaba5539ff5368a2196a28a46a0
4
+ data.tar.gz: 6c63e08825e71783088e591f2a13b71ea4121b21
5
5
  SHA512:
6
- metadata.gz: 98076b1a3b8cbf9358a84de2a2d78b9237bd8cb2f23c9455e75c1bed0b581d9ef21a80e37c52b61119e6e442ab0c2ed191db06b273a9a761aad4cc1f12c89271
7
- data.tar.gz: e4386915f73a155c133821c01415ba3a332ad75cdaadc10de75b91290b103aaa23b4687c3966a12d9de22efc57efd06509b99138ee6d06eedffad4e67c295dff
6
+ metadata.gz: 86c085c9d81908ef33b759d634d5853c43bbdd9c16c722d82add1647c5714edd63dd08e971c526fb17e0d12980ac077c6c6b64e0a6afc1a03b85c155010636ed
7
+ data.tar.gz: aa66647b11db4497049afa8b8b1a6b9f406b06613d4c35c27ecbe8fff913c7377f632e2596b95349a36a4f4abbce72d6a5729d027983bcd5f5b2f391c245151f
@@ -1,12 +1,14 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.8.7
4
+ - ree
4
5
  - 1.9.2
5
6
  - 1.9.3
6
7
  - 2.0.0
7
- - ree
8
+ - ruby-head
8
9
  - jruby-18mode
9
10
  - jruby-19mode
11
+ - jruby-head
10
12
  - rbx-18mode
11
13
  - rbx-19mode
12
14
  matrix:
data/lib/unf.rb CHANGED
@@ -12,6 +12,18 @@ class String
12
12
  '/[^\x00-\x7f]/ !~ self'
13
13
  end
14
14
 
15
+ # :method: to_nfc
16
+ # Converts the string to NFC.
17
+
18
+ # :method: to_nfd
19
+ # Converts the string to NFD.
20
+
21
+ # :method: to_nfkc
22
+ # Converts the string to NFKC.
23
+
24
+ # :method: to_nfkd
25
+ # Converts the string to NFKD.
26
+
15
27
  [:nfc, :nfd, :nfkc, :nfkd].each { |form|
16
28
  eval %{
17
29
  def to_#{form.to_s}
@@ -4,14 +4,33 @@ else
4
4
  require 'unf/normalizer_cruby'
5
5
  end
6
6
 
7
+ # UTF-8 string normalizer class. Implementations may vary depending
8
+ # on the platform.
7
9
  class UNF::Normalizer
8
10
  class << self
11
+ # :singleton-method: new
12
+ # :call-seq:
13
+ # new
14
+ # instance
15
+ #
16
+ # Returns a normalizer instance.
17
+
18
+ # :stopdoc:
9
19
  def instance
10
20
  @@normalizer ||= new
11
21
  end
22
+ # :startdoc:
12
23
 
24
+ # A shortcut for new.normalize(string, form).
13
25
  def normalize(string, form)
14
26
  instance.normalize(string, form)
15
27
  end
16
28
  end
29
+
30
+ # :method: normalize
31
+ # :call-seq:
32
+ # normalize(string, form)
33
+ #
34
+ # Normalizes a UTF-8 string into a given form (:nfc, :nfd, :nfkc or
35
+ # :nfkd).
17
36
  end
@@ -1,6 +1,6 @@
1
1
  require 'java'
2
2
 
3
- module UNF
3
+ module UNF # :nodoc: all
4
4
  class Normalizer
5
5
  def initialize()
6
6
  @normalizer = java.text.Normalizer
@@ -1,3 +1,3 @@
1
1
  module UNF
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -2,6 +2,8 @@
2
2
  require File.expand_path('../lib/unf/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
+ gem.name = "unf"
6
+ gem.version = UNF::VERSION
5
7
  gem.authors = ["Akinori MUSHA"]
6
8
  gem.email = ["knu@idaemons.org"]
7
9
  gem.description = <<-'EOS'
@@ -15,9 +17,8 @@ to Ruby/JRuby.
15
17
  gem.files = `git ls-files`.split("\n")
16
18
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
19
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/.*\.rb})
18
- gem.name = "unf"
19
20
  gem.require_paths = ["lib"]
20
- gem.version = UNF::VERSION
21
+ gem.extra_rdoc_files = ['README.md', 'LICENSE']
21
22
 
22
23
  gem.add_dependency 'unf_ext', '>= 0' unless defined?(JRUBY_VERSION)
23
24
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akinori MUSHA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-17 00:00:00.000000000 Z
11
+ date: 2013-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unf_ext
@@ -87,7 +87,9 @@ email:
87
87
  - knu@idaemons.org
88
88
  executables: []
89
89
  extensions: []
90
- extra_rdoc_files: []
90
+ extra_rdoc_files:
91
+ - README.md
92
+ - LICENSE
91
93
  files:
92
94
  - .gitignore
93
95
  - .travis.yml