hawaiian 0.1.0

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/hawaiian.rb +42 -0
  3. metadata +45 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: efcfdd94897525e66b946eeabaf67324e17053a4
4
+ data.tar.gz: 966c15b435bfa33eedf07077474dc9f1770cf4e5
5
+ SHA512:
6
+ metadata.gz: 1b75d12f4ca552a705ca8eff627779b06251163629c149b0dc2c187290a898084bd9d3d026c96e73e490b0774d0671e6f94c14087e7f7f686d02b292248f9e66
7
+ data.tar.gz: fabc78f731ac7b6a24f6a1eae1a8fa75667b84baae63381afffa447dcfef9fb49bb4f9f8df78cfc437555d05f81b2b533d91c44925e3e5d4ce685cfb871a7809
@@ -0,0 +1,42 @@
1
+ class Hawaiian
2
+ @@character_substitutions = {
3
+ "ʻ" => "‘",
4
+ "ā" => "ā",
5
+ "ē" => "ē",
6
+ "ī" => "ī",
7
+ "ō" => "ō",
8
+ "ū" => "ū",
9
+ "Ā" => "Ā",
10
+ "Ē" => "Ē",
11
+ "Ī" => "Ī",
12
+ "Ō" => "Ō",
13
+ "Ū" => "Ū",
14
+ "ō" => "ō",
15
+ "ā" => "ā",
16
+ "Ō" => "Ō",
17
+ }
18
+
19
+ def initialize
20
+ end
21
+
22
+ def self.hawaiian?( text )
23
+ @@character_substitutions.each do |haw,code|
24
+ return true if text.include?( haw )
25
+ end
26
+ return false
27
+ end
28
+
29
+ def self.encode_html( text )
30
+ @@character_substitutions.each do |haw,code|
31
+ text.gsub!(haw,code)
32
+ end
33
+ text
34
+ end
35
+
36
+ end
37
+
38
+ class String
39
+ def hawaiian?
40
+ Hawaiian::hawaiian?( self )
41
+ end
42
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hawaiian
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Patrick Sereno
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-07-09 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: This gem is designed to allow the Hawaiian language to be used with ruby. The
14
+ current implementation only supports conversion to html.
15
+ email: patrick@serenofamily.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/hawaiian.rb
21
+ homepage: http://6orbits.com/gems/hawaiian
22
+ licenses:
23
+ - GPLv3
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.2.2
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: A library for using the Hawaiian alphabet.
45
+ test_files: []