Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impl Precure.miracle_leap #243

Merged
merged 1 commit into from
Oct 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,15 @@ and [more aliases!](config/movies.yml)
=> ["キュアホイップ", "キュアカスタード", "キュアジェラート", "キュアマカロン", "キュアショコラ", "キュアパルフェ", "キュアエール", "キュアアンジュ", "キュアエトワール", "キュアマシェリ", "キュアアムール", "キュアスター", "キュアミルキー", "キュアソレイユ", "キュアセレーネ"]
```

### `Precure.miracle_leap`
```ruby
>> Precure.miracle_leap.count
=> 13

>> Precure.miracle_leap.map(&:precure_name)
=> ["キュアエール", "キュアアンジュ", "キュアエトワール", "キュアマシェリ", "キュアアムール", "キュアスター", "キュアミルキー", "キュアソレイユ", "キュアセレーネ", "キュアコスモ", "キュアグレース", "キュアフォンテーヌ", "キュアスパークル"]
```

### Equivalence
```ruby
>> yayoi = Cure.peace.dup
Expand Down
4 changes: 4 additions & 0 deletions config/movies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,7 @@ memories: &memories
miracle_universe: &miracle_universe
title: 映画プリキュアミラクルユニバース
started_date: 2019-03-16
#######################################################
miracle_leap: &miracle_leap
title: 映画プリキュアミラクルリープ
started_date: 2020-10-31
23 changes: 23 additions & 0 deletions lib/rubicure/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,29 @@ def miracle_universe

@miracle_universe
end

# Get precure miracle leap
#
# @return [Array<Rubicure::Girl>] precure miracle leap
#
# @example
# Precure.miracle_leap.count
# #=> 13
#
# Precure.miracle_leap.map(&:precure_name)
# #=> ["キュアエール", "キュアアンジュ", "キュアエトワール", "キュアマシェリ", "キュアアムール", "キュアスター", "キュアミルキー", "キュアソレイユ", "キュアセレーネ", "キュアグレース", "キュアフォンテーヌ", "キュアスパークル"]
def miracle_leap
return @miracle_leap if @miracle_leap

girls = Precure.hugtto.girls + Precure.star_twinkle.girls + Precure.healingood.girls

miracle_leap_date = Rubicure::Movie.find(:miracle_leap).started_date
@miracle_leap = girls.select {|girl| girl.created_date && girl.created_date <= miracle_leap_date }
@miracle_leap.reject! {|girl| girl == Cure.earth }

@miracle_leap
end

# rubocop:enable Metrics/LineLength

# iterate with :unmarked, :max_heart, ...
Expand Down
24 changes: 24 additions & 0 deletions spec/rubicure/core_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,28 @@

it { should contain_exactly(*miracle_universe_girl_names) }
end

describe "#miracle_leap" do
subject { Precure.miracle_leap.map(&:girl_name) }

let(:miracle_leap_girl_names) do
[
Cure.yell,
Cure.ange,
Cure.etoile,
Cure.macherie,
Cure.amour,
Cure.star,
Cure.milky,
Cure.soleil,
Cure.selene,
Cure.cosmo,
Cure.grace,
Cure.fontaine,
Cure.sparkle,
].map(&:girl_name)
end

it { should contain_exactly(*miracle_leap_girl_names) }
end
end
1 change: 1 addition & 0 deletions spec/rubicure/movie_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
:super_stars,
:memories,
:miracle_universe,
:miracle_leap,
]
end

Expand Down