rubicure 0.1.2 → 0.1.3

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: ef10e2235312942d845c858110d23a9e55240e8b
4
- data.tar.gz: 8d9154bc2d521f5d1921893f294c05796c2f3566
3
+ metadata.gz: 755b376d24c501ce0ddc7ab211bb084d3cdb21f9
4
+ data.tar.gz: ca1b536b57937941071b0fa461a51f9e11e7371e
5
5
  SHA512:
6
- metadata.gz: d371d0eb2790dbbed34e1ac3fffc8ae107a63944ca3d3d7344a8d81f4c932d22f544bf55c50328e228157156b65272bf09814dd387f90305b15fb19afb695723
7
- data.tar.gz: 46dad067f4002f2a316621699db3c2c4955f3f4b5be1450d515eadff6ec2e7b8381d8a2dd7cba69a0a81972ff14b4a08835d54fedfd2b66d820976be4fb6626f
6
+ metadata.gz: 61a4db211724477f158b4691f55a47a99ffcfd5d214a6b60318f2a5423ed731057fe09ec108b80eac80d07c09617b0816f3e600ee3b8c369d57b9c30782184a6
7
+ data.tar.gz: 3f19e83e2b45494cc7e3ec22986e3c141a1070ff351ca7b0141214f2e92ab14f0e3ce65345535ffb25d448b158ef4ece9306c3ba29411d08b2ce2b79db5edcdd
data/.travis.yml CHANGED
@@ -5,7 +5,11 @@ rvm:
5
5
  - 2.2
6
6
  - ruby-head
7
7
  bundler_args: --jobs=2
8
- script: CODECLIMATE_REPO_TOKEN=8e9db6ee5f3818e87287a6393086c2ccb9b1b83106c5bfb972211abefd2fe162 bundle exec rspec --tag category:verbose && bundle exec rspec
8
+ before_script:
9
+ - export CODECLIMATE_REPO_TOKEN=8e9db6ee5f3818e87287a6393086c2ccb9b1b83106c5bfb972211abefd2fe162
10
+ script:
11
+ - bundle exec rspec --tag category:verbose
12
+ - bundle exec rspec --tag ~category:verbose
9
13
  branches:
10
14
  only:
11
15
  - master
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## master
2
- [full changelog](http://github.com/sue445/rubicure/compare/v0.1.2...master)
2
+ [full changelog](http://github.com/sue445/rubicure/compare/v0.1.3...master)
3
+
4
+ ## v0.1.3
5
+ [full changelog](http://github.com/sue445/rubicure/compare/v0.1.2...v0.1.3)
6
+
7
+ * Impl: `!Cure.passion`, `!Cure.beat`
8
+ * https://github.com/sue445/rubicure/pull/48
9
+ * `Girl#humanize` -> `Girl#humanize!` and return self
10
+ * https://github.com/sue445/rubicure/pull/52
11
+ * `Girl#humanize` is deprecated
3
12
 
4
13
  ## v0.1.2
5
14
  [full changelog](http://github.com/sue445/rubicure/compare/v0.1.1...v0.1.2)
data/README.md CHANGED
@@ -93,26 +93,6 @@ Precure.find(:smile).title
93
93
 
94
94
  and [more aliases!](config/series.yml)
95
95
 
96
- ### each with precure series
97
- ```ruby
98
- Precure.each{|series| puts series.title }
99
- ふたりはプリキュア
100
- ふたりはプリキュア Max Heart
101
- ふたりはプリキュア Splash Star
102
- Yes! プリキュア5
103
- Yes! プリキュア5 Go Go!
104
- フレッシュプリキュア!
105
- ハートキャッチプリキュア!
106
- スイートプリキュア♪
107
- スマイルプリキュア!
108
- ドキドキ!プリキュア
109
- ハピネスチャージプリキュア!
110
- #=> [:unmarked, :max_heart, :splash_star, :yes, :yes_gogo, :fresh, :heart_catch, :suite, :smile, :dokidoki, :happiness_charge]
111
-
112
- Precure.inject([]){|girl_count_of_series, series| girl_count_of_series << series.girls.count; girl_count_of_series }
113
- #=> [2, 3, 2, 5, 6, 4, 4, 4, 5, 5, 3]
114
- ```
115
-
116
96
  ### Get current precure series
117
97
  `Precure#now` (alias to `#current` ) return current precure series
118
98
 
@@ -248,7 +228,7 @@ yayoi.transform!.transform!
248
228
  yayoi.name
249
229
  #=> "プリンセスピース"
250
230
 
251
- yayoi.humanize
231
+ yayoi.humanize!
252
232
  #=> 0
253
233
  yayoi.name
254
234
  #=> "黄瀬やよい"
@@ -415,6 +395,23 @@ Cure.peace.janken
415
395
 
416
396
  ### Enumerable
417
397
  ```ruby
398
+ Precure.each{|series| puts series.title }
399
+ ふたりはプリキュア
400
+ ふたりはプリキュア Max Heart
401
+ ふたりはプリキュア Splash Star
402
+ Yes! プリキュア5
403
+ Yes! プリキュア5 Go Go!
404
+ フレッシュプリキュア!
405
+ ハートキャッチプリキュア!
406
+ スイートプリキュア♪
407
+ スマイルプリキュア!
408
+ ドキドキ!プリキュア
409
+ ハピネスチャージプリキュア!
410
+ #=> [:unmarked, :max_heart, :splash_star, :yes, :yes_gogo, :fresh, :heart_catch, :suite, :smile, :dokidoki, :happiness_charge]
411
+
412
+ Precure.inject([]){|girl_count_of_series, series| girl_count_of_series << series.girls.count; girl_count_of_series }
413
+ #=> [2, 3, 2, 5, 6, 4, 4, 4, 5, 5, 3]
414
+
418
415
  Precure.map(&:title)
419
416
  => ["ふたりはプリキュア", "ふたりはプリキュア Max Heart", "ふたりはプリキュア Splash Star", "Yes! プリキュア5", "Yes! プリキュア5 Go Go!", "フレッシュプリキュア!", "ハートキャッチプリキュア!", "スイートプリキュア♪", "スマイルプリキュア!", "ドキドキ!プリキュア", "ハピネスチャージプリキュア!"]
420
417
 
@@ -425,6 +422,28 @@ Precure.map{|series| series.map(&:precure_name) }
425
422
  => [["キュアブラック", "キュアホワイト"], ["キュアブラック", "キュアホワイト", "シャイニールミナス"], ["キュアブルーム", "キュアイーグレット"], ["キュアドリーム", "キュアルージュ", "キュアレモネード", "キュアミント", "キュアアクア"], ["キュアドリーム", "キュアルージュ", "キュアレモネード", "キュアミント", "キュアアクア", "ミルキィローズ"], ["キュアピーチ", "キュアベリー", "キュアパイン", "キュアパッション"], ["キュアブロッサム", "キュアマリン", "キュアサンシャイン", "キュアムーンライト"], ["キュアメロディ", "キュアリズム", "キュアビート", "キュアミューズ"], ["キュアハッピー", "キュアサニー", "キュアピース", "キュアマーチ", "キュアビューティ"], ["キュアハート", "キュアダイヤモンド", "キュアロゼッタ", "キュアソード", "キュアエース"], ["キュアラブリー", "キュアプリンセス", "キュアハニー", "キュアフォーチュン"]]
426
423
  ```
427
424
 
425
+ ### Not operator
426
+ ```ruby
427
+ passion = Cure.passion
428
+ passion.name
429
+ => "東せつな"
430
+
431
+ !passion
432
+
433
+ passion.name
434
+ => "イース"
435
+
436
+ beat = Cure.beat
437
+
438
+ beat.name
439
+ => "黒川エレン"
440
+
441
+ !beat
442
+
443
+ beat.name
444
+ => "セイレーン"
445
+ ```
446
+
428
447
  ## More reference
429
448
  http://rubydoc.info/gems/rubicure/frames
430
449
 
data/config/girls.yml CHANGED
@@ -1,3 +1,4 @@
1
+ #######################################################
1
2
  # unmarked
2
3
  cure_black: &cure_black
3
4
  human_name: 美墨なぎさ
@@ -45,7 +46,7 @@ black:
45
46
  <<: *cure_black
46
47
  white:
47
48
  <<: *cure_white
48
-
49
+ #######################################################
49
50
  # max_heart
50
51
  shiny_luminous: &shiny_luminous
51
52
  human_name: 九条ひかり
@@ -61,11 +62,10 @@ shiny_luminous: &shiny_luminous
61
62
  光の意志よ!私に勇気を!希望と力を!!
62
63
  ルミナス・ハーティエル・アンクション!
63
64
  transform_calls:
64
- -
65
65
  - shining_stream
66
66
  luminous:
67
67
  <<: *shiny_luminous
68
-
68
+ #######################################################
69
69
  # splash_star
70
70
  cure_bloom: &cure_bloom
71
71
  human_name: 日向咲
@@ -86,7 +86,7 @@ cure_bloom: &cure_bloom
86
86
  奇跡の力を解き放て!
87
87
  プリキュア ツインストリーム・スプラッシュ!!
88
88
  transform_calls:
89
- - dual_spilitual_power
89
+ - dual_spiritual_power
90
90
  cure_egret: &cure_egret
91
91
  human_name: 美翔舞
92
92
  precure_name: キュアイーグレット
@@ -106,7 +106,7 @@ cure_egret: &cure_egret
106
106
  奇跡の力を解き放て!
107
107
  プリキュア ツインストリーム・スプラッシュ!!
108
108
  transform_calls:
109
- - dual_spilitual_power
109
+ - dual_spiritual_power
110
110
  cure_bright: &cure_bright
111
111
  human_name: 日向咲
112
112
  precure_name: キュアブライト
@@ -124,7 +124,7 @@ cure_bright: &cure_bright
124
124
  希望へ導け、2つの心!
125
125
  プリキュア・スパイラルスタースプラッシュ!!
126
126
  transform_calls:
127
- - dual_spilitual_power
127
+ - dual_spiritual_power
128
128
  cure_windy: &cure_windy
129
129
  human_name: 美翔舞
130
130
  precure_name: キュアウィンディ
@@ -142,8 +142,7 @@ cure_windy: &cure_windy
142
142
  希望へ導け、2つの心!
143
143
  プリキュア・スパイラルスタースプラッシュ!!
144
144
  transform_calls:
145
- - dual_spilitual_power
146
-
145
+ - dual_spiritual_power
147
146
  bloom:
148
147
  <<: *cure_bloom
149
148
  egret:
@@ -152,7 +151,7 @@ bright:
152
151
  <<: *cure_bright
153
152
  windy:
154
153
  <<: *cure_windy
155
-
154
+ #######################################################
156
155
  # yes
157
156
  cure_dream: &cure_dream
158
157
  human_name: 夢原のぞみ
@@ -247,7 +246,7 @@ mint:
247
246
  <<: *cure_mint
248
247
  aqua:
249
248
  <<: *cure_aqua
250
-
249
+ #######################################################
251
250
  # yes_gogo
252
251
  milky_rose: &milky_rose
253
252
  human_name: 美々野くるみ
@@ -267,7 +266,7 @@ milky_rose: &milky_rose
267
266
  - translate
268
267
  rose:
269
268
  <<: *milky_rose
270
-
269
+ #######################################################
271
270
  # fresh
272
271
  cure_peach: &cure_peach
273
272
  human_name: 桃園ラブ
@@ -285,9 +284,9 @@ cure_peach: &cure_peach
285
284
  悪いの悪いの飛んでいけ!
286
285
  プリキュア!ラブサンシャインフレッシュ!
287
286
  transform_calls:
288
- - change_precure_beatup
287
+ - change_precure_beat_up
289
288
  - change
290
- - beatup
289
+ - beat_up
291
290
  cure_berry: &cure_berry
292
291
  human_name: 蒼乃美希
293
292
  precure_name: キュアベリー
@@ -304,9 +303,9 @@ cure_berry: &cure_berry
304
303
  悪いの悪いの飛んでいけ!
305
304
  プリキュア!エスポワールシャワーフレッシュ!
306
305
  transform_calls:
307
- - change_precure_beatup
306
+ - change_precure_beat_up
308
307
  - change
309
- - beatup
308
+ - beat_up
310
309
  cure_pine: &cure_pine
311
310
  human_name: 山吹祈里
312
311
  precure_name: キュアパイン
@@ -323,10 +322,9 @@ cure_pine: &cure_pine
323
322
  悪いの悪いの飛んでいけ!
324
323
  プリキュア!ヒーリングプレアーフレッシュ!
325
324
  transform_calls:
326
- - change_precure_beatup
325
+ - change_precure_beat_up
327
326
  - change
328
- - beatup
329
-
327
+ - beat_up
330
328
  cure_passion: &cure_passion
331
329
  human_name: 東せつな
332
330
  precure_name: キュアパッション
@@ -343,9 +341,9 @@ cure_passion: &cure_passion
343
341
  吹き荒れよ幸せの嵐!
344
342
  プリキュア!ハピネスハリケーン!
345
343
  transform_calls:
346
- - change_precure_beatup
344
+ - change_precure_beat_up
347
345
  - change
348
- - beatup
346
+ - beat_up
349
347
  peach:
350
348
  <<: *cure_peach
351
349
  berry:
@@ -354,7 +352,7 @@ pine:
354
352
  <<: *cure_pine
355
353
  passion:
356
354
  <<: *cure_passion
357
-
355
+ #######################################################
358
356
  # heart_catch
359
357
  cure_blossom: &cure_blossom
360
358
  human_name: 花咲つぼみ
@@ -436,7 +434,6 @@ cure_moonlight: &cure_moonlight
436
434
  プリキュア・ハートキャッチ・オーケストラ!!
437
435
  transform_calls:
438
436
  - open_my_heart
439
-
440
437
  blossom:
441
438
  <<: *cure_blossom
442
439
  marine:
@@ -445,7 +442,7 @@ sunshine:
445
442
  <<: *cure_sunshine
446
443
  moonlight:
447
444
  <<: *cure_moonlight
448
-
445
+ #######################################################
449
446
  # suite
450
447
  cure_melody: &cure_melody
451
448
  human_name: 北条響
@@ -550,7 +547,6 @@ cure_muse: &cure_muse
550
547
  - lets_play_precure_modulation
551
548
  - lets_play
552
549
  - modulation
553
-
554
550
  melody:
555
551
  <<: *cure_melody
556
552
  rhythm:
@@ -559,7 +555,7 @@ beat:
559
555
  <<: *cure_beat
560
556
  muse:
561
557
  <<: *cure_muse
562
-
558
+ #######################################################
563
559
  # smile
564
560
  cure_happy: &cure_happy
565
561
  human_name: 星空みゆき
@@ -721,7 +717,7 @@ march:
721
717
  <<: *cure_march
722
718
  beauty:
723
719
  <<: *cure_beauty
724
-
720
+ #######################################################
725
721
  # dokidoki
726
722
  cure_heart: &cure_heart
727
723
  human_name: 相田マナ
@@ -811,7 +807,7 @@ cure_ace: &cure_ace
811
807
  ときめきなさい!エースショット!
812
808
  ばきゅ〜ん!!
813
809
  transform_calls:
814
- - dressup
810
+ - dress_up
815
811
  heart:
816
812
  <<: *cure_heart
817
813
  diamond:
@@ -822,7 +818,7 @@ sword:
822
818
  <<: *cure_sword
823
819
  ace:
824
820
  <<: *cure_ace
825
-
821
+ #######################################################
826
822
  # happiness_charge
827
823
  cure_lovely: &cure_lovely
828
824
  human_name: 愛乃めぐみ
@@ -947,7 +943,7 @@ cure_fortune: &cure_fortune
947
943
  プリキュア!桜吹雪の舞!
948
944
  transform_calls:
949
945
  - kirarin_star_symphony
950
-
946
+ #######################################################
951
947
  lovely:
952
948
  <<: *cure_lovely
953
949
  princess:
data/config/movies.yml CHANGED
@@ -1,17 +1,18 @@
1
+ #######################################################
1
2
  dx1: &dx1
2
3
  title: 映画 プリキュアオールスターズDX みんなともだちっ☆奇跡の全員大集合!
3
4
  started_date: 2009-03-20
4
5
  dx:
5
6
  <<: *dx1
6
-
7
+ #######################################################
7
8
  dx2: &dx2
8
9
  title: 映画 プリキュアオールスターズDX2 希望の光☆レインボージュエルを守れ!
9
10
  started_date: 2010-03-20
10
-
11
+ #######################################################
11
12
  dx3: &dx3
12
13
  title: 映画 プリキュアオールスターズDX3 未来にとどけ! 世界をつなぐ☆虹色の花
13
14
  started_date: 2011-03-19
14
-
15
+ #######################################################
15
16
  ns1: &ns1
16
17
  title: 映画 プリキュアオールスターズNewStage みらいのともだち
17
18
  started_date: 2012-03-17
@@ -21,13 +22,13 @@ new_stage:
21
22
  <<: *ns1
22
23
  new_stage1:
23
24
  <<: *ns1
24
-
25
+ #######################################################
25
26
  ns2: &ns2
26
27
  title: 映画 プリキュアオールスターズNewStage2 こころのともだち
27
28
  started_date: 2013-03-16
28
29
  new_stage2:
29
30
  <<: *ns2
30
-
31
+ #######################################################
31
32
  ns3: &ns3
32
33
  title: 映画 プリキュアオールスターズ NewStage3 永遠のともだち
33
34
  started_date: 2014-03-15
data/config/series.yml CHANGED
@@ -1,3 +1,4 @@
1
+ #######################################################
1
2
  unmarked: &unmarked
2
3
  title: ふたりはプリキュア
3
4
  started_date: 2004-02-01
@@ -7,7 +8,7 @@ unmarked: &unmarked
7
8
  - cure_white
8
9
  futari_wa_pretty_cure:
9
10
  <<: *unmarked
10
-
11
+ #######################################################
11
12
  max_heart: &max_heart
12
13
  title: ふたりはプリキュア Max Heart
13
14
  started_date: 2005-02-06
@@ -18,7 +19,7 @@ max_heart: &max_heart
18
19
  - shiny_luminous
19
20
  futari_wa_pretty_cure_max_heart:
20
21
  <<: *max_heart
21
-
22
+ #######################################################
22
23
  splash_star: &splash_star
23
24
  title: ふたりはプリキュア Splash Star
24
25
  started_date: 2006-02-05
@@ -28,7 +29,7 @@ splash_star: &splash_star
28
29
  - cure_egret
29
30
  futari_wa_pretty_cure_splash_star:
30
31
  <<: *splash_star
31
-
32
+ #######################################################
32
33
  "yes": &yes
33
34
  title: Yes! プリキュア5
34
35
  started_date: 2007-02-04
@@ -43,7 +44,7 @@ yes_precure_five:
43
44
  <<: *yes
44
45
  yes_precure5:
45
46
  <<: *yes
46
-
47
+ #######################################################
47
48
  yes_gogo: &yes_gogo
48
49
  title: Yes! プリキュア5 Go Go!
49
50
  started_date: 2008-02-03
@@ -59,7 +60,7 @@ yes_precure_five_gogo:
59
60
  <<: *yes_gogo
60
61
  yes_precure5_gogo:
61
62
  <<: *yes_gogo
62
-
63
+ #######################################################
63
64
  fresh: &fresh
64
65
  title: フレッシュプリキュア!
65
66
  started_date: 2009-02-01
@@ -71,7 +72,7 @@ fresh: &fresh
71
72
  - cure_passion
72
73
  fresh_precure:
73
74
  <<: *fresh
74
-
75
+ #######################################################
75
76
  heart_catch: &heart_catch
76
77
  title: ハートキャッチプリキュア!
77
78
  started_date: 2010-02-07
@@ -83,7 +84,7 @@ heart_catch: &heart_catch
83
84
  - cure_moonlight
84
85
  heart_catch_precure:
85
86
  <<: *heart_catch
86
-
87
+ #######################################################
87
88
  suite: &suite
88
89
  title: スイートプリキュア♪
89
90
  started_date: 2011-02-06
@@ -95,7 +96,7 @@ suite: &suite
95
96
  - cure_muse
96
97
  suite_precure:
97
98
  <<: *suite
98
-
99
+ #######################################################
99
100
  smile: &smile
100
101
  title: スマイルプリキュア!
101
102
  started_date: 2012-02-05
@@ -108,7 +109,7 @@ smile: &smile
108
109
  - cure_beauty
109
110
  smile_precure:
110
111
  <<: *smile
111
-
112
+ #######################################################
112
113
  dokidoki: &dokidoki
113
114
  title: ドキドキ!プリキュア
114
115
  started_date: 2013-02-03
@@ -121,7 +122,7 @@ dokidoki: &dokidoki
121
122
  - cure_ace
122
123
  dokidoki_precure:
123
124
  <<: *dokidoki
124
-
125
+ #######################################################
125
126
  happiness_charge: &happiness_charge
126
127
  title: ハピネスチャージプリキュア!
127
128
  started_date: 2014-02-02
data/lib/rubicure.rb CHANGED
@@ -7,6 +7,7 @@ require "rubicure/series"
7
7
  require "rubicure/girl"
8
8
  require "rubicure/core"
9
9
  require "rubicure/movie"
10
+ require "rubicure/cure"
10
11
 
11
12
  module Rubicure
12
13
  def self.core
@@ -20,35 +21,6 @@ module Precure
20
21
  end
21
22
  end
22
23
 
23
- module Cure
24
- def self.method_missing(name, *args)
25
- if Rubicure::Girl.valid?(name)
26
- Rubicure::Girl.find(name)
27
- else
28
- super
29
- end
30
- end
31
-
32
- [Cure.peace, Cure.cure_peace].each do |peace|
33
- class << peace
34
- HANDS =
35
- (['グー'] * 13) +
36
- (['チョキ'] * 14) +
37
- (['パー'] * 15) +
38
- ['グッチョッパー']
39
- MESSAGE = <<EOF
40
- ピカピカピカリン
41
- ジャンケンポン!
42
- (%s)
43
- EOF
44
- def pikarin_janken
45
- print_by_line(MESSAGE % HANDS.sample)
46
- end
47
- alias janken pikarin_janken
48
- end
49
- end
50
- end
51
-
52
24
  module Shiny
53
25
  def self.luminous
54
26
  Rubicure::Girl.find(:luminous)
@@ -0,0 +1,68 @@
1
+ module Cure
2
+ def self.method_missing(name, *args)
3
+ if Rubicure::Girl.valid?(name)
4
+ Rubicure::Girl.find(name)
5
+ else
6
+ super
7
+ end
8
+ end
9
+
10
+ [Cure.peace, Cure.cure_peace].each do |peace|
11
+ class << peace
12
+ HANDS =
13
+ (['グー'] * 13) +
14
+ (['チョキ'] * 14) +
15
+ (['パー'] * 15) +
16
+ ['グッチョッパー']
17
+ MESSAGE = <<EOF
18
+ ピカピカピカリン
19
+ ジャンケンポン!
20
+ (%s)
21
+ EOF
22
+ def pikarin_janken
23
+ print_by_line(MESSAGE % HANDS.sample)
24
+ end
25
+ alias janken pikarin_janken
26
+ end
27
+ end
28
+
29
+ [Cure.passion, Cure.cure_passion].each do |passion|
30
+ class << passion
31
+ ORIGINAL_HUMAN_NAME = "東せつな"
32
+ ANOTHER_HUMAN_NAME = "イース"
33
+
34
+ def !
35
+ humanize
36
+ @another_human_name ||= ANOTHER_HUMAN_NAME
37
+ @state_names[0], @another_human_name = @another_human_name, @state_names[0]
38
+ self
39
+ end
40
+
41
+ def rollback
42
+ @state_names[0] = ORIGINAL_HUMAN_NAME
43
+ @another_human_name = ANOTHER_HUMAN_NAME
44
+ self
45
+ end
46
+ end
47
+ end
48
+
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
60
+
61
+ def rollback
62
+ @state_names[0] = ORIGINAL_HUMAN_NAME
63
+ @another_human_name = ANOTHER_HUMAN_NAME
64
+ self
65
+ end
66
+ end
67
+ end
68
+ end
data/lib/rubicure/girl.rb CHANGED
@@ -45,9 +45,12 @@ module Rubicure
45
45
  self
46
46
  end
47
47
 
48
- def humanize
48
+ def humanize!
49
49
  @current_state = 0
50
+ self
50
51
  end
52
+ alias :humanize :humanize!
53
+ deprecate :humanize, :humanize!
51
54
 
52
55
  def attack!
53
56
  raise "require transform" if current_attack_message.blank?
@@ -1,3 +1,3 @@
1
1
  module Rubicure
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/spec/cure_spec.rb ADDED
@@ -0,0 +1,87 @@
1
+ describe "Cure" do
2
+ describe ".peace" do
3
+ describe "#pikarin_janken" do
4
+ subject{ girl.pikarin_janken }
5
+
6
+ shared_examples :do_janken do
7
+ it{ should match %r/ピカピカピカリン\nジャンケンポン!\n(.+)/ }
8
+ end
9
+
10
+ context "When peace" do
11
+ let(:girl){ Cure.peace }
12
+ it_behaves_like :do_janken
13
+ end
14
+
15
+ context "When cure_peace" do
16
+ let(:girl){ Cure.cure_peace }
17
+ it_behaves_like :do_janken
18
+ end
19
+ end
20
+ end
21
+
22
+ describe ".passion" do
23
+ describe "!" do
24
+ subject{ !Cure.passion }
25
+
26
+ let(:girl){ Cure.passion }
27
+
28
+ after do
29
+ girl.rollback
30
+ girl.humanize
31
+ end
32
+
33
+ context "called once" do
34
+ it{ expect{ subject }.to change{ girl.name }.from("東せつな").to("イース") }
35
+ end
36
+
37
+ context "called twice" do
38
+ before do
39
+ !Cure.passion
40
+ end
41
+
42
+ it{ expect{ subject }.to change{ girl.name }.from("イース").to("東せつな") }
43
+ end
44
+
45
+ context "after transform" do
46
+ before do
47
+ girl.transform!
48
+ end
49
+
50
+ it{ expect{ subject }.to change{ girl.name }.from("キュアパッション").to("イース") }
51
+ end
52
+ end
53
+ end
54
+
55
+ describe ".beat" do
56
+ describe "!" do
57
+ subject{ !Cure.beat }
58
+
59
+ let(:girl){ Cure.beat }
60
+
61
+ after do
62
+ girl.rollback
63
+ girl.humanize
64
+ end
65
+
66
+ context "called once" do
67
+ it{ expect{ subject }.to change{ girl.name }.from("黒川エレン").to("セイレーン") }
68
+ end
69
+
70
+ context "called twice" do
71
+ before do
72
+ !Cure.beat
73
+ end
74
+
75
+ it{ expect{ subject }.to change{ girl.name }.from("セイレーン").to("黒川エレン") }
76
+ end
77
+
78
+ context "after transform" do
79
+ before do
80
+ girl.transform!
81
+ end
82
+
83
+ it{ expect{ subject }.to change{ girl.name }.from("キュアビート").to("セイレーン") }
84
+ end
85
+ end
86
+ end
87
+ end
data/spec/girl_spec.rb CHANGED
@@ -157,4 +157,29 @@ EOF
157
157
  it { expect{ subject }.to raise_error NoMethodError }
158
158
  end
159
159
  end
160
+
161
+ shared_examples :a_humanize_method do
162
+ it { should be_an_instance_of Rubicure::Girl }
163
+ it { expect(girl.current_state).to eq 0 }
164
+ end
165
+
166
+ describe "humanize!" do
167
+ let(:humanize!){ girl.humanize! }
168
+
169
+ context "When not transformed" do
170
+ subject!{ humanize! }
171
+
172
+ it_behaves_like :a_humanize_method
173
+ end
174
+
175
+ context "When after transformed" do
176
+ before do
177
+ girl.transform!
178
+ end
179
+
180
+ subject!{ humanize! }
181
+
182
+ it_behaves_like :a_humanize_method
183
+ end
184
+ end
160
185
  end
@@ -114,22 +114,4 @@ describe Rubicure do
114
114
  it { expect( Milky.rose.precure_name ).to eq "ミルキィローズ" }
115
115
  end
116
116
  end
117
-
118
- describe "#pikarin_janken" do
119
- subject{ girl.pikarin_janken }
120
-
121
- shared_examples :do_janken do
122
- it{ should match %r/ピカピカピカリン\nジャンケンポン!\n(.+)/ }
123
- end
124
-
125
- context "When peace" do
126
- let(:girl){ Cure.peace }
127
- it_behaves_like :do_janken
128
- end
129
-
130
- context "When cure_peace" do
131
- let(:girl){ Cure.cure_peace }
132
- it_behaves_like :do_janken
133
- end
134
- end
135
117
  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.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-21 00:00:00.000000000 Z
11
+ date: 2014-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -231,6 +231,7 @@ files:
231
231
  - lib/rubicure.rb
232
232
  - lib/rubicure/concerns/util.rb
233
233
  - lib/rubicure/core.rb
234
+ - lib/rubicure/cure.rb
234
235
  - lib/rubicure/girl.rb
235
236
  - lib/rubicure/movie.rb
236
237
  - lib/rubicure/series.rb
@@ -238,6 +239,7 @@ files:
238
239
  - lib/ubicure.rb
239
240
  - rubicure.gemspec
240
241
  - spec/core_spec.rb
242
+ - spec/cure_spec.rb
241
243
  - spec/girl_spec.rb
242
244
  - spec/movie_spec.rb
243
245
  - spec/rubicure_spec.rb
@@ -269,6 +271,7 @@ specification_version: 4
269
271
  summary: All about Japanese battle heroine "Pretty Cure (Precure)".
270
272
  test_files:
271
273
  - spec/core_spec.rb
274
+ - spec/cure_spec.rb
272
275
  - spec/girl_spec.rb
273
276
  - spec/movie_spec.rb
274
277
  - spec/rubicure_spec.rb