# Rubicure (Ruby + Precure) [![Gem Version](https://badge.fury.io/rb/rubicure.png)](http://badge.fury.io/rb/rubicure) [![Build Status](https://travis-ci.org/sue445/rubicure.png?branch=master)](https://travis-ci.org/sue445/rubicure) [![Code Climate](https://codeclimate.com/github/sue445/rubicure.png)](https://codeclimate.com/github/sue445/rubicure) [![Coverage Status](https://coveralls.io/repos/sue445/rubicure/badge.png)](https://coveralls.io/r/sue445/rubicure) All about Japanese battle heroine "Pretty Cure (Precure)". Inspired by [Acme::PrettyCure](http://perl-users.jp/articles/advent-calendar/2010/acme/6) and [pycure](https://github.com/drillbits/pycure). [![Stories in Ready](https://badge.waffle.io/sue445/rubicure.png?label=ready)](http://waffle.io/sue445/rubicure) [![endorse](https://api.coderwall.com/sue445/endorsecount.png)](https://coderwall.com/sue445) ## Requirements * ruby >= 2.0.0 ## Installation Add this line to your application's Gemfile: gem 'rubicure' And then execute: $ bundle Or install it yourself as: $ gem install rubicure ## Usage ```ruby § irb require "rubicure" ``` ### Select own precure series ```ruby Precure.title #=> "ふたりはプリキュア" Precure.unmarked.title #=> "ふたりはプリキュア" Precure.max_heart.title #=> "ふたりはプリキュア Max Heart" Precure.splash_star.title #=> "ふたりはプリキュア Splash Star" Precure.yes.title #=> "Yes! プリキュア5" Precure.yes_gogo.title #=> "Yes! プリキュア5 Go Go!" Precure.fresh.title #=> "フレッシュプリキュア!" Precure.heart_catch.title #=> "ハートキャッチプリキュア!" Precure.suite.title #=> "スイートプリキュア♪" Precure.smile.title #=> "スマイルプリキュア!" Precure.dokidoki.title #=> "ドキドキ!プリキュア" Precure.dokidoki #=> {:title=>"ドキドキ!プリキュア", :started_date=>Sun, 03 Feb 2013, :ended_date=>Sun, 26 Jan 2014, :girls=>["cure_heart", "cure_diamond", "cure_rosetta", "cure_sword", "cure_ace"]} ``` other pattern ```ruby Precure.find(:smile).title #=> "スマイルプリキュア!" ``` and [more aliases!](config/series.yml) ### Get current precure series `Precure#now` (alias to `#current` ) return current precure series ```ruby Precure.now #=> {:title=>"ドキドキ!プリキュア", :started_date=>Sun, 03 Feb 2013, :ended_date=>Sun, 26 Jan 2014, :girls=>["cure_heart", "cure_diamond", "cure_rosetta", "cure_sword", "cure_ace"]} Precure.current #=> {:title=>"ドキドキ!プリキュア", :started_date=>Sun, 03 Feb 2013, :ended_date=>Sun, 26 Jan 2014, :girls=>["cure_heart", "cure_diamond", "cure_rosetta", "cure_sword", "cure_ace"]} # -2013/1/27 : smile precure # 2013/2/5 - : dokidoki precure require "delorean" Delorean.time_travel_to "2013-02-01" Precure.now #=> RuntimeError: Not on air precure! ``` ### Rubicure::Series#on_air? ```ruby Precure.dokidoki.on_air?("2013-12-16") #=> true Precure.smile.on_air?("2013-12-16") #=> false ``` ### Rubicure::Series#girls ```ruby Precure.smile.girls #=> [#, #, #, #, #] Precure.smile.girls.map(&:human_name) #=> ["星空みゆき", "日野あかね", "黄瀬やよい", "緑川なお", "青木れいか"] Precure.smile.girls.map(&:precure_name) #=> ["キュアハッピー", "キュアサニー", "キュアピース", "キュアマーチ", "キュアビューティ"] Precure.smile.girls.count #=> 5 ``` ### Select own precure girl ```ruby Cure.lemonade #=> # Cure.pine #=> # Cure.sunshine #=> # Cure.muse #=> # Cure.peace #=> # Cure.rosetta #=> # Shiny.luminous #=> # Milky.rose #=> # ``` and [more aliases!](config/girls.yml) ### Rubicure::Girl ```ruby # these are same yayoi = Cure.peace yayoi = Precure.smile.girls[2] yayoi.name #=> "黄瀬やよい" yayoi.transform! (レディ?) プリキュア・スマイルチャージ! (ゴー!ゴー!レッツ・ゴー!ピース!!) ピカピカピカリンジャンケンポン! キュアピース! 5つの光が導く未来! 輝け!スマイルプリキュア! # 1st transform yayoi.name #=> "キュアピース" # 2st transform yayoi.transform! yayoi.name #=> "プリンセスピース" # final transform yayoi.transform! yayoi.name #=> "ウルトラピース" # back to human yayoi.transform!.transform! yayoi.name #=> "プリンセスピース" yayoi.humanize #=> 0 yayoi.name #=> "黄瀬やよい" ``` ### Precure allstars ```ruby Precure.all_stars.count #=> 33 Precure.all_stars.map(&:precure_name) #=> ["キュアブラック", "キュアホワイト", "シャイニールミナス", "キュアブルーム", "キュアイーグレット", "キュアドリーム", "キュアルージュ", "キュアレモネード", "キュアミント", "キュアアクア", "ミルキィローズ", "キュアピーチ", "キュアベリー", "キュアパイン", "キュアパッション", "キュアブロッサム", "キュアマリン", "キュアサンシャイン", "キュアムーンライト", "キュアメロディ", "キュアリズム", "キュアビート", "キュアミューズ", "キュアハッピー", "キュアサニー", "キュアピース", "キュアマーチ", "キュアビューティ", "キュアハート", "キュアダイヤモンド", "キュアロゼッタ", "キュアソード", "キュアエース"] ``` ### Equivalence ```ruby yayoi = Cure.peace.dup cure_peace = Cure.peace.dup.transform! yayoi == cure_peace #=> true ``` ```ruby precure = Rubicure::Girl.find(:passion) case precure when Precure.dokidoki puts "The girl is a member of Dokidoki! Precure" when Precure.fresh puts "The girl is a member of Fresh Precure!" else puts "The girl is not which member of Dokidoki! Precure and Fresh Precure!" end ``` ## More reference http://rubydoc.info/github/sue445/rubicure/ ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request