unicode-block 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "rspec", "~> 2.3.0"
10
+ gem "bundler", "~> 1.0.0"
11
+ gem "jeweler", "~> 1.6.4"
12
+ gem "rcov", ">= 0"
13
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 lpm11
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = unicode-block
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to unicode-block
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2011 lpm11. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile ADDED
@@ -0,0 +1,49 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "unicode-block"
18
+ gem.homepage = "http://github.com/lpm11/unicode-block"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Unicode block list class.}
21
+ gem.description = %Q{Unicode block list class.}
22
+ gem.email = "lpm11r@gmail.com"
23
+ gem.authors = ["lpm11"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rspec/core'
29
+ require 'rspec/core/rake_task'
30
+ RSpec::Core::RakeTask.new(:spec) do |spec|
31
+ spec.pattern = FileList['spec/**/*_spec.rb']
32
+ end
33
+
34
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
35
+ spec.pattern = 'spec/**/*_spec.rb'
36
+ spec.rcov = true
37
+ end
38
+
39
+ task :default => :spec
40
+
41
+ require 'rake/rdoctask'
42
+ Rake::RDocTask.new do |rdoc|
43
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
44
+
45
+ rdoc.rdoc_dir = 'rdoc'
46
+ rdoc.title = "unicode-block #{version}"
47
+ rdoc.rdoc_files.include('README*')
48
+ rdoc.rdoc_files.include('lib/**/*.rb')
49
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0
@@ -0,0 +1,5 @@
1
+ #!/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+ require("../lib/unicode-block.rb");
4
+
5
+ p "test" =~ UnicodeBlock::BASIC_LATIN_REGEXP;
@@ -0,0 +1,108 @@
1
+ #!/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+
4
+ class UnicodeBlock
5
+ BLOCKS = [
6
+ [ 0x0000, 0x007F, "Basic Latin" ],
7
+ [ 0x0080, 0x00FF, "Latin-1 Supplement" ],
8
+ [ 0x0100, 0x017F, "Latin Extended-A" ],
9
+ [ 0x0180, 0x024F, "Latin Extended-B" ],
10
+ [ 0x0250, 0x02AF, "IPA Extensions" ],
11
+ [ 0x02B0, 0x02FF, "Spacing Modifier Letters" ],
12
+ [ 0x0300, 0x036F, "Combining Diacritical Marks" ],
13
+ [ 0x0370, 0x03FF, "Greek" ],
14
+ [ 0x0400, 0x04FF, "Cyrillic" ],
15
+ [ 0x0530, 0x058F, "Armenian" ],
16
+ [ 0x0590, 0x05FF, "Hebrew" ],
17
+ [ 0x0600, 0x06FF, "Arabic" ],
18
+ [ 0x0700, 0x074F, "Syriac" ],
19
+ [ 0x0780, 0x07BF, "Thaana" ],
20
+ [ 0x0900, 0x097F, "Devanagari" ],
21
+ [ 0x0980, 0x09FF, "Bengali" ],
22
+ [ 0x0A00, 0x0A7F, "Gurmukhi" ],
23
+ [ 0x0A80, 0x0AFF, "Gujarati" ],
24
+ [ 0x0B00, 0x0B7F, "Oriya" ],
25
+ [ 0x0B80, 0x0BFF, "Tamil" ],
26
+ [ 0x0C00, 0x0C7F, "Telugu" ],
27
+ [ 0x0C80, 0x0CFF, "Kannada" ],
28
+ [ 0x0D00, 0x0D7F, "Malayalam" ],
29
+ [ 0x0D80, 0x0DFF, "Sinhala" ],
30
+ [ 0x0E00, 0x0E7F, "Thai" ],
31
+ [ 0x0E80, 0x0EFF, "Lao" ],
32
+ [ 0x0F00, 0x0FFF, "Tibetan" ],
33
+ [ 0x1000, 0x109F, "Myanmar" ],
34
+ [ 0x10A0, 0x10FF, "Georgian" ],
35
+ [ 0x1100, 0x11FF, "Hangul Jamo" ],
36
+ [ 0x1200, 0x137F, "Ethiopic" ],
37
+ [ 0x13A0, 0x13FF, "Cherokee" ],
38
+ [ 0x1400, 0x167F, "Unified Canadian Aboriginal Syllabics" ],
39
+ [ 0x1680, 0x169F, "Ogham" ],
40
+ [ 0x16A0, 0x16FF, "Runic" ],
41
+ [ 0x1780, 0x17FF, "Khmer" ],
42
+ [ 0x1800, 0x18AF, "Mongolian" ],
43
+ [ 0x1E00, 0x1EFF, "Latin Extended Additional" ],
44
+ [ 0x1F00, 0x1FFF, "Greek Extended" ],
45
+ [ 0x2000, 0x206F, "General Punctuation" ],
46
+ [ 0x2070, 0x209F, "Superscripts and Subscripts" ],
47
+ [ 0x20A0, 0x20CF, "Currency Symbols" ],
48
+ [ 0x20D0, 0x20FF, "Combining Marks for Symbols" ],
49
+ [ 0x2100, 0x214F, "Letterlike Symbols" ],
50
+ [ 0x2150, 0x218F, "Number Forms" ],
51
+ [ 0x2190, 0x21FF, "Arrows" ],
52
+ [ 0x2200, 0x22FF, "Mathematical Operators" ],
53
+ [ 0x2300, 0x23FF, "Miscellaneous Technical" ],
54
+ [ 0x2400, 0x243F, "Control Pictures" ],
55
+ [ 0x2440, 0x245F, "Optical Character Recognition" ],
56
+ [ 0x2460, 0x24FF, "Enclosed Alphanumerics" ],
57
+ [ 0x2500, 0x257F, "Box Drawing" ],
58
+ [ 0x2580, 0x259F, "Block Elements" ],
59
+ [ 0x25A0, 0x25FF, "Geometric Shapes" ],
60
+ [ 0x2600, 0x26FF, "Miscellaneous Symbols" ],
61
+ [ 0x2700, 0x27BF, "Dingbats" ],
62
+ [ 0x2800, 0x28FF, "Braille Patterns" ],
63
+ [ 0x2E80, 0x2EFF, "CJK Radicals Supplement" ],
64
+ [ 0x2F00, 0x2FDF, "Kangxi Radicals" ],
65
+ [ 0x2FF0, 0x2FFF, "Ideographic Description Characters" ],
66
+ [ 0x3000, 0x303F, "CJK Symbols and Punctuation" ],
67
+ [ 0x3040, 0x309F, "Hiragana" ],
68
+ [ 0x30A0, 0x30FF, "Katakana" ],
69
+ [ 0x3100, 0x312F, "Bopomofo" ],
70
+ [ 0x3130, 0x318F, "Hangul Compatibility Jamo" ],
71
+ [ 0x3190, 0x319F, "Kanbun" ],
72
+ [ 0x31A0, 0x31BF, "Bopomofo Extended" ],
73
+ [ 0x3200, 0x32FF, "Enclosed CJK Letters and Months" ],
74
+ [ 0x3300, 0x33FF, "CJK Compatibility" ],
75
+ [ 0x3400, 0x4DB5, "CJK Unified Ideographs Extension A" ],
76
+ [ 0x4E00, 0x9FFF, "CJK Unified Ideographs" ],
77
+ [ 0xA000, 0xA48F, "Yi Syllables" ],
78
+ [ 0xA490, 0xA4CF, "Yi Radicals" ],
79
+ [ 0xAC00, 0xD7A3, "Hangul Syllables" ],
80
+ # [ 0xD800, 0xDB7F, "High Surrogates" ],
81
+ # [ 0xDB80, 0xDBFF, "High Private Use Surrogates" ],
82
+ # [ 0xDC00, 0xDFFF, "Low Surrogates" ],
83
+ [ 0xE000, 0xF8FF, "Private Use" ],
84
+ [ 0xF900, 0xFAFF, "CJK Compatibility Ideographs" ],
85
+ [ 0xFB00, 0xFB4F, "Alphabetic Presentation Forms" ],
86
+ [ 0xFB50, 0xFDFF, "Arabic Presentation Forms-A" ],
87
+ [ 0xFE20, 0xFE2F, "Combining Half Marks" ],
88
+ [ 0xFE30, 0xFE4F, "CJK Compatibility Forms" ],
89
+ [ 0xFE50, 0xFE6F, "Small Form Variants" ],
90
+ [ 0xFE70, 0xFEFE, "Arabic Presentation Forms-B" ],
91
+ [ 0xFF00, 0xFFEF, "Halfwidth and Fullwidth Forms" ],
92
+ [ 0xFFF0, 0xFFFD, "Specials" ],
93
+ ];
94
+
95
+ BLOCKS.each { |first,last,name|
96
+ blockname = name.gsub(/[\W]/,"_");
97
+ eval %Q{
98
+ # BLOCKNAME_RANGE
99
+ #{blockname.upcase}_RANGE = (#{first}..#{last});
100
+
101
+ # BLOCKNAME_PROP
102
+ #{blockname.upcase}_PROP = "\\\\u{#{first.to_s(16)}}-\\\\u{#{last.to_s(16)}}";
103
+
104
+ # BLOCKNAME_REGEXP
105
+ #{blockname.upcase}_REGEXP = Regexp.compile("[\#{#{blockname.upcase}_PROP}]");
106
+ }
107
+ }
108
+ end
@@ -0,0 +1,12 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'unicode-block'
5
+
6
+ # Requires supporting files with custom matchers and macros, etc,
7
+ # in ./support/ and its subdirectories.
8
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+
12
+ end
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "UnicodeBlock" do
4
+ it "fails" do
5
+ fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: unicode-block
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 1.0.0
6
+ platform: ruby
7
+ authors:
8
+ - lpm11
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-10-11 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rspec
17
+ requirement: &id001 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: 2.3.0
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: bundler
28
+ requirement: &id002 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: jeweler
39
+ requirement: &id003 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ version: 1.6.4
45
+ type: :development
46
+ prerelease: false
47
+ version_requirements: *id003
48
+ - !ruby/object:Gem::Dependency
49
+ name: rcov
50
+ requirement: &id004 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: *id004
59
+ description: Unicode block list class.
60
+ email: lpm11r@gmail.com
61
+ executables: []
62
+
63
+ extensions: []
64
+
65
+ extra_rdoc_files:
66
+ - LICENSE.txt
67
+ - README.rdoc
68
+ files:
69
+ - .document
70
+ - .rspec
71
+ - Gemfile
72
+ - LICENSE.txt
73
+ - README.rdoc
74
+ - Rakefile
75
+ - VERSION
76
+ - example/example1.rb
77
+ - lib/unicode-block.rb
78
+ - spec/spec_helper.rb
79
+ - spec/unicode-block_spec.rb
80
+ homepage: http://github.com/lpm11/unicode-block
81
+ licenses:
82
+ - MIT
83
+ post_install_message:
84
+ rdoc_options: []
85
+
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ hash: -2892583044750942939
94
+ segments:
95
+ - 0
96
+ version: "0"
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ none: false
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: "0"
103
+ requirements: []
104
+
105
+ rubyforge_project:
106
+ rubygems_version: 1.8.10
107
+ signing_key:
108
+ specification_version: 3
109
+ summary: Unicode block list class.
110
+ test_files: []
111
+