romankana 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,5 +8,5 @@ require directory+'/romankana/k2r.rb'
8
8
  require directory+'/romankana/romankana.rb'
9
9
 
10
10
  module RomanKana
11
- VERSION = '0.1.2'
11
+ VERSION = '0.1.3'
12
12
  end
@@ -19,6 +19,9 @@ module RomanKana
19
19
  elsif buff.length >=2 and buff[0] == 'n' and buff[1] !~ /[aeiouy]/
20
20
  ret += 'ン'
21
21
  buff.shift
22
+ elsif i == array.length and buff[0] == 'n'
23
+ ret += 'ン'
24
+ buff.shift
22
25
  elsif buff.length >=2 and buff[0] == 'm' and buff[1] =~ /[bmp]/
23
26
  ret += 'ン'
24
27
  buff.shift
@@ -55,6 +58,10 @@ module RomanKana
55
58
  ret << a
56
59
  buff.clear
57
60
  next if i == array.length
61
+ elsif a = RomanKana::K2R_table_2[buff[0]]
62
+ ret << a
63
+ buff.shift
64
+ next if i == array.length
58
65
  elsif buff.length >= 2 && a = RomanKana::K2R_table_1[buff[0,buff.length-1].join('')]
59
66
  ret << a
60
67
  (buff.length-1).times{buff.shift}
@@ -5,6 +5,6 @@ irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
5
5
  libs = " -r irb/completion"
6
6
  # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
7
  # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
- libs << " -r #{File.dirname(__FILE__) + '/../lib/romankana.rb'}"
8
+ libs << " -r #{File.expand_path(File.dirname(__FILE__) + '/../lib/romankana.rb')}"
9
9
  puts "Loading romankana gem"
10
- exec "#{irb} #{libs} --simple-prompt"
10
+ exec "#{irb} #{libs} --simple-prompt"
@@ -1,13 +1,31 @@
1
+ #coding:UTF-8
1
2
  #require File.dirname(__FILE__) + '/spec_helper.rb'
2
3
  puts File.expand_path(File.dirname(__FILE__))
3
4
  require 'spec_helper.rb'
4
5
 
5
6
  # Time to add your specs!
6
7
  # http://rspec.info/
7
- describe "Place your specs here" do
8
-
9
- it "find this spec in spec directory" do
10
- # violated "Be sure to write your specs"
8
+ describe "Roman to Kana" do
9
+ it 'can convert roman to katakana' do
10
+ 'osakana'.to_katakana.should be_eql('オサカナ')
11
+ 'nippori'.to_katakana.should be_eql('ニッポリ')
12
+ 'kouenji'.to_katakana.should be_eql('コウエンジ')
13
+ 'nisinippori'.to_katakana.should be_eql('ニシニッポリ')
14
+ 'nishinippori'.to_katakana.should be_eql('ニシニッポリ')
15
+ 'dojou'.to_katakana.should be_eql('ドジョウ')
16
+ 'himonnya'.to_katakana.should be_eql('ヒモンヤ')
17
+ 'evangerion'.to_katakana.should be_eql('エヴァンゲリオン')
18
+ 'nyaruratohoteppu'.to_katakana.should be_eql('ニャルラトホテップ')
19
+ end
20
+ end
21
+ describe "Katakana to Roman" do
22
+ it 'can convert roman to katakana' do
23
+ 'オサカナ'.to_roman.should be_eql('osakana')
24
+ 'ニッポリ'.to_roman.should be_eql('nippori')
25
+ 'コウエンジ'.to_roman.should be_eql('kouenji')
26
+ 'ニシニッポリ'.to_roman.should be_eql('nishinippori')
27
+ 'ドジョウ'.to_roman.should be_eql('dojou')
28
+ 'エヴァンゲリオン'.to_roman.should be_eql('evangerion')
29
+ 'ニャルラトホテップ'.to_roman.should be_eql('nyaruratohoteppu')
11
30
  end
12
-
13
31
  end
@@ -14,8 +14,8 @@ EOS
14
14
  exit(0)
15
15
  end
16
16
 
17
- desc "Run the specs under spec/models"
18
- RSpec::Core::RakeTask.new do |t|
19
- t.rspec_opts = ['--options', "spec/spec.opts"]
20
- t.pattern = 'spec/**/*_spec.rb'
21
- end
17
+ #desc "Run the specs under spec/models"
18
+ #RSpec::Core::RakeTask.new do |t|
19
+ # t.rspec_opts = ['--options', "spec/spec.opts"]
20
+ # t.pattern = 'spec/**/*_spec.rb'
21
+ #end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: romankana
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-16 00:00:00.000000000Z
12
+ date: 2012-05-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdoc
16
- requirement: &68818170 !ruby/object:Gem::Requirement
16
+ requirement: &72014840 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.10'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *68818170
24
+ version_requirements: *72014840
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: newgem
27
- requirement: &68816790 !ruby/object:Gem::Requirement
27
+ requirement: &72014310 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,18 +32,18 @@ dependencies:
32
32
  version: 1.5.3
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *68816790
35
+ version_requirements: *72014310
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hoe
38
- requirement: &68815960 !ruby/object:Gem::Requirement
38
+ requirement: &72013420 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
42
42
  - !ruby/object:Gem::Version
43
- version: '2.15'
43
+ version: '3.0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *68815960
46
+ version_requirements: *72013420
47
47
  description: Roman Alphabet <-> Japanese Hiragana/Katkakana Convert Library for Ruby
48
48
  email:
49
49
  - ymrl@ymrl.net
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  requirements: []
97
97
  rubyforge_project: romankana
98
- rubygems_version: 1.8.17
98
+ rubygems_version: 1.8.11
99
99
  signing_key:
100
100
  specification_version: 3
101
101
  summary: Roman Alphabet <-> Japanese Hiragana/Katkakana Convert Library for Ruby