haikunator, Heroku像随机名称生成器

分享于 

2分钟阅读

GitHub

  繁體 雙語
Heroku-like random name generator with a geopolitical twist.
  • 源代码名称:haikunator
  • 源代码网址:http://www.github.com/usmanbashir/haikunator
  • haikunator源代码文档
  • haikunator源代码下载
  • Git URL:
    git://www.github.com/usmanbashir/haikunator.git
    Git Clone代码到本地:
    git clone http://www.github.com/usmanbashir/haikunator
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/usmanbashir/haikunator
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    
    Haikunator

    Gem VersionBuild StatusCoverage Status

    在应用程序或者其他任何地方,生成像难忘的随机名称。

    安装

    将此行添加到你的应用程序的Gemfile中:

     
    gem 'haikunator'
    
    
    
     

    然后执行:

     
    $ bundle
    
    
    
     

    或者将它的自己安装为:

    
    $ gem install haikunator
    
    
    
    

    用法

    Haikunator非常简单。没有任何配置,它只有一个方法 .haikunate:

    Haikunator.haikunate # =>"rough-snowflake-1142"# Token rangeHaikunator.haikunate(100) # =>"nameless-star-13"# Don't include the tokenHaikunator.haikunate(0) # =>"long-flower"# Use a different delimiterHaikunator.haikunate(9999, '.') # =>"cool.leaf.6743"# No token, no delimiterHaikunator.haikunate(0, '') # =>"green fire"

    鼓励大家帮助改进这个项目。 以下是你可以帮助的几种方法:

    语言端口

    Haikunator也被移植到其他语言。 但是,这些项目并不是与我兼容或者支持的,但是请检查它们: