LoginSignup
3
3

More than 5 years have passed since last update.

Ruboty | 西暦年から和暦を出力する ruboty-wareki を作成しました #ruboty

Posted at

Ruboty | 西暦年から和暦を出力する ruboty-wareki を作成しました #ruboty

概要

西暦年から和暦を出力する ruboty-wareki を作成しました

和暦の変換は @tomiacannondale@github さんの era_ja gem を使わせていただきます。

用途

西暦年に対応する和暦を知りたい時に利用します。

Installation

Add this line to your application's Gemfile:

gem 'ruboty-wareki'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ruboty-wareki

Commands

Command Pattern Description
convert /wareki convert (?<year>.\d{4})\z/ get wareki from AD. ※1月1日時点の元号
convert_after /wareki convert_after (?<year>.\d{4})\z/ get wareki from AD. ※12月31日時点の元号

Usage

convert

  • get wareki from AD. ※1月1日時点の元号
>ruboty wareki convert 1868
>明治01年
>ruboty wareki convert 1913
>大正02年
>ruboty wareki convert 1977
>昭和52年
>ruboty wareki convert 1989
>昭和64年
>ruboty wareki convert 1990
>平成02年

convert_after

  • get wareki from AD. ※12月31日時点の元号
>ruboty wareki convert 1868
>明治01年
>ruboty wareki convert 1913
>大正02年
>ruboty wareki convert 1977
>昭和52年
>ruboty wareki convert 1989
>平成01年
>ruboty wareki convert 1990
>平成02年

ENV

Name Description
-- --

Dependency

Name Description
era_ja gem era_ja gem

参照

3
3
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3