hebrew 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hebrew.rb +18 -0
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a8c1321cb8e5040931921ab180b86295427e64f
4
- data.tar.gz: fe567fbdb5384b967dfff2a0b787a1b403433a7a
3
+ metadata.gz: 3d90717862d817405afdf88fbdc31eefbcc90370
4
+ data.tar.gz: 43f84e5a282a698eee70581b68ca96e5c4dc368d
5
5
  SHA512:
6
- metadata.gz: 33ec8188e66991dca122aef6ecbb69a34ab566b79ede6fabce62f6de6975f97eeed2be3b4c176b74f4c1b03da3ef44283bb01017b67c2d3e25c86fb2c5619734
7
- data.tar.gz: 674d5e7ca61a186d7713d245459e4b19b856b0fdc2fc56bd42d557a7e0d0d035ba87b0e194a8f0c5a27a91ffe751d7c247b2b04dda8293b79cf6351cdbb948e3
6
+ metadata.gz: 4c13beabf918c30be2deae92c2cf5e5949c44e8e2a0f7689caa28b2851626d239e835510cdc7c4141aaa5ff22e875f90b5199cb7670f003ed690a642aaf3f8d7
7
+ data.tar.gz: 7f9fd7db90327bad58d00f8fdaae4f03f26fe0cef099ab02115585581f79fb708d5326c01436028afd9beb69d50f7d92d04bb13248d056b666135e4038bc036d
data/lib/hebrew.rb CHANGED
@@ -58,6 +58,24 @@ class String
58
58
  return false
59
59
  end
60
60
  end
61
+
62
+ def falsehood
63
+ false
64
+ end
65
+
66
+ def any_nikkud?
67
+ func = case self.encoding
68
+ when Encoding::UTF_8
69
+ :is_codepoint_nikkud_utf8
70
+ when Encoding::WINDOWS_1255 || Encoding::CP1255
71
+ :is_codepoint_nikkud_cp1255
72
+ else
73
+ :falsehood
74
+ end
75
+ self.each_codepoint{|cp| return true if String.send(func, cp)}
76
+ return false
77
+ end
78
+
61
79
  def is_hebrew_codepoint_cp1255(cp)
62
80
  return ((cp > 191 && cp < 202) or [203, 204, 209, 210].include?(cp))
63
81
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hebrew
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Asaf Bartov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-21 00:00:00.000000000 Z
11
+ date: 2018-01-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Some useful code to identify, transcode, and manipulate Hebrew text
14
14
  email: asaf.bartov@gmail.com
@@ -37,7 +37,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
37
37
  version: '0'
38
38
  requirements: []
39
39
  rubyforge_project:
40
- rubygems_version: 2.4.6
40
+ rubygems_version: 2.6.14
41
41
  signing_key:
42
42
  specification_version: 4
43
43
  summary: Hebrew string manipulation