keigo 0.0.2 → 0.0.3

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.
data/.autotest ADDED
@@ -0,0 +1,5 @@
1
+ Autotest.add_hook :initialize do |at|
2
+ at.add_mapping(/keigo.yml/, true) do |f, m|
3
+ Dir.glob 'spec/**/*.rb'
4
+ end
5
+ end
data/README.rdoc CHANGED
@@ -1,9 +1,30 @@
1
1
  = keigo
2
2
 
3
- Description goes here.
3
+ keigo translates Japanese to polite expressions.
4
+
5
+ == DESCRIPTION
6
+
7
+ keigo translates Japanese into polite expressions.
8
+
9
+ == INSTALL
10
+
11
+ gem install keigo
12
+
13
+ == USAGE
14
+
15
+ require 'keigo'
16
+
17
+ Keigo.new.sama 'Alice'
18
+ # => 'Alice様'
19
+
20
+ Keigo.new.k '今日こいつが来る。'
21
+ # => '本日こちらさまがおいでになる。'
22
+
23
+ k 'あいつが今日から本を読む。'
24
+ # => 'あちらさまが本日から本をお読みになる。'
4
25
 
5
26
  == Contributing to keigo
6
-
27
+
7
28
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
29
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
30
  * Fork the project
@@ -14,6 +35,5 @@ Description goes here.
14
35
 
15
36
  == Copyright
16
37
 
17
- Copyright (c) 2011 kano4. See LICENSE.txt for
18
- further details.
38
+ Copyright (c) 2011 kano4. See LICENSE.txt for further details.
19
39
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/keigo.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{keigo}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{kano4}]
12
- s.date = %q{2011-08-10}
12
+ s.date = %q{2011-08-11}
13
13
  s.description = %q{This is a polite expression gem.}
14
14
  s.email = %q{shinji@kano4.com}
15
15
  s.extra_rdoc_files = [
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
17
17
  "README.rdoc"
18
18
  ]
19
19
  s.files = [
20
+ ".autotest",
20
21
  ".document",
21
22
  ".rspec",
22
23
  "Gemfile",
data/keigo.yml CHANGED
@@ -1,5 +1,36 @@
1
1
  # encoding: utf-8
2
- '今日' : '本日'
3
- 'わたしたち': 'わたくしども'
4
- 'わたし' : 'わたくし'
5
- '' : 'わたくし'
2
+ # 名詞
3
+ わたしたち: わたくしども
4
+ わたし : わたくし
5
+ 俺 : わたくし
6
+ あんた : あなたさま
7
+ おまえ : あなたさま
8
+ こいつ : こちらさま
9
+ そいつ : そちらさま
10
+ あいつ : あちらさま
11
+ どいつ : どちらさま
12
+ 今日 : 本日
13
+
14
+ # 動詞
15
+ 言う : おっしゃる
16
+ 思う : 思われる
17
+ 書く : お書きになる
18
+ 考える : お考えになる
19
+ 見る : ご覧になる
20
+ 聞く : お聞きになる
21
+ 会う : お会いになる
22
+ 行く : 行かれる
23
+ 来る : おいでになる
24
+ 尋ねる : お尋ねになる
25
+ 与える : お与えになる
26
+ もらう : お受けになる
27
+ 知る : お知りになる
28
+ 食べる : お食べになる
29
+ 着る : 着られる
30
+ 読む : お読みになる
31
+ 送る : お送りになる
32
+ 贈る : お贈りになる
33
+ 買う : お買いになる
34
+ 飲む : 飲まれる
35
+ いる : いらっしゃる
36
+ する : される
data/spec/keigo_spec.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
3
+ require 'yaml'
4
+ $keigo_henkan = YAML.load_file(File.dirname(__FILE__) + '/../keigo.yml')
3
5
 
4
6
  describe 'Keigo' do
5
7
  before(:each) do
@@ -14,14 +16,20 @@ describe 'Keigo' do
14
16
  sama('Keigo').should be_eql 'Keigo様'
15
17
  end
16
18
 
17
- it { @keigo.k('こんにちわ').should be_eql 'こんにちわ' }
18
- it { @keigo.k('わたくし').should be_eql 'わたくし' }
19
+ context 'は、変換後に登録されていない場合' do
20
+ it { k('こんにちわ').should be_eql 'こんにちわ' }
21
+ it { k('わたくし').should be_eql 'わたくし' }
22
+ end
23
+
24
+ context 'は、変換語に登録されている場合' do
25
+ @keigo_henkan = $keigo_henkan
19
26
 
20
- it { @keigo.k('わたしたち').should be_eql 'わたくしども' }
21
- it { @keigo.k('わたし').should be_eql 'わたくし' }
22
- it { @keigo.k('今日').should be_eql '本日' }
27
+ @keigo_henkan.each do |key, keigo|
28
+ it { k(key).should be_eql keigo }
29
+ end
23
30
 
24
- it { @keigo.k('わたしは今日は外出いたします。').should be_eql 'わたくしは本日は外出いたします。' }
31
+ it { k('あいつが今日来る。').should be_eql 'あちらさまが本日おいでになる。' }
25
32
 
26
- it { k('わたし').should be_eql 'わたくし' }
33
+ it { @keigo.k('わたし').should be_eql 'わたくし' }
34
+ end
27
35
  end
data/spec/spec_helper.rb CHANGED
@@ -6,7 +6,3 @@ require 'keigo'
6
6
  # Requires supporting files with custom matchers and macros, etc,
7
7
  # in ./support/ and its subdirectories.
8
8
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
-
10
- RSpec.configure do |config|
11
-
12
- end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: keigo
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - kano4
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-08-10 00:00:00 Z
13
+ date: 2011-08-11 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -77,6 +77,7 @@ extra_rdoc_files:
77
77
  - LICENSE.txt
78
78
  - README.rdoc
79
79
  files:
80
+ - .autotest
80
81
  - .document
81
82
  - .rspec
82
83
  - Gemfile
@@ -103,7 +104,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
103
104
  requirements:
104
105
  - - ">="
105
106
  - !ruby/object:Gem::Version
106
- hash: -2381433747295631490
107
+ hash: 3658054192511642163
107
108
  segments:
108
109
  - 0
109
110
  version: "0"