指定した文字数の日本語文字列をランダムで出力するライブラリです. 出力文字は,ひらがな,カタカナ,常用漢字,それらの統合どれかを選択できます. テストなどに使ってください.
RandomJapaneseString generate random Japanese strings in certain length which you set. Strings are Kanji, Hiragana, Katakana or mix. Kanji is only daily-usage. You can use it in test.
ruby
- 1.9.2
- 1.9.3
- 2.0.0
Add this line to your application's Gemfile:
gem 'random_japanese_string'
And then execute:
$ bundle
Or install it yourself as:
$ gem install random_japanese_string
require 'random_japanese_string'
rj = RandomJapaneseString.new
rj.katakana(10) # => "バユョヅオセミハシャ"
rj.hiragana(10) # => "まかぞぬざぶゃでばる"
rj.kanji(10) # => "撤絵占署拓燃価態小誉"
rj.generate(10) # => "みほ峠対涙塗ガ友そる"
or
require 'random_japanese_string'
RandomJapaneseString.katakana(10)
RandomJapaneseString.hiragana(10)
RandomJapaneseString.kanji(10)
RandomJapaneseString.generate(10)
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- Bundle it (
bundle --path vendor/bundle --binstubs .bundle/bin
) - Build it (
gem build random_japanese_string.gemspec
) - Push it (
gem push random_japanese_sgring-X.X.X.gem
)- To push, you should install gemcutter (
gem install gemcutter
)
- To push, you should install gemcutter (