rubicure 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2cb2a8c857f3e3485f30d703c25a3f2c8767971
4
- data.tar.gz: 28f9abef9f4c03034451419f48f4a7a6ea73ddc0
3
+ metadata.gz: f9f130802e3c2969cac88a5a1dd29d54a106bb45
4
+ data.tar.gz: 5c5519fff511cabe7773492097db47357476131d
5
5
  SHA512:
6
- metadata.gz: 4a823e83cf0f7f815922743d01cf7a2965c8a28ab597df2320b0669a59b242477a6f0086ffc2312a63b945f368f32ce3c1a729a15cc2a900bed485d4d792cd04
7
- data.tar.gz: 53655e8a12a95f13ca24826d4936270f4d44ccb79a16bb1a219cf99b9902f286b9c9b86cdfcd662a64657b4beebe926a8a03f31c49bc3938911620063b31d6c2
6
+ metadata.gz: 4b5a3d13784460f7ba85edec392a5d876b661e0dabc287bf5f2e5fe1d477cae65721b903cbeb08457eb23b430323c37c4a0b5653c5636043e4a1265f6587cc80
7
+ data.tar.gz: 6ed4ca0d176daf6d52352c03074e279dff8df2200210a81610294157988f621c5a0ab98193d616fd97633d7a2757901ba0362d7f8913945da365f3e9a6671fa8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  ## master
2
- [full changelog](http://github.com/sue445/rubicure/compare/v0.2.0...master)
2
+ [full changelog](http://github.com/sue445/rubicure/compare/v0.2.1...master)
3
+
4
+ ## v0.2.1
5
+ [full changelog](http://github.com/sue445/rubicure/compare/v0.2.0...v0.2.1)
6
+
7
+ * Impl `Girl#cast_name`
8
+ * https://github.com/sue445/rubicure/pull/71
9
+ * Impl `Girl#color`
10
+ * https://github.com/sue445/rubicure/pull/72
11
+ * apply Hashie::Extensions::MethodAccess to Girl
12
+ * https://github.com/sue445/rubicure/pull/69
13
+ * **attention** : `Cure.xxxx` return plain `Hash` instance (not. `Rubicure::Giri`)
3
14
 
4
15
  ## v0.2.0
5
16
  [full changelog](http://github.com/sue445/rubicure/compare/v0.1.4...v0.2.0)
data/README.md CHANGED
@@ -125,7 +125,7 @@ Precure.smile.on_air?("2013-12-16")
125
125
  ### Rubicure::Series#girls
126
126
  ```ruby
127
127
  Precure.smile.girls
128
- #=> [#<Rubicure::Girl:0x007fbd60a5d6e0 @human_name="星空みゆき", @precure_name="キュアハッピー", @transform_message="(レディ?)\nプリキュア・スマイルチャージ!\n(ゴー!ゴー!レッツ・ゴー!ハッピー!!)\nキラキラ輝く未来の光! キュアハッピー!\n5つの光が導く未来!\n輝け!スマイルプリキュア!\n", @extra_names=["プリンセスハッピー", "ウルトラハッピー"], @current_state=0, @state_names=["星空みゆき", "キュアハッピー", "プリンセスハッピー", "ウルトラハッピー"]>, #<Rubicure::Girl:0x007fbd60a5d5c8 @human_name="日野あかね", @precure_name="キュアサニー", @transform_message="(レディ?)\nプリキュア・スマイルチャージ!\n(ゴー!ゴー!レッツ・ゴー!サニー!!)\n太陽サンサン熱血パワー! キュアサニー!\n5つの光が導く未来!\n輝け!スマイルプリキュア!\n", @extra_names=["プリンセスサニー", "ウルトラサニー"], @current_state=0, @state_names=["日野あかね", "キュアサニー", "プリンセスサニー", "ウルトラサニー"]>, #<Rubicure::Girl:0x007fbd60a5d500 @human_name="黄瀬やよい", @precure_name="キュアピース", @transform_message="(レディ?)\nプリキュア・スマイルチャージ!\n(ゴー!ゴー!レッツ・ゴー!ピース!!)\nピカピカピカリンジャンケンポン! キュアピース!\n5つの光が導く未来!\n輝け!スマイルプリキュア!\n", @extra_names=["プリンセスピース", "ウルトラピース"], @current_state=0, @state_names=["黄瀬やよい", "キュアピース", "プリンセスピース", "ウルトラピース"]>, #<Rubicure::Girl:0x007fbd60a5d410 @human_name="緑川なお", @precure_name="キュアマーチ", @transform_message="(レディ?)\nプリキュア・スマイルチャージ!\n(ゴー!ゴー!レッツ・ゴー!マーチ!!)\n勇気リンリン直球勝負! キュアマーチ!\n5つの光が導く未来!\n輝け!スマイルプリキュア!\n", @extra_names=["プリンセスマーチ", "ウルトラマーチ"], @current_state=0, @state_names=["緑川なお", "キュアマーチ", "プリンセスマーチ", "ウルトラマーチ"]>, #<Rubicure::Girl:0x007fbd60a5d320 @human_name="青木れいか", @precure_name="キュアビューティ", @transform_message="(レディ?)\nプリキュア・スマイルチャージ!\n(ゴー!ゴー!レッツ・ゴー!ビューティ!!)\nしんしんと降り積もる清き心! キュアビューティ!\n5つの光が導く未来!\n輝け!スマイルプリキュア!\n", @extra_names=["プリンセスビューティ", "ウルトラビューティ"], @current_state=0, @state_names=["青木れいか", "キュアビューティ", "プリンセスビューティ", "ウルトラビューティ"]>]
128
+ #=> [{:human_name=>"星空みゆき", :precure_name=>"キュアハッピー", :created_date=>Sun, 05 Feb 2012, :transform_message=>"(レディ?)\nプリキュア・スマイルチャージ!\n(ゴー!ゴー!レッツ・ゴー!ハッピー!!)\nキラキラ輝く未来の光! キュアハッピー!\n5つの光が導く未来!\n輝け!スマイルプリキュア!", :extra_names=>["プリンセスハッピー", "ウルトラハッピー"], :attack_messages=>["プリキュア!ハッピーシャワー!!", "開け、ロイヤルクロック!\n(みんなの力を1つにするクル!)\n届け、希望の光!\nはばたけ!光り輝く未来へ!\nプリキュア!ロイヤルレインボーバースト!", "(みんなの力を1つにするクル!)\nプリキュア!ミラクルレインボーバースト!\n輝けー!!\nスマイルプリキュア!!"], :transform_calls=>["smile_charge"]}, {:human_name=>"日野あかね", :precure_name=>"キュアサニー", :created_date=>Sun, 12 Feb 2012, :transform_message=>"(レディ?)\nプリキュア・スマイルチャージ!\n(ゴー!ゴー!レッツ・ゴー!サニー!!)\n太陽サンサン熱血パワー! キュアサニー!\n5つの光が導く未来!\n輝け!スマイルプリキュア!", :extra_names=>["プリンセスサニー", "ウルトラサニー"], :attack_messages=>["プリキュア!サニーファイヤー!!", "開け、ロイヤルクロック!\n(みんなの力を1つにするクル!)\n届け、希望の光!\nはばたけ!光り輝く未来へ!\nプリキュア!ロイヤルレインボーバースト!", "(みんなの力を1つにするクル!)\nプリキュア!ミラクルレインボーバースト!\n輝けー!!\nスマイルプリキュア!!"], :transform_calls=>["smile_charge"]}, {:human_name=>"黄瀬やよい", :precure_name=>"キュアピース", :created_date=>Sun, 19 Feb 2012, :transform_message=>"(レディ?)\nプリキュア・スマイルチャージ!\n(ゴー!ゴー!レッツ・ゴー!ピース!!)\nピカピカピカリンジャンケンポン! キュアピース!\n5つの光が導く未来!\n輝け!スマイルプリキュア!", :extra_names=>["プリンセスピース", "ウルトラピース"], :attack_messages=>["プリキュア!ピースサンダー!!", "開け、ロイヤルクロック!\n(みんなの力を1つにするクル!)\n届け、希望の光!\nはばたけ!光り輝く未来へ!\nプリキュア!ロイヤルレインボーバースト!", "(みんなの力を1つにするクル!)\nプリキュア!ミラクルレインボーバースト!\n輝けー!!\nスマイルプリキュア!!"], :transform_calls=>["smile_charge"]}, {:human_name=>"緑川なお", :precure_name=>"キュアマーチ", :created_date=>Sun, 26 Feb 2012, :transform_message=>"(レディ?)\nプリキュア・スマイルチャージ!\n(ゴー!ゴー!レッツ・ゴー!マーチ!!)\n勇気リンリン直球勝負! キュアマーチ!\n5つの光が導く未来!\n輝け!スマイルプリキュア!", :extra_names=>["プリンセスマーチ", "ウルトラマーチ"], :attack_messages=>["プリキュア!マーチシュート!!", "開け、ロイヤルクロック!\n(みんなの力を1つにするクル!)\n届け、希望の光!\nはばたけ!光り輝く未来へ!\nプリキュア!ロイヤルレインボーバースト!", "(みんなの力を1つにするクル!)\nプリキュア!ミラクルレインボーバースト!\n輝けー!!\nスマイルプリキュア!!"], :transform_calls=>["smile_charge"]}, {:human_name=>"青木れいか", :precure_name=>"キュアビューティ", :created_date=>Sun, 04 Mar 2012, :transform_message=>"(レディ?)\nプリキュア・スマイルチャージ!\n(ゴー!ゴー!レッツ・ゴー!ビューティ!!)\nしんしんと降り積もる清き心! キュアビューティ!\n5つの光が導く未来!\n輝け!スマイルプリキュア!", :extra_names=>["プリンセスビューティ", "ウルトラビューティ"], :attack_messages=>["プリキュア!ビューティブリザード!!", "開け、ロイヤルクロック!\n(みんなの力を1つにするクル!)\n届け、希望の光!\nはばたけ!光り輝く未来へ!\nプリキュア!ロイヤルレインボーバースト!", "(みんなの力を1つにするクル!)\nプリキュア!ミラクルレインボーバースト!\n輝けー!!\nスマイルプリキュア!!"], :transform_calls=>["smile_charge"]}]
129
129
 
130
130
  Precure.smile.girls.map(&:human_name)
131
131
  #=> ["星空みゆき", "日野あかね", "黄瀬やよい", "緑川なお", "青木れいか"]
@@ -140,31 +140,31 @@ Precure.smile.girls.count
140
140
  ### Select own precure girl
141
141
  ```ruby
142
142
  Cure.lemonade
143
- #=> #<Rubicure::Girl:0x007fbd60ae72a0 @human_name="春日野うらら", @precure_name="キュアレモネード", @transform_message="プリキュア!メタモルフォーゼ!\nはじけるレモンの香り、キュアレモネード!\n希望の力と未来の光!\n華麗に羽ばたく5つの心!\nYes!プリキュア5!\n", @extra_names=[], @current_state=0, @state_names=["春日野うらら", "キュアレモネード"]>
143
+ #=> {:human_name=>"春日野うらら", :precure_name=>"キュアレモネード", :created_date=>Sun, 18 Feb 2007, :transform_message=>"プリキュア!メタモルフォーゼ!\nはじけるレモンの香り、キュアレモネード!\n希望の力と未来の光!\n華麗に羽ばたく5つの心!\nYes!プリキュア5", :extra_names=>nil, :attack_messages=>["輝く乙女のはじける力、受けてみなさい!\nプリキュア!プリズム・チェーン!"], :transform_calls=>["metamorphose"]}
144
144
 
145
145
  Cure.pine
146
- #=> #<Rubicure::Girl:0x007fbd60aee640 @human_name="山吹祈里", @precure_name="キュアパイン", @transform_message="チェインジ!プリキュア・ビートアップ!\nイエローハートは祈りのしるし!\nとれたてフレッシュ、キュアパイン!\nレッツプリキュア!\n", @extra_names=["キュアエンジェルパイン"], @current_state=0, @state_names=["山吹祈里", "キュアパイン", "キュアエンジェルパイン"]>
146
+ #=> {:human_name=>"山吹祈里", :precure_name=>"キュアパイン", :created_date=>Sun, 15 Feb 2009, :transform_message=>"チェインジ!プリキュア・ビートアップ!\nイエローハートは祈りのしるし!\nとれたてフレッシュ、キュアパイン!\nレッツプリキュア!", :extra_names=>["キュアエンジェルパイン"], :attack_messages=>["悪いの悪いの飛んでいけ!\nプリキュア!ヒーリングプレアーフレッシュ!"], :transform_calls=>["change_precure_beat_up", "change", "beat_up"]}
147
147
 
148
148
  Cure.sunshine
149
- #=> #<Rubicure::Girl:0x007f83413a6e18 @human_name="明堂院いつき", @precure_name="キュアサンシャイン", @transform_message="(プリキュアの種、いくですぅ!)\nプリキュア!オープンマイハート!\n陽の光浴びる一輪の花! キュアサンシャイン!\nハートキャッチ、プリキュア!\n", @extra_names=["スーパーキュアサンシャイン"], @current_state=0, @state_names=["明堂院いつき", "キュアサンシャイン", "スーパーキュアサンシャイン"]>
149
+ #=> {:human_name=>"明堂院いつき", :precure_name=>"キュアサンシャイン", :created_date=>Sun, 18 Jul 2010, :transform_message=>"(プリキュアの種、いくですぅ!)\nプリキュア!オープンマイハート!\n陽の光浴びる一輪の花! キュアサンシャイン!\nハートキャッチ、プリキュア!", :extra_names=>["スーパーキュアサンシャイン"], :attack_messages=>["花よ、舞い踊れ!\nプリキュア!ゴールドフォルテバースト!!", "花よ、咲き誇れ!\nプリキュア・ハートキャッチ・オーケストラ!!"], :transform_calls=>["open_my_heart"]}
150
150
 
151
151
  Cure.muse
152
- #=> #<Rubicure::Girl:0x007fbd60af7510 @human_name="調辺アコ", @precure_name="キュアミューズ", @transform_message="レッツプレイ!プリキュアモジュレーション!!\n爪弾くは女神の調べ! キュアミューズ!\n響け4人の組曲!スイートプリキュア!\n", @extra_names=["クレッシェンドミューズ"], @current_state=0, @state_names=["調辺アコ", "キュアミューズ", "クレッシェンドミューズ"]>
152
+ #=> {:human_name=>"調辺アコ", :precure_name=>"キュアミューズ", :created_date=>Sun, 16 Oct 2011, :transform_message=>"レッツプレイ!プリキュアモジュレーション!!\n爪弾くは女神の調べ! キュアミューズ!\n届け4人の組曲!スイートプリキュア!", :extra_names=>["クレッシェンドミューズ"], :attack_messages=>["おいで、シリー!\nシの音符の、シャイニングメロディ!\nプリキュア!スパーリングシャワー!!\n三拍子!1、2、3\nフィナーレ!", "届けましょう、希望のシンフォニー!\nプリキュア!スイートセッションアンサンブル!\nクレッシェンド!!\nフィナーレ!"], :transform_calls=>["lets_play_precure_modulation", "lets_play", "modulation"]}
153
153
 
154
154
  Cure.peace
155
- #=> #<Rubicure::Girl:0x007fbd60aceca0 @human_name="黄瀬やよい", @precure_name="キュアピース", @transform_message="(レディ?)\nプリキュア・スマイルチャージ!\n(ゴー!ゴー!レッツ・ゴー!ピース!!)\nピカピカピカリンジャンケンポン! キュアピース!\n5つの光が導く未来!\n輝け!スマイルプリキュア!\n", @extra_names=["プリンセスピース", "ウルトラピース"], @current_state=0, @state_names=["黄瀬やよい", "キュアピース", "プリンセスピース", "ウルトラピース"]>
155
+ #=> {:human_name=>"黄瀬やよい", :precure_name=>"キュアピース", :created_date=>Sun, 19 Feb 2012, :transform_message=>"(レディ?)\nプリキュア・スマイルチャージ!\n(ゴー!ゴー!レッツ・ゴー!ピース!!)\nピカピカピカリンジャンケンポン! キュアピース!\n5つの光が導く未来!\n輝け!スマイルプリキュア!", :extra_names=>["プリンセスピース", "ウルトラピース"], :attack_messages=>["プリキュア!ピースサンダー!!", "開け、ロイヤルクロック!\n(みんなの力を1つにするクル!)\n届け、希望の光!\nはばたけ!光り輝く未来へ!\nプリキュア!ロイヤルレインボーバースト!", "(みんなの力を1つにするクル!)\nプリキュア!ミラクルレインボーバースト!\n輝けー!!\nスマイルプリキュア!!"], :transform_calls=>["smile_charge"]}
156
156
 
157
157
  Cure.rosetta
158
- #=> #<Rubicure::Girl:0x007fbd60af42c0 @human_name="四葉ありす", @precure_name="キュアロゼッタ", @transform_message="プリキュアラブリンク!\nL! O! V! E!\nひだまりポカポカ キュアロゼッタ!\n響け愛の鼓動!ドキドキプリキュア!\n世界を制するのは愛だけです、\nさぁ、あなたも私と愛を育んでくださいな\n", @extra_names=[], @current_state=0, @state_names=["四葉ありす", "キュアロゼッタ"]>
158
+ #=> {:human_name=>"四葉ありす", :precure_name=>"キュアロゼッタ", :created_date=>Sun, 24 Feb 2013, :transform_message=>"プリキュアラブリンク!\nL! O! V! E!\nひだまりポカポカ キュアロゼッタ!\n響け愛の鼓動!ドキドキプリキュア!\n世界を制するのは愛だけです、\nさぁ、あなたも私と愛を育んでくださいな", :extra_names=>nil, :attack_messages=>["カッチカチの!ロゼッタウォール!\n"], :transform_calls=>["love_link"]}
159
159
 
160
160
  Cure.honey
161
- #=> #<Rubicure::Girl:0x007fb041afb768 @human_name="大森ゆうこ", @precure_name="キュアハニー", @transform_message="かわルンルン!\nプリキュアくるりんミラーチェンジ!\n大地に実る命の光!キュアハニー!\nハピネス注入!幸せチャージ!\nハピネスチャージプリキュア!", @extra_names=[], @created_date=Sun, 17 Mar 2013, @current_state=0, @state_names=["大森ゆうこ", "キュアハニー"]>
161
+ #=> {:human_name=>"大森ゆうこ", :precure_name=>"キュアハニー", :created_date=>Sat, 15 Mar 2014, :transform_message=>"(かわルンルン!)\nプリキュアくるりんミラーチェンジ!\n大地に実る命の光!キュアハニー!\nハピネス注入!幸せチャージ!\nハピネスチャージプリキュア!", :extra_names=>["キュアハニー ポップコーンチア"], :attack_messages=>["命の光を聖なる力へ!\nハニーバトン!\nプリキュア!スパークリングバトンアタック!!\nイエイ!\n命よ、天に帰れ!\n(ゴクラ〜ク…)\n", "(かわルンルン!)\nプリキュアくるりんミラーチェンジ!ポップコーンチア!!\nプリキュア!リボンハートエクスプロージョン!!\nビクトリー!!\n", "(かわルンルン!)\nプリキュアくるりんミラーチェンジ!ココナッツサンバ!!\nプリキュア!マラカスリズムスパーク!!\nマンボ!!\n"], :transform_calls=>["kururin_mirror_change"]}
162
162
 
163
163
  Shiny.luminous
164
- #=> #<Rubicure::Girl:0x007fbd60ad7288 @human_name="九条ひかり", @precure_name="シャイニールミナス", @transform_message="ルミナス・シャイニングストリーム!\n輝く命、シャイニールミナス!\n光の心と光の意志、すべてを一つにするために!\n", @extra_names=[], @current_state=0, @state_names=["九条ひかり", "シャイニールミナス"]>
164
+ #=> {:human_name=>"九条ひかり", :precure_name=>"シャイニールミナス", :created_date=>Sun, 06 Mar 2005, :transform_message=>"ルミナス・シャイニングストリーム!\n輝く命、シャイニールミナス!\n光の心と光の意志、すべてを一つにするために!", :extra_names=>nil, :attack_messages=>["光の意志よ!私に勇気を!希望と力を!!\nルミナス・ハーティエル・アンクション!"], :transform_calls=>["shining_stream"]}
165
165
 
166
166
  Milky.rose
167
- #=> #<Rubicure::Girl:0x007fbd60aded08 @human_name="美々野くるみ", @precure_name="ミルキィローズ", @transform_message="スカイローズ・トランスレイト!\n青いバラは秘密のしるし! ミルキィローズ!\n", @extra_names=[], @current_state=0, @state_names=["美々野くるみ", "ミルキィローズ"]>
167
+ #=> {:human_name=>"美々野くるみ", :precure_name=>"ミルキィローズ", :created_date=>Sun, 06 Apr 2008, :transform_message=>"スカイローズ・トランスレイト!\n青いバラは秘密のしるし! ミルキィローズ!", :extra_names=>nil, :attack_messages=>["邪悪な力を包み込む\nバラの吹雪を咲かせましょう!\nミルキィローズ・ブリザード!"], :transform_calls=>["sky_rose_translate", "translate"]}
168
168
  ```
169
169
 
170
170
  and [more aliases!](config/girls/)
@@ -178,6 +178,9 @@ yayoi = Precure.smile.girls[2]
178
178
  yayoi.name
179
179
  #=> "黄瀬やよい"
180
180
 
181
+ yayoi.cast_name
182
+ #=> "金元寿子"
183
+
181
184
  yayoi.attack!
182
185
  #=> RuntimeError: require transform
183
186
 
@@ -249,6 +252,7 @@ Cure.luminous.luminous_shining_stream!
249
252
  輝く命、シャイニールミナス!
250
253
  光の心と光の意志、すべてを一つにするために!
251
254
 
255
+ Cure.bloom.dual_spilitual_power!
252
256
  Cure.bloom.dual_spilitual_power!
253
257
  デュアル・スピリチュアル・パワー!
254
258
  花開け大地に!
@@ -445,6 +449,33 @@ beat.name
445
449
  => "セイレーン"
446
450
  ```
447
451
 
452
+ ## Color methods
453
+ ```ruby
454
+ Cure.peace.color
455
+ #=> "yellow"
456
+
457
+ Cure.happy.color
458
+ #=> "pink"
459
+
460
+ Cure.peace.yellow?
461
+ #=> true
462
+
463
+ Cure.peace.pink?
464
+ #=> false
465
+
466
+ Cure.happy.pink?
467
+ #=> true
468
+
469
+ Rubicure::Girl.colors
470
+ #=> [:black, :blue, :green, :pink, :purple, :red, :white, :yellow]
471
+
472
+ Precure.all_stars.select(&:pink?).map(&:precure_name)
473
+ #=> ["キュアブルーム", "キュアドリーム", "キュアピーチ", "キュアブロッサム", "キュアメロディ", "キュアハッピー", "キュアハート", "キュアラブリー"]
474
+
475
+ Precure.all_stars.select(&:yellow?).map(&:precure_name)
476
+ #=> ["シャイニールミナス", "キュアレモネード", "キュアパイン", "キュアサンシャイン", "キュアミューズ", "キュアピース", "キュアロゼッタ", "キュアハニー"]
477
+ ```
478
+
448
479
  ## More reference
449
480
  http://rubydoc.info/gems/rubicure/frames
450
481
 
@@ -1,7 +1,9 @@
1
1
  cure_black: &cure_black
2
2
  human_name: 美墨なぎさ
3
3
  precure_name: キュアブラック
4
+ cast_name: 本名陽子
4
5
  created_date: 2004-02-01 # episode 1
6
+ color: black
5
7
  transform_message: |-
6
8
  デュアル・オーロラ・ウェイブ!!
7
9
  光の使者、キュアブラック!
@@ -22,7 +24,9 @@ cure_black: &cure_black
22
24
  cure_white: &cure_white
23
25
  human_name: 雪城ほのか
24
26
  precure_name: キュアホワイト
27
+ cast_name: ゆかな
25
28
  created_date: 2004-02-01 # episode 1
29
+ color: white
26
30
  transform_message: |-
27
31
  デュアル・オーロラ・ウェイブ!!
28
32
  光の使者、キュアホワイト!
@@ -1,7 +1,9 @@
1
1
  shiny_luminous: &shiny_luminous
2
2
  human_name: 九条ひかり
3
3
  precure_name: シャイニールミナス
4
+ cast_name: 田中理恵
4
5
  created_date: 2005-03-06 # episode 5
6
+ color: yellow
5
7
  transform_message: |-
6
8
  ルミナス・シャイニングストリーム!
7
9
  輝く命、シャイニールミナス!
@@ -1,7 +1,9 @@
1
1
  cure_bloom: &cure_bloom
2
2
  human_name: 日向咲
3
3
  precure_name: キュアブルーム
4
+ cast_name: 樹元オリエ
4
5
  created_date: 2006-02-05 # episode 1
6
+ color: pink
5
7
  transform_message: |-
6
8
  デュアル・スピリチュアル・パワー!
7
9
  花開け大地に!
@@ -21,7 +23,9 @@ cure_bloom: &cure_bloom
21
23
  cure_egret: &cure_egret
22
24
  human_name: 美翔舞
23
25
  precure_name: キュアイーグレット
26
+ cast_name: 榎本温子
24
27
  created_date: 2006-02-05 # episode 1
28
+ color: white
25
29
  transform_message: |-
26
30
  デュアル・スピリチュアル・パワー!
27
31
  羽ばたけ空に!
@@ -41,6 +45,8 @@ cure_egret: &cure_egret
41
45
  cure_bright: &cure_bright
42
46
  human_name: 日向咲
43
47
  precure_name: キュアブライト
48
+ cast_name: 樹元オリエ
49
+ color: yellow
44
50
  created_date: 2006-09-03 # episode 30
45
51
  transform_message: |-
46
52
  デュアル・スピリチュアル・パワー!
@@ -59,7 +65,9 @@ cure_bright: &cure_bright
59
65
  cure_windy: &cure_windy
60
66
  human_name: 美翔舞
61
67
  precure_name: キュアウィンディ
68
+ cast_name: 榎本温子
62
69
  created_date: 2006-09-03 # episode 30
70
+ color: white
63
71
  transform_message: |-
64
72
  デュアル・スピリチュアル・パワー!
65
73
  勇気を運べ!
@@ -1,7 +1,9 @@
1
1
  cure_dream: &cure_dream
2
2
  human_name: 夢原のぞみ
3
3
  precure_name: キュアドリーム
4
+ cast_name: 三瓶由布子
4
5
  created_date: 2007-02-04 # episode 1
6
+ color: pink
5
7
  transform_message: |-
6
8
  プリキュア!メタモルフォーゼ!
7
9
  大いなる希望の力、キュアドリーム!
@@ -18,7 +20,9 @@ cure_dream: &cure_dream
18
20
  cure_rouge: &cure_rouge
19
21
  human_name: 夏木りん
20
22
  precure_name: キュアルージュ
23
+ cast_name: 竹内順子
21
24
  created_date: 2007-02-11 # episode 2
25
+ color: red
22
26
  transform_message: |-
23
27
  プリキュア!メタモルフォーゼ!
24
28
  情熱の赤い炎、キュアルージュ!
@@ -33,7 +37,9 @@ cure_rouge: &cure_rouge
33
37
  cure_lemonade: &cure_lemonade
34
38
  human_name: 春日野うらら
35
39
  precure_name: キュアレモネード
40
+ cast_name: 伊瀬茉莉也
36
41
  created_date: 2007-02-18 # episode 3
42
+ color: yellow
37
43
  transform_message: |-
38
44
  プリキュア!メタモルフォーゼ!
39
45
  はじけるレモンの香り、キュアレモネード!
@@ -50,7 +56,9 @@ cure_lemonade: &cure_lemonade
50
56
  cure_mint: &cure_mint
51
57
  human_name: 秋元こまち
52
58
  precure_name: キュアミント
59
+ cast_name: 永野愛
53
60
  created_date: 2007-02-25 # episode 4
61
+ color: green
54
62
  transform_message: |-
55
63
  プリキュア!メタモルフォーゼ!
56
64
  安らぎの緑の大地、キュアミント!
@@ -67,7 +75,9 @@ cure_mint: &cure_mint
67
75
  cure_aqua: &cure_aqua
68
76
  human_name: 水無月かれん
69
77
  precure_name: キュアアクア
78
+ cast_name: 前田愛
70
79
  created_date: 2007-03-11 # episode 6
80
+ color: blue
71
81
  transform_message: |-
72
82
  プリキュア!メタモルフォーゼ!
73
83
  知性の青き泉、キュアアクア!
@@ -1,7 +1,9 @@
1
1
  milky_rose: &milky_rose
2
2
  human_name: 美々野くるみ
3
3
  precure_name: ミルキィローズ
4
+ cast_name: 仙台エリ
4
5
  created_date: 2008-04-06 # episode 10
6
+ color: purple
5
7
  transform_message: |-
6
8
  スカイローズ・トランスレイト!
7
9
  青いバラは秘密のしるし! ミルキィローズ!
@@ -1,7 +1,9 @@
1
1
  cure_peach: &cure_peach
2
2
  human_name: 桃園ラブ
3
3
  precure_name: キュアピーチ
4
+ cast_name: 沖佳苗
4
5
  created_date: 2009-02-01 # episode 1
6
+ color: pink
5
7
  transform_message: |-
6
8
  チェインジ!プリキュア・ビートアップ!
7
9
  ピンクのハートは愛あるしるし!
@@ -20,7 +22,9 @@ cure_peach: &cure_peach
20
22
  cure_berry: &cure_berry
21
23
  human_name: 蒼乃美希
22
24
  precure_name: キュアベリー
25
+ cast_name: 喜多村英梨
23
26
  created_date: 2009-02-08 # episode 2
27
+ color: blue
24
28
  transform_message: |-
25
29
  チェインジ!プリキュア・ビートアップ!
26
30
  ブルーのハートは希望のしるし!
@@ -39,7 +43,9 @@ cure_berry: &cure_berry
39
43
  cure_pine: &cure_pine
40
44
  human_name: 山吹祈里
41
45
  precure_name: キュアパイン
46
+ cast_name: 中川亜紀子
42
47
  created_date: 2009-02-15 # episode 3
48
+ color: yellow
43
49
  transform_message: |-
44
50
  チェインジ!プリキュア・ビートアップ!
45
51
  イエローハートは祈りのしるし!
@@ -58,7 +64,9 @@ cure_pine: &cure_pine
58
64
  cure_passion: &cure_passion
59
65
  human_name: 東せつな
60
66
  precure_name: キュアパッション
67
+ cast_name: 小松由佳
61
68
  created_date: 2009-07-12 # episode 23
69
+ color: red
62
70
  transform_message: |-
63
71
  チェインジ!プリキュア・ビートアップ!
64
72
  真っ赤なハートは幸せの証!
@@ -1,7 +1,9 @@
1
1
  cure_blossom: &cure_blossom
2
2
  human_name: 花咲つぼみ
3
3
  precure_name: キュアブロッサム
4
+ cast_name: 水樹奈々
4
5
  created_date: 2010-02-07 # episode 1
6
+ color: pink
5
7
  transform_message: |-
6
8
  (プリキュアの種、いくですぅ!)
7
9
  プリキュア!オープンマイハート!
@@ -21,7 +23,9 @@ cure_blossom: &cure_blossom
21
23
  cure_marine: &cure_marine
22
24
  human_name: 来海えりか
23
25
  precure_name: キュアマリン
26
+ cast_name: 水沢史絵
24
27
  created_date: 2010-02-21 # episode 3
28
+ color: blue
25
29
  transform_message: |-
26
30
  (プリキュアの種、いくですぅ!)
27
31
  プリキュア!オープンマイハート!
@@ -41,7 +45,9 @@ cure_marine: &cure_marine
41
45
  cure_sunshine: &cure_sunshine
42
46
  human_name: 明堂院いつき
43
47
  precure_name: キュアサンシャイン
48
+ cast_name: 桑島法子
44
49
  created_date: 2010-07-18 # episode 23
50
+ color: yellow
45
51
  transform_message: |-
46
52
  (プリキュアの種、いくですぅ!)
47
53
  プリキュア!オープンマイハート!
@@ -61,7 +67,9 @@ cure_sunshine: &cure_sunshine
61
67
  cure_moonlight: &cure_moonlight
62
68
  human_name: 月影ゆり
63
69
  precure_name: キュアムーンライト
70
+ cast_name: 久川綾
64
71
  created_date: 2010-09-26 # episode 33
72
+ color: purple
65
73
  transform_message: |-
66
74
  (プリキュアの種、いくですぅ!)
67
75
  プリキュア!オープンマイハート!
@@ -1,7 +1,9 @@
1
1
  cure_melody: &cure_melody
2
2
  human_name: 北条響
3
3
  precure_name: キュアメロディ
4
+ cast_name: 小清水亜美
4
5
  created_date: 2011-02-06 # episode 1
6
+ color: pink
5
7
  transform_message: |-
6
8
  レッツプレイ!プリキュアモジュレーション!!
7
9
  爪弾くは荒ぶる調べ! キュアメロディ!
@@ -27,7 +29,9 @@ cure_melody: &cure_melody
27
29
  cure_rhythm: &cure_rhythm
28
30
  human_name: 南野奏
29
31
  precure_name: キュアリズム
32
+ cast_name: 折笠富美子
30
33
  created_date: 2011-02-06 # episode 1
34
+ color: white
31
35
  transform_message: |-
32
36
  レッツプレイ!プリキュアモジュレーション!!
33
37
  爪弾くはたおやかな調べ! キュアリズム!
@@ -53,7 +57,9 @@ cure_rhythm: &cure_rhythm
53
57
  cure_beat: &cure_beat
54
58
  human_name: 黒川エレン
55
59
  precure_name: キュアビート
60
+ cast_name: 豊口めぐみ
56
61
  created_date: 2011-07-10 # episode 21
62
+ color: blue
57
63
  transform_message: |-
58
64
  レッツプレイ!プリキュアモジュレーション!!
59
65
  爪弾くは魂の調べ! キュアビート!
@@ -78,7 +84,9 @@ cure_beat: &cure_beat
78
84
  cure_muse: &cure_muse
79
85
  human_name: 調辺アコ
80
86
  precure_name: キュアミューズ
87
+ cast_name: 大久保瑠美
81
88
  created_date: 2011-10-16 # episode 35
89
+ color: yellow
82
90
  transform_message: |-
83
91
  レッツプレイ!プリキュアモジュレーション!!
84
92
  爪弾くは女神の調べ! キュアミューズ!
@@ -1,7 +1,9 @@
1
1
  cure_happy: &cure_happy
2
2
  human_name: 星空みゆき
3
3
  precure_name: キュアハッピー
4
+ cast_name: 福圓美里
4
5
  created_date: 2012-02-05 # episode 1
6
+ color: pink
5
7
  transform_message: |-
6
8
  (レディ?)
7
9
  プリキュア・スマイルチャージ!
@@ -31,7 +33,9 @@ cure_happy: &cure_happy
31
33
  cure_sunny: &cure_sunny
32
34
  human_name: 日野あかね
33
35
  precure_name: キュアサニー
36
+ cast_name: 田野アサミ
34
37
  created_date: 2012-02-12 # episode 2
38
+ color: red
35
39
  transform_message: |-
36
40
  (レディ?)
37
41
  プリキュア・スマイルチャージ!
@@ -61,7 +65,9 @@ cure_sunny: &cure_sunny
61
65
  cure_peace: &cure_peace
62
66
  human_name: 黄瀬やよい
63
67
  precure_name: キュアピース
68
+ cast_name: 金元寿子
64
69
  created_date: 2012-02-19 # episode 3
70
+ color: yellow
65
71
  transform_message: |-
66
72
  (レディ?)
67
73
  プリキュア・スマイルチャージ!
@@ -91,7 +97,9 @@ cure_peace: &cure_peace
91
97
  cure_march: &cure_march
92
98
  human_name: 緑川なお
93
99
  precure_name: キュアマーチ
100
+ cast_name: 井上麻里奈
94
101
  created_date: 2012-02-26 # episode 4
102
+ color: green
95
103
  transform_message: |-
96
104
  (レディ?)
97
105
  プリキュア・スマイルチャージ!
@@ -121,7 +129,9 @@ cure_march: &cure_march
121
129
  cure_beauty: &cure_beauty
122
130
  human_name: 青木れいか
123
131
  precure_name: キュアビューティ
132
+ cast_name: 西村ちなみ
124
133
  created_date: 2012-03-04 # episode 5
134
+ color: blue
125
135
  transform_message: |-
126
136
  (レディ?)
127
137
  プリキュア・スマイルチャージ!
@@ -1,7 +1,9 @@
1
1
  cure_heart: &cure_heart
2
2
  human_name: 相田マナ
3
3
  precure_name: キュアハート
4
+ cast_name: 生天目仁美
4
5
  created_date: 2013-02-03 # episode 1
6
+ color: pink
5
7
  transform_message: |-
6
8
  プリキュアラブリンク!
7
9
  L! O! V! E!
@@ -21,7 +23,9 @@ cure_heart: &cure_heart
21
23
  cure_diamond: &cure_diamond
22
24
  human_name: 菱川六花
23
25
  precure_name: キュアダイヤモンド
26
+ cast_name: 寿美菜子
24
27
  created_date: 2013-02-17 # episode 3
28
+ color: blue
25
29
  transform_message: |-
26
30
  プリキュアラブリンク!
27
31
  L! O! V! E!
@@ -38,7 +42,9 @@ cure_diamond: &cure_diamond
38
42
  cure_rosetta: &cure_rosetta
39
43
  human_name: 四葉ありす
40
44
  precure_name: キュアロゼッタ
45
+ cast_name: 渕上舞
41
46
  created_date: 2013-02-24 # episode 4
47
+ color: yellow
42
48
  transform_message: |-
43
49
  プリキュアラブリンク!
44
50
  L! O! V! E!
@@ -55,7 +61,9 @@ cure_rosetta: &cure_rosetta
55
61
  cure_sword: &cure_sword
56
62
  human_name: 剣崎真琴
57
63
  precure_name: キュアソード
64
+ cast_name: 宮本佳那子
58
65
  created_date: 2013-02-03 # episode 1
66
+ color: purple
59
67
  transform_message: |-
60
68
  プリキュアラブリンク!
61
69
  L! O! V! E!
@@ -72,7 +80,9 @@ cure_sword: &cure_sword
72
80
  cure_ace: &cure_ace
73
81
  human_name: 円亜久里
74
82
  precure_name: キュアエース
83
+ cast_name: 釘宮理恵
75
84
  created_date: 2013-06-30 # episode 22
85
+ color: red
76
86
  transform_message: |-
77
87
  プリキュアドレスアップ!
78
88
  (キュピラッパー!)
@@ -1,7 +1,9 @@
1
1
  cure_lovely: &cure_lovely
2
2
  human_name: 愛乃めぐみ
3
3
  precure_name: キュアラブリー
4
+ cast_name: 中島愛
4
5
  created_date: 2014-02-02 # episode 1
6
+ color: pink
5
7
  transform_message: |-
6
8
  (かわルンルン!)
7
9
  プリキュアくるりんミラーチェンジ!
@@ -32,7 +34,9 @@ cure_lovely: &cure_lovely
32
34
  cure_princess: &cure_princess
33
35
  human_name: 白雪ひめ(ヒメルダ・ウインドウ・キュアクイーン・オブ・ザ・ブルースカイ)
34
36
  precure_name: キュアプリンセス
37
+ cast_name: 潘めぐみ
35
38
  created_date: 2014-02-02 # episode 1
39
+ color: blue
36
40
  transform_message: |-
37
41
  (かわルンルン!)
38
42
  プリキュアくるりんミラーチェンジ!
@@ -62,7 +66,9 @@ cure_princess: &cure_princess
62
66
  cure_honey: &cure_honey
63
67
  human_name: 大森ゆうこ
64
68
  precure_name: キュアハニー
69
+ cast_name: 北川里奈
65
70
  created_date: 2014-03-15 # NS3
71
+ color: yellow
66
72
  transform_message: |-
67
73
  (かわルンルン!)
68
74
  プリキュアくるりんミラーチェンジ!
@@ -94,7 +100,9 @@ cure_honey: &cure_honey
94
100
  cure_fortune: &cure_fortune
95
101
  human_name: 氷川いおな
96
102
  precure_name: キュアフォーチュン
103
+ cast_name: 戸松遥
97
104
  created_date: 2014-06-29
105
+ color: purple
98
106
  transform_message: |-
99
107
  (かわルンルン!)
100
108
  プリキュアきらりんスターシンフォニー!
data/lib/rubicure/cure.rb CHANGED
@@ -26,43 +26,35 @@ EOF
26
26
  end
27
27
  end
28
28
 
29
- [Cure.passion, Cure.cure_passion].each do |passion|
30
- class << passion
31
- ORIGINAL_HUMAN_NAME = "東せつな"
32
- ANOTHER_HUMAN_NAME = "イース"
29
+ def self.define_turnover_methods(target, original_human_name, another_human_name)
30
+ target.instance_variable_set(:@__original_human_name, original_human_name)
31
+ target.instance_variable_set(:@__another_human_name, another_human_name)
33
32
 
33
+ class << target
34
34
  def !
35
35
  humanize!
36
- @another_human_name ||= ANOTHER_HUMAN_NAME
36
+ @another_human_name ||= @__another_human_name
37
+
38
+ # setup @state_names
39
+ state_names
40
+
37
41
  @state_names[0], @another_human_name = @another_human_name, @state_names[0]
38
42
  self
39
43
  end
40
44
 
41
45
  def rollback
42
- @state_names[0] = ORIGINAL_HUMAN_NAME
43
- @another_human_name = ANOTHER_HUMAN_NAME
46
+ @state_names[0] = @__original_human_name
47
+ @another_human_name = @__another_human_name
44
48
  self
45
49
  end
46
50
  end
47
51
  end
48
52
 
49
- [Cure.beat, Cure.cure_beat].each do |beat|
50
- class << beat
51
- ORIGINAL_HUMAN_NAME = "黒川エレン"
52
- ANOTHER_HUMAN_NAME = "セイレーン"
53
-
54
- def !
55
- humanize!
56
- @another_human_name ||= ANOTHER_HUMAN_NAME
57
- @state_names[0], @another_human_name = @another_human_name, @state_names[0]
58
- self
59
- end
53
+ [Cure.passion, Cure.cure_passion].each do |passion|
54
+ define_turnover_methods(passion, "東せつな", "イース")
55
+ end
60
56
 
61
- def rollback
62
- @state_names[0] = ORIGINAL_HUMAN_NAME
63
- @another_human_name = ANOTHER_HUMAN_NAME
64
- self
65
- end
66
- end
57
+ [Cure.beat, Cure.cure_beat].each do |beat|
58
+ define_turnover_methods(beat, "黒川エレン", "セイレーン")
67
59
  end
68
60
  end
data/lib/rubicure/girl.rb CHANGED
@@ -4,30 +4,27 @@ module Rubicure
4
4
  # Precure girl (ex. Cure Peace, Cure Rosetta, Cure Honey)
5
5
  #
6
6
  # this is record of "config/girls/*.yml"
7
- class Girl
8
- attr_reader :human_name, :precure_name, :transform_message, :extra_names,
9
- :current_state, :state_names, :created_date, :attack_messages,
10
- :transform_calls
7
+ class Girl < Hash
8
+ include Hashie::Extensions::MethodAccess
9
+
11
10
  attr_writer :io
12
11
 
13
12
  @@cache = {}
14
13
  @@config = nil
14
+ @@colors = nil
15
15
  @@sleep_sec = 1
16
16
 
17
- def initialize(human_name: nil, precure_name: nil, transform_message: nil, extra_names: [],
18
- created_date: nil, attack_messages: [], transform_calls: [])
19
- @human_name = human_name
20
- @precure_name = precure_name
21
- @transform_message = transform_message
22
- @extra_names = extra_names || []
23
- @created_date = created_date
24
- @current_state = 0
25
- @state_names = [@human_name, @precure_name]
26
- @state_names += @extra_names unless @extra_names.empty?
27
- @attack_messages = [""] + attack_messages
28
- @transform_calls = transform_calls
17
+ def current_state
18
+ @current_state ||= 0
19
+ @current_state
20
+ end
21
+
22
+ def state_names
23
+ return @state_names if @state_names
29
24
 
30
- @io = $stdout
25
+ @state_names = [human_name, precure_name]
26
+ @state_names += Array.wrap(extra_names) if respond_to?(:extra_names)
27
+ @state_names
31
28
  end
32
29
 
33
30
  def ==(other)
@@ -36,17 +33,15 @@ module Rubicure
36
33
 
37
34
  # @return [String] name of current form
38
35
  def name
39
- @state_names[@current_state]
36
+ state_names[current_state]
40
37
  end
41
38
  alias to_s name
42
39
 
43
40
  # human -> precure ( -> extra forms ) -> human ...
44
41
  # @return [Rubicure::Girl] self
45
42
  def transform!
46
- @current_state += 1
47
- @current_state = 0 unless @current_state < @state_names.length
48
-
49
- print_by_line @transform_message if @current_state == 1
43
+ state = inc_current_state
44
+ print_by_line transform_message if state == 1
50
45
 
51
46
  self
52
47
  end
@@ -73,7 +68,7 @@ module Rubicure
73
68
 
74
69
  unless @@cache[girl_name]
75
70
  girl_config = config[girl_name] || {}
76
- @@cache[girl_name] = Rubicure::Girl.new(girl_config)
71
+ @@cache[girl_name] = Rubicure::Girl[girl_config].tap{ |girl| girl.io = $stdout }
77
72
  end
78
73
 
79
74
  @@cache[girl_name]
@@ -86,11 +81,9 @@ module Rubicure
86
81
 
87
82
  # @return [Array<Symbol>]
88
83
  def self.uniq_names
89
- uniq_names = []
90
- config.each do |name, series|
91
- uniq_names << name unless uniq_names.any? { |uniq_name| config[uniq_name][:precure_name] == series[:precure_name] }
84
+ config.each_with_object([]) do |(name, girl), uniq_names|
85
+ uniq_names << name unless uniq_names.any? { |uniq_name| config[uniq_name][:precure_name] == girl[:precure_name] }
92
86
  end
93
- uniq_names
94
87
  end
95
88
 
96
89
  # @return [Hash] content of config/girls/*.yml
@@ -105,6 +98,7 @@ module Rubicure
105
98
  def self.reload_config!
106
99
  @@cache = {}
107
100
  @@config = nil
101
+ @@colors = nil
108
102
  config
109
103
  end
110
104
 
@@ -117,10 +111,31 @@ module Rubicure
117
111
  @@sleep_sec = sleep_sec
118
112
  end
119
113
 
114
+ # return defined colors
115
+ # @return [Array<Symbol>]
116
+ def self.colors
117
+ unless @@colors
118
+ @@colors = config.values.each_with_object([]) { |girl, colors| colors << girl[:color].to_sym }.uniq.sort
119
+ end
120
+ @@colors
121
+ end
122
+
123
+ colors.each do |color|
124
+ define_method "#{color}?" do
125
+ self.color.to_sym == color
126
+ end
127
+ end
128
+
120
129
  private
121
130
 
131
+ def inc_current_state
132
+ @current_state = current_state + 1
133
+ @current_state = 0 unless @current_state < state_names.length
134
+ @current_state
135
+ end
136
+
122
137
  def current_attack_message
123
- attack_messages[current_state]
138
+ attack_messages[@current_state - 1]
124
139
  end
125
140
 
126
141
  def print_by_line(message)
@@ -133,11 +148,14 @@ module Rubicure
133
148
  end
134
149
 
135
150
  def method_missing(method_name, *args)
151
+ # call Hashie::Extensions::MethodAccess#method_missing
152
+ return super if has_key?(method_name)
153
+
136
154
  shortened_name = method_name.to_s.
137
155
  sub(%r/\Aprecure_|_precure\z/, "").
138
156
  sub(%r/!\z/, "")
139
157
 
140
- return transform!(*args) if @transform_calls.include?(shortened_name)
158
+ return transform!(*args) if transform_calls.include?(shortened_name)
141
159
 
142
160
  super
143
161
  end
@@ -1,3 +1,3 @@
1
1
  module Rubicure
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/spec/core_spec.rb CHANGED
@@ -35,7 +35,9 @@ EOS
35
35
  ------------------------
36
36
  human_name: #{girl.human_name}
37
37
  precure_name: #{girl.precure_name}
38
- extra_names: #{girl.extra_names}
38
+ cast_name: #{girl.cast_name}
39
+ color: #{girl.color}
40
+ extra_names: #{girl[:extra_names]}
39
41
  state_names: #{girl.state_names}
40
42
  attack_messages: #{girl.attack_messages}
41
43
  transform_message:
data/spec/girl_spec.rb CHANGED
@@ -1,20 +1,27 @@
1
1
  describe Rubicure::Girl do
2
2
  let(:girl) do
3
- girl = Rubicure::Girl.new(
3
+ girl = Rubicure::Girl[
4
4
  human_name: human_name,
5
5
  precure_name: precure_name,
6
+ cast_name: cast_name,
7
+ created_date: created_date,
6
8
  extra_names: extra_names,
7
9
  transform_message: transform_message,
8
10
  attack_messages: attack_messages,
9
- )
10
- girl.io = tempfile
11
+ transform_calls: transform_calls,
12
+ color: color,
13
+ ]
14
+ girl.io = mock_io
11
15
  girl
12
16
  end
13
- let(:tempfile) { Tempfile.open(described_class.to_s) }
17
+ let(:mock_io) { StringIO.new }
14
18
 
15
19
  let(:human_name) { "黄瀬やよい" }
16
20
  let(:precure_name) { "キュアピース" }
21
+ let(:cast_name) { "金元寿子" }
22
+ let(:created_date) { "2012-02-19" }
17
23
  let(:extra_names) { %w(プリンセスピース ウルトラピース) }
24
+ let(:color) { "yellow" }
18
25
  let(:transform_message) do
19
26
  <<EOF
20
27
  プリキュアスマイルチャージ!
@@ -28,6 +35,7 @@ EOF
28
35
  "プリキュアピースサンダーハリケーン!",
29
36
  ]
30
37
  end
38
+ let(:transform_calls){ %w(smile_charge) }
31
39
 
32
40
  describe "#name" do
33
41
  context "when before transform" do
@@ -40,7 +48,7 @@ EOF
40
48
  end
41
49
 
42
50
  it { expect(girl.name).to eq precure_name }
43
- it { expect(tempfile.open.read).to eq transform_message }
51
+ it { expect(mock_io.string).to eq transform_message }
44
52
  end
45
53
 
46
54
  context "when after 2nd transform" do
@@ -139,6 +147,7 @@ EOF
139
147
  subject { girl.send(transform_call) }
140
148
 
141
149
  before do
150
+ girl.io = mock_io
142
151
  girl.humanize!
143
152
  end
144
153
 
@@ -158,7 +167,7 @@ EOF
158
167
  let(:girl) { Milky.rose }
159
168
  let(:transform_call) { "metamorphose" }
160
169
 
161
- it { expect{ subject }.to raise_error NoMethodError }
170
+ it { expect{ subject }.to raise_error NameError }
162
171
  end
163
172
  end
164
173
 
@@ -186,4 +195,29 @@ EOF
186
195
  it_behaves_like :a_humanize_method
187
196
  end
188
197
  end
198
+
199
+ describe "#colors" do
200
+ subject{ Rubicure::Girl.colors }
201
+
202
+ let(:expected) do
203
+ %i(
204
+ black
205
+ blue
206
+ green
207
+ pink
208
+ purple
209
+ red
210
+ white
211
+ yellow
212
+ )
213
+ end
214
+
215
+ it { should contain_exactly(*expected) }
216
+ end
217
+
218
+ describe "dynamic color methods" do
219
+ # NOTE: cure peace is yellow
220
+ it { expect(girl).to be_yellow }
221
+ it { expect(girl).not_to be_pink }
222
+ end
189
223
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubicure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-31 00:00:00.000000000 Z
11
+ date: 2015-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport