yazawa 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/README.md +11 -6
- data/lib/yazawa/ize.rb +16 -0
- data/lib/yazawa/version.rb +1 -1
- data/test/test_yazawa.rb +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87cb526d61a6016d21c34406d9c9cd03498c47f1
|
4
|
+
data.tar.gz: f246d49aa718e16576b41ea79074e974c0e5de0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00733befd8330511c3beaa7a14f4da75c36e083f0321ce726928505d6762d2ddb4d303c92fbe02443fd5182eccc425286c7de2462d2ab3511a9289c9880de5f1
|
7
|
+
data.tar.gz: 086f83ca25e37dfe90d430d1cf929c24aed5836b3bbee93477de942d71b5a4bae9c2c67a09cd6a1ab6e55032dd690ce47f53e1d78ace1bd2aecd8bd9bd91aeb9
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# YAZAWA
|
2
2
|
[](http://badge.fury.io/rb/yazawa) [](https://travis-ci.org/toooooooby/yazawa) [](https://gemnasium.com/toooooooby/yazawa) [](https://codeclimate.com/github/toooooooby/yazawa) [](https://coveralls.io/r/toooooooby/yazawa)
|
3
3
|
|
4
|
+

|
5
|
+
|
4
6
|
**『YAZAWA』** is one of `text-converter`, like [Yazawa](http://en.wikipedia.org/wiki/Eikichi_Yazawa).
|
5
7
|
|
6
8
|
```bash
|
@@ -60,12 +62,15 @@ require 'yazawa'
|
|
60
62
|
|
61
63
|
p Yazawa.convert('俺達の熱意で世界が変わる') # => '俺達の『NETSUI』で世界が変わる'
|
62
64
|
p Yazawa.convert('俺達の熱意で世界が変わる', at_random: true) # => '俺達の熱意で『SEKAI』が変わる'
|
65
|
+
|
63
66
|
```
|
64
67
|
|
65
|
-
|
68
|
+
If you want to use String#to_yazawa:
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
require 'yazawa/ize'
|
72
|
+
|
73
|
+
p '俺達の熱意で世界が変わる'.to_yazawa # => '俺達の『NETSUI』で世界が変わる'
|
74
|
+
p '俺達の熱意で世界が変わる'.to_yazawa(at_random: true) # => '俺達の熱意で『SEKAI』が変わる'
|
75
|
+
```
|
66
76
|
|
67
|
-
1. Fork it ( http://github.com/toooooooby/yazawa/fork )
|
68
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
69
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
70
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
71
|
-
5. Create new Pull Request
|
data/lib/yazawa/ize.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
require "yazawa"
|
5
|
+
|
6
|
+
class String
|
7
|
+
# For example
|
8
|
+
#
|
9
|
+
# require "yazawa/ize"
|
10
|
+
#
|
11
|
+
# p '俺達の熱意で世界が変わる'.to_yazawa # => '俺達の『NETSUI』で世界が変わる'
|
12
|
+
# p '俺達の熱意で世界が変わる'.to_yazawa(at_random: true) # => '俺達の熱意で『SEKAI』が変わる'
|
13
|
+
def to_yazawa(*options)
|
14
|
+
YAZAWA.convert(self, *options)
|
15
|
+
end
|
16
|
+
end
|
data/lib/yazawa/version.rb
CHANGED
data/test/test_yazawa.rb
CHANGED
@@ -8,6 +8,7 @@ require 'minitest/autorun'
|
|
8
8
|
begin require 'minitest/pride' rescue LoadError end # Ignore error for old ruby
|
9
9
|
|
10
10
|
require_relative '../lib/yazawa'
|
11
|
+
require_relative '../lib/yazawa/ize'
|
11
12
|
|
12
13
|
describe 'YAZAWA' do
|
13
14
|
TEST_FIXTURES = [
|
@@ -50,6 +51,10 @@ describe 'YAZAWA' do
|
|
50
51
|
YAZAWA.convert(text[:original]).must_equal text[:converted]
|
51
52
|
end
|
52
53
|
|
54
|
+
it "can converts text with String#to_yazawa(#{text[:original].slice(0..9)}...)" do
|
55
|
+
text[:original].to_yazawa.must_equal text[:converted]
|
56
|
+
end
|
57
|
+
|
53
58
|
it "can separate words in Japanese with spaces(#{text[:original].slice(0..9)}...)" do
|
54
59
|
YAZAWA.separate_words(text[:original]).must_equal text[:separated]
|
55
60
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yazawa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toooooooby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mecab-light
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- Rakefile
|
97
97
|
- bin/yazawa
|
98
98
|
- lib/yazawa.rb
|
99
|
+
- lib/yazawa/ize.rb
|
99
100
|
- lib/yazawa/version.rb
|
100
101
|
- test/test_yazawa.rb
|
101
102
|
- yazawa.gemspec
|